help-bash
[Top][All Lists]
Advanced

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

Re: Feature request for PS0


From: Akbarkhon Variskhanov
Subject: Re: Feature request for PS0
Date: Tue, 8 Feb 2022 09:46:36 +0500

Brilliant! All done within readline. This is so far the best implementation
of my idea that actually works and doesn't cause wreckage. It even
timestamps every line in a compound list in a multi-line command. I give it
triple C: clear, concise, clever. :)

I changed carriage returns to newlines, though.

You have just cured my OCD and improved my shell life.

Thank you.

On Tue, Feb 8, 2022 at 4:59 AM Koichi Murase <myoga.murase@gmail.com> wrote:

> 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]