Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #16141 > unrolled thread
| Started by | "Franklin, Jason" <jason.franklin@quoininc.com> |
|---|---|
| First post | 2020-04-15 14:59 -0400 |
| Last post | 2020-04-15 14:59 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[bug] PROMPT_COMMAND is not executed as expected in some situations "Franklin, Jason" <jason.franklin@quoininc.com> - 2020-04-15 14:59 -0400
| From | "Franklin, Jason" <jason.franklin@quoininc.com> |
|---|---|
| Date | 2020-04-15 14:59 -0400 |
| Subject | [bug] PROMPT_COMMAND is not executed as expected in some situations |
| Message-ID | <mailman.355.1586977153.3066.bug-bash@gnu.org> |
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -g -O2 -fdebug-prefix-map=/build/bash-orJ5jM/bash-5.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wall -Wno-parentheses -Wno-format-security uname output: Linux qipb7lnca 5.4.0-0.bpo.4-amd64 #1 SMP Debian 5.4.19-1~bpo10+1 (2020-03-09) x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Version: 5.0 Patch Level: 16 Release Status: release Description: I have discovered that PROMPT_COMMAND is not executed before the printing of PS1 in the following three situations: (1) <C-x><C-e> is used (2) histverify is set (3) completion suggestions are shown Repeat-By: # (1) <C-x><C-e> is used bash --norc PROMPT_COMMAND=echo # enter <C-x><C-e>, type out command "true" and save and quit # note that PROMPT_COMMAND is not executed # (2) histverify is set bash --norc PROMPT_COMMAND=echo shopt -s histverify !! # note that PS1 is printed w/ last command, but PROMPT_COMMAND # is not run # (3) completion suggestions are shown bash --norc PROMPT_COMMAND=echo he<Tab><Tab> # ... completions are listed # PS1 is printed after suggestions, but PROMPT_COMMAND is # not run Suggested Fix: I tried to add code to execute PROMPT_COMMAND directly inside of prompt_again(), but that didn't work as expected (the prompt would not even print when I tried this). It may be that PROMPT_COMMAND needs to be more tightly coupled to the code that prints PS1. I thought it would be as simple as that, but I guess not! In any case, I hope this helps improve Bash. Thanks a ton! -- Jason Franklin
Back to top | Article view | gnu.bash.bug
csiph-web