Re: Feature request: PROMPT_COMMANDS array variable

2018-02-12 Thread Chet Ramey
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

Re: Feature request: PROMPT_COMMANDS array variable

2018-02-05 Thread Chet Ramey
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

Re: Feature request: PROMPT_COMMANDS array variable

2018-02-05 Thread Greg Wooledge
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

Re: Feature request: PROMPT_COMMANDS array variable

2018-02-03 Thread Egmont Koblinger
Hi, I'd like to second this feature request. As Daniel mentioned, the biggest problem with the current single variable approach that it's hardly usable due to lack of coordination between distributions as well as apps that wish to modify PROMPT_COMMAND. Let's look at it at more details. There

Re: Feature request: PROMPT_COMMANDS array variable

2018-01-23 Thread Daniel Colascione
Sure, but you have a coordination problem. Everyone is going to use a different array name, and since scripts have no way of knowing in advance to what array they need to add their function, we end up the same spot. Putting the array in the core would solve the coordination problem. On Jan 23,

Re: Feature request: PROMPT_COMMANDS array variable

2018-01-23 Thread Clark Wang
On Wed, Jan 24, 2018 at 2:23 AM, 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

Re: Feature request: PROMPT_COMMANDS array variable

2018-01-23 Thread tetsujin
Well, PROMPT_COMMAND does take shell syntax, so if this is just a question of getting multiple commands in there, you can separate them with semicolons. That said, I do think using an array would be nicer (mainly, it's easier to manipulate the list of commands programmatically) but then you

Feature request: PROMPT_COMMANDS array variable

2018-01-23 Thread Daniel Colascione
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