Files
gentoo/app-shells/bash/files/profile.d/00-prompt-command.sh
Kerin Millar d04f29919a app-shells/bash: add 5.2_p37-r4 & 5.3_p3-r1, revise 9999, address PR #42626
This commit introduces 5.2_p37-r4 and bash-5.3_p3-r1, as well as
revising bash-9999. The effective changes are described herewith.

Install a new /etc/profile.d drop-in, named "00-prompt-command.sh". It
serves to initialise the PROMPT_COMMAND variable as early as is
conveniently possible, provided that bash is acting as a login shell.

Install a revision of the /etc/bash/bashrc file that refrains from
initialising the PROMPT_COMMAND variable, provided that bash is acting
as a login shell. Along with the aforementioned change, this amounts to
a simplified interpretation of GitHub PR #42626. Though not a common
practice, some /etc/profile.d drop-ins (such as vte-2.91.sh) need to be
able to manipulate PROMPT_COMMAND and had hitherto been stymied by
bashrc proceeding to unconditionally clobber it.

Finally, refrain from installing 15-gentoo-bashrc-check.bash to
/etc/bash/bashrc.d. At the time of its introduction, I recommended that
it should exist for no longer than a year. Its removal is overdue.

Reported-by: Krzesimir Nowak <knowak@microsoft.com>
Part-of: https://github.com/gentoo/gentoo/pull/42626
Closes: https://github.com/gentoo/gentoo/pull/42626
Signed-off-by: Kerin Millar <kfm@plushkava.net>
Signed-off-by: Sam James <sam@gentoo.org>
2025-08-18 16:50:58 +01:00

8 lines
309 B
Bash

# This unit serves to initialise PROMPT_COMMAND as early as possible in cases
# where bash has been launched as a login shell. Though not an especially
# common practice, some profile.d drop-ins need to be able to extend its value.
if [ "${BASH}" ] && shopt -q login_shell; then
eval 'PROMPT_COMMAND=()'
fi