Skip to content

Conversation

@parkermo
Copy link

@parkermo parkermo commented Oct 9, 2025

Every execution of $PROMPT_COMMAND throws a syntax error for me using bash version 5.2.37(1)-release (x86_64-pc-linux-gnu). The syntax error message goes away if I remove the space before the semi-colon in the modified PROMPT_COMMAND.

In ~/.bash_aliases, I have: . /usr/share/autojump/autojump.sh.

Broken:

~$ bash --version
GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
bash: PROMPT_COMMAND: line 19: syntax error near unexpected token `;'
bash: PROMPT_COMMAND: line 19: ` ; autojump_add_to_database'
~$ echo $PROMPT_COMMAND
__bp_precmd_invoke_cmd history -a ; autojump_add_to_database __bp_interactive_mode
bash: PROMPT_COMMAND: line 20: syntax error near unexpected token `;'
bash: PROMPT_COMMAND: line 20: ` ; autojump_add_to_database'

(Line number increases with each prompt that your terminal generates, so it does not point to autojump.sh line number).

After making this change:

~$ bash --version
GNU bash, version 5.2.37(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
~$ echo $PROMPT_COMMAND
__bp_precmd_invoke_cmd history -a autojump_add_to_database __bp_interactive_mode

I noticed this only recently, so it could be related to an update in Bash.

Every execution of $PROMPT_COMMAND throws a syntax error for me using bash version 5.2.37(1)-release (x86_64-pc-linux-gnu). The syntax error message goes away if I remove the space before the semi-colon in the modified PROMPT_COMMAND.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant