Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #239459

Re: Get Terminal to Echo line in buffer on backspace

From Greg Wooledge <greg@wooledge.org>
Newsgroups linux.debian.user
Subject Re: Get Terminal to Echo line in buffer on backspace
Date 2021-08-30 15:20 +0200
Message-ID <CRPmF-6mv-1@gated-at.bofh.it> (permalink)
References <CROJX-5U5-1@gated-at.bofh.it> <CROTE-5XB-7@gated-at.bofh.it> <CRP3j-60U-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


> On 30/08/2021 14:41, Greg Wooledge wrote:
> > What you want to do is redraw the current command.  The easiest way to
> > do this is to press Ctrl-L.  (Or if you're in vi mode, ESC Ctrl-L, and
> > then you'll need to go back to command mode.)

(I mis-spoke slightly.  I meant "exit from command mode".  But this user
probably isn't in vi mode so it probably doesn't matter.)

On Mon, Aug 30, 2021 at 02:57:42PM +0200, Thomas Anderson wrote:
> It's hard for me to describe, so here is an example of I am looking to
> emulate (this is from a mac).
> 
> https://cloud.little-beak.com/s/KxpjEHJ5RTEYZmS
> 
> On debian, I have tried many different terminal emulators, and all the
> visible options to get this type
> 
> of behavior, but have failed. =(

What you're asking for sounds like "every time I backspace, I want
the shell to erase the current prompt and command and redraw them
from scratch, just in case there's some line noise on my terminal".
This is wasteful, and is not an available mode in bash.  I can't speak
for other shells.

You simply aren't going to get that behavior.  So I'm telling you how
you can work around the problem, or fix your *underlying problem*.

When "line noise" scribbles on your interactive shell prompt and makes
it too difficult to see what you're typing, you can either redraw the
screen (Ctrl-L), or power through, knowing what's there even if you
cannot see it, having faith in knowing what your fingers have done.
(For most of us, redrawing will be preferable.)

If the "line noise" is actually output from some job that *you* launched,
then you may wish to reconsider your work habits which are leading to
the undesired situation.  Run this background job in a different way,
which doesn't interfere with your ongoing work.

If you're getting *genuine* line noise (from an analog modem connection),
then you have my sympathy.  I haven't used an analog modem in many years.
But for modem use, there's a *really good reason* you don't redraw the
user's entire shell prompt & command on a frequent basis -- it's SLOW!
The amount of time it would take to redraw the prompt & command over a
slow (and noisy) analog modem line would be significant, and would annoy
you.  A lot.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Get Terminal to Echo line in buffer on backspace Thomas Anderson <thomas.anderson@little-beak.com> - 2021-08-30 14:40 +0200
  Re: Get Terminal to Echo line in buffer on backspace Nicolas George <george@nsup.org> - 2021-08-30 14:50 +0200
  Re: Get Terminal to Echo line in buffer on backspace Greg Wooledge <greg@wooledge.org> - 2021-08-30 14:50 +0200
    Re: Get Terminal to Echo line in buffer on backspace Thomas Anderson <thomas.anderson@little-beak.com> - 2021-08-30 15:00 +0200
      Re: Get Terminal to Echo line in buffer on backspace Greg Wooledge <greg@wooledge.org> - 2021-08-30 15:20 +0200
        Re: Get Terminal to Echo line in buffer on backspace songbird <songbird@anthive.com> - 2021-08-31 04:00 +0200
      Re: Get Terminal to Echo line in buffer on backspace Nicolas George <george@nsup.org> - 2021-08-30 17:10 +0200
    Re: Get Terminal to Echo line in buffer on backspace Nicolas George <george@nsup.org> - 2021-08-30 17:10 +0200
      Re: Get Terminal to Echo line in buffer on backspace Greg Wooledge <greg@wooledge.org> - 2021-08-30 17:40 +0200
        Re: Get Terminal to Echo line in buffer on backspace David Wright <deblis@lionunicorn.co.uk> - 2021-08-31 16:10 +0200
          Re: Get Terminal to Echo line in buffer on backspace Nicolas George <george@nsup.org> - 2021-08-31 16:20 +0200
            Re: Get Terminal to Echo line in buffer on backspace David Wright <deblis@lionunicorn.co.uk> - 2021-08-31 16:50 +0200
          Re: Get Terminal to Echo line in buffer on backspace Greg Wooledge <greg@wooledge.org> - 2021-08-31 16:50 +0200
            Re: Get Terminal to Echo line in buffer on backspace David Wright <deblis@lionunicorn.co.uk> - 2021-09-01 16:10 +0200
        Re: Get Terminal to Echo line in buffer on backspace Thomas Anderson <thomas.anderson@little-beak.com> - 2021-09-02 05:50 +0200
          Re: Get Terminal to Echo line in buffer on backspace Greg Wooledge <greg@wooledge.org> - 2021-09-02 15:40 +0200

csiph-web