[UPDATE][SCRIPT] Use expansion for PROMPT_COMMAND
It seems like the idiomatic way to update $PROMPT_COMMAND is to use variable expansion to add a semi-colon and a space before the command we're adding. I also switched from prepending my commands to appending them, which allows overriding behaviour, such as terminal titles which could be set from system files.
This commit is contained in:
parent
173a0b093c
commit
2e927c89e7
2 changed files with 2 additions and 2 deletions
|
|
@ -36,7 +36,7 @@ __term_title_prompt_command() {
|
|||
|
||||
case "$TERM" in
|
||||
xterm*|term_title*)
|
||||
[ -n "$BASH_VERSION" ] && PROMPT_COMMAND="__term_title_prompt_command;$PROMPT_COMMAND"
|
||||
[ -n "$BASH_VERSION" ] && PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND; }__term_title_prompt_command"
|
||||
[ -n "$ZSH_VERSION" ] && precmd_functions+=(__term_title_prompt_command)
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue