bug-bash
[Top][All Lists]
Advanced

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

Re: Feature request: PROMPT_COMMANDS array variable


From: Chet Ramey
Subject: Re: Feature request: PROMPT_COMMANDS array variable
Date: Mon, 5 Feb 2018 11:42:52 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 2/5/18 9:05 AM, Greg Wooledge wrote:
> On Sat, Feb 03, 2018 at 02:57:33PM +0100, Egmont Koblinger wrote:
>> So the use case is: Someone wants to _add_ something to
>> PROMPT_COMMAND. How to do that?
> 
> PROMPT_COMMAND+=$'\n''my new stuff'
> 
> Or, test whether PROMPT_COMMAND is currently empty, and only
> append the newline (or semicolon) if it's non-empty.  But the newline
> should work in either case.

This is one of the options Egmont proposed in the message you quoted.

The downside is slight: "the slight drawback is that the output of a
simple, unquoted «echo $PROMPT_COMMAND» is pretty confusing. And, of
course, this is not a solution that suddenly occurs to everyone as
trivially as appending to an array."

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



reply via email to

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