help-bash
[Top][All Lists]
Advanced

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

Re: Feature request for PS0


From: Koichi Murase
Subject: Re: Feature request for PS0
Date: Tue, 8 Feb 2022 08:58:32 +0900

2022年2月8日(火) 4:14 Akbarkhon Variskhanov <akbarkhon.variskhanov@gmail.com>:
> of it, so that the whole command line looks like this after having been
> read:
> ~ echo "Hello, Wo # not finished typing
> ~ echo "Hello, World!" # finished typing, pressing Enter
> 21:39:44 ~ echo "Hello, World!"
> Hello, World!

Maybe this is just another hack that has some corner cases, but how about this?

bind -x '"\xC0\a":printf "%(%T)T "'
bind '"\xC0\r":accept-line'
bind '"\r":"\xC0\a\xC0\r"'

\C-j, \C-o, or other keybindings that execute commands can also be
rewritten in the same idea.

\xC0 + (7bit char) is an invalid two-byte UTF-8 sequence so will never
appear in the input stream as far as you are using UTF-8. If you do
not use UTF-8, these sequences should be replaced by something that
the current encoding does not contain or you will never use.

--
Koichi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]