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, 12 Feb 2018 10:54:22 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 1/23/18 1:23 PM, Daniel Colascione wrote:
> Right now, PROMPT_COMMAND gives a shell command to run before displaying
> the prompt. It's common these days to include in one's bash configuration
> numerous packages from different sources that *all* want to run code at
> PROMPT_COMMAND time. Can we add a new PROMPT_COMMANDS array variable that
> stores a list of shell commands to execute? With a PROMPT_COMMANDS
> variable, different packages can independently add their hooks without
> stepping on each other.

I think the way to go forward on this is to make PROMPT_COMMAND an array
variable in a future version of bash. This is completely backwards-
compatible with current usage.

In the meantime, appending using $'\n' as a separator is the best way to
add commands to $PROMPT_COMMAND.

Chet

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