autojump not working in Ubuntu

Created on 10 Nov 2015  ·  6Comments  ·  Source: wting/autojump

I did sudo apt-get install autojump which installed v21.7.1; however, it does not pick up directories that i cd into, as I can verify with j -s. There's a remark in the readme that warns people to mess around with $PROMPT_COMMAND, and, in fact, i had

export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"

in my .bashrc. I've since out-commented that line, restarted and re-installed autojump to no avail.

1)—could the cause of autojump not working be something else?

2)—the readme isn't very clear of what a working $PROMPT_COMMAND line would have too look like; is export PROMPT_COMMAND="history -a" meant as an example for how to _do_ it or for how _not_ to do it (disclosure: I tried and sourced, to no avail)

3)—the readme doesn't give away a clear diagnostic to ascertain whether $PROMPT_COMMAND is or is not the culprit; IOW: what value/text should that variable have/contain to make autojump work properly?

Most helpful comment

Update I added source /usr/share/autojump/autojump.bash to my .bashrc as recommended by http://askubuntu.com/a/185996. Now the autojump DB does pick up directories as I visit them.

However, now when I do j xxx I do get a suggested target path printed out, but autojump leaves it at that and does not cd into that directory.

I think the current issue is still valid, so I leave it open.

All 6 comments

Update I added source /usr/share/autojump/autojump.bash to my .bashrc as recommended by http://askubuntu.com/a/185996. Now the autojump DB does pick up directories as I visit them.

However, now when I do j xxx I do get a suggested target path printed out, but autojump leaves it at that and does not cd into that directory.

I think the current issue is still valid, so I leave it open.

Hrm, I just looked in autojump.bash and it does an awful lot more than the docs indicated.

I use PROMPT_COMMAND for something else, but the docs said autojump needs it for things, so I was careful to add 'history -a' as the docs indicated I'd need to do; but, of course, it still didn't pick up new directories.

Source diving on autojump.bash indicated I really needed to simply source autojump after I add my PROMPT_COMMAND _or_ add 'autojump_add_to_database' (not history -a).

:+1: on ubuntu autojump does not cd, only prints the path

Is this still an issue?

I barely remember the discussion... (2016?). It's solved on my end. I couldn't say if it's a problem for others, but the trouble for me was that I overuse my PROMPT_COMMAND and I have to really carefully inject autojump manually or it won't work.

I'm still facing this issue. It's just printing the current path and not actually cd-ing.

Was this page helpful?
0 / 5 - 0 ratings