[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Get Terminal to Echo line in buffer on backspace



On Tue 31 Aug 2021 at 16:13:52 (+0200), Nicolas George wrote:
> David Wright (12021-08-31):
> > The only useful effect of that binding that I've seen is not when
> > typing ahead, but at the normal command line
> 
> Of course. When typing ahead, your shell's line editor is not in action,
> and therefore its bindings will have no effect immediately. They will
> have an effect when the interactive shell resumes and received the
> keystrokes.
> 
> Before that, you are running with the tty's line editor, and therefore
> its bindings are the one in action. See the output of stty -a.
> 
> The behavior of ttys is one of the trickiest part of Unix's user
> interface, and we are directly dealing with it here. Be sure you
> understand what is going on and who is doing what task; otherwise you
> will be utterly confused.

That seems reasonable. So in summary, ESC 1 ^L gives a clean refresh
of the command line when you're at a shell prompt, and ^R prints the
contents of your typeahead buffer when you're not.

I think that's what the OP /really/ wants. I can see no point in tying
the ^R refresh to the Backspace key: if you rubout four characters,
why would you want four refreshes?

Perhaps, in some way, the OP hasn't got rprnt = ^R listed in their
$ stty -a   output, but that's beyond my knowledge.

Cheers,
David.


Reply to: