help-bash
[Top][All Lists]
Advanced

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

Re: Feature request for PS0


From: Chet Ramey
Subject: Re: Feature request for PS0
Date: Mon, 7 Feb 2022 16:39:57 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.1

On 2/7/22 11:51 AM, Akbarkhon Variskhanov wrote:
Hello.

Would it be possible to add an option or easy configuration of where PS0 is
placed?

Not easily. PS0 is a strictly bash feature, something that gets output
after the line is edited and completed. Prompting, line editing, and
redisplay are handled by readline. Readline doesn't have any capability
to add arbitrary strings in front of the line when hitting enter like this:

I really want to have PS0 appear side-by-side with PS1 but in front
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!

and I have no plans to add one.

If someone would like to take a shot at hooking into readline's accept-line
function like this, I'd be glad to look at the results.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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