Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16801

Re: How to use PROMPT_COMMAND(S) without breaking other scripts

From Koichi Murase <myoga.murase@gmail.com>
Newsgroups gnu.bash.bug
Subject Re: How to use PROMPT_COMMAND(S) without breaking other scripts
Date 2020-08-25 00:38 +0900
Message-ID <mailman.1008.1598283519.2469.bug-bash@gnu.org> (permalink)
References <CAKOZuevPZ1xwhLmLzXt_a=G+azDTouO52MCA=wvh=-M82wzaSQ@mail.gmail.com> <17a0ba52-32ee-b9bc-72ff-3587b2050fbd@case.edu> <CAFLRLk9vNPM5NtypB2UNcDqMZfG3Lmi3zEMGfPqZNacmHCoAoA@mail.gmail.com> <0c10b76f-a7f0-1c52-77b7-4b208035956b@case.edu> <CAFLRLk-BnZ-Mau=TQ43ALwGsFzs7PHawkF3fKZ1HH_O=y_HF0Q@mail.gmail.com>

Show all headers | View raw


2020-08-24 23:57 Chet Ramey <chet.ramey@case.edu>:
> There's no real good solution. I wanted a clean break between the scalar
> and array versions, figuring that the distributions that populated
> PROMPT_COMMAND could easily make that PROMPT_COMMANDS[0].

Thank you for your reply.  OK, if there would be no better solution, I
would go with the first option (to convert PROMPT_COMMAND to
PROMPT_COMMANDS and append mine to PROMPT_COMMANDS) and see if
something happens.

> The problem there is that it interferes with the ability to use
> both, as some distros might want as a transition, and result in
> commands being executed twice.

Now I see the points.  I didn't come to the idea to set the values to
both as I somehow unconsciously assumed that everyone checks the Bash
version when one uses PROMPT_COMMANDS.  Thank you for pointing this
out.  This means that I need to be careful if I would convert
PROMPT_COMMAND set by others into PROMPT_COMMANDS.

--
Koichi

Back to gnu.bash.bug | Previous | Next | Find similar


Thread

Re: How to use PROMPT_COMMAND(S) without breaking other scripts Koichi Murase <myoga.murase@gmail.com> - 2020-08-25 00:38 +0900

csiph-web