1
0
mirror of https://github.com/wting/autojump synced 2025-12-04 21:52:00 +00:00

autojump.bash: fix bash PROMPT_COMMAND space syntax error

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.
This commit is contained in:
Parker Moore 2025-10-09 12:26:37 -07:00 committed by GitHub
parent ee21082751
commit df0261a52a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,7 +47,7 @@ case $PROMPT_COMMAND in
*autojump*)
;;
*)
PROMPT_COMMAND="${PROMPT_COMMAND:+$(echo "${PROMPT_COMMAND}" | awk '{gsub(/; *$/,"")}1') ; }autojump_add_to_database"
PROMPT_COMMAND="${PROMPT_COMMAND:+$(echo "${PROMPT_COMMAND}" | awk '{gsub(/; *$/,"")}1'); }autojump_add_to_database"
;;
esac