Open SmallPineApp1e opened 9 months ago
See what you get if you do echo $PROMPT_COMMAND
. In my case it showed that USER_PROMPT_COMMAND
is run at the end of PROMPT_COMMAND
.
I then edited ~/.autojump/share/autojump/autojum.bash
(change as appropriate if your shell isn't bash) to replace the line
PROMPT_COMMAND="${PROMPT_COMMAND:+$(echo "${PROMPT_COMMAND}" | awk '{gsub(/; *$/,"")}1') ; }autojump_add_to_database"
with
USER_PROMPT_COMMAND="${USER_PROMPT_COMMAND:+$(echo "${USER_PROMPT_COMMAND}" | awk '{gsub(/; *$/,"")}1') ; }autojump_add_to_database"
. That got autojump working for me.
When I installed autojump by git clone xxx && install.py, I added that code in my ~/.bashrc and source it
[[ -s /home/zengzhijie/.autojump/etc/profile.d/autojump.sh ]] && source /home/zengzhijie/.autojump/etc/profile.d/autojump.sh
but it reminded me "-bash: PROMPT_COMMAND: readonly variable", and autojump didn't work, can someone help me? :(