wting / autojump

A cd command that learns - easily navigate directories from the command line
Other
16.3k stars 705 forks source link

autojump not working in Ubuntu #389

Open loveencounterflow opened 9 years ago

loveencounterflow commented 9 years ago

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?

loveencounterflow commented 9 years ago

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.

jettero commented 8 years ago

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).

mgcrea commented 8 years ago

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

r-barnes commented 6 years ago

Is this still an issue?

jettero commented 6 years ago

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.

himat commented 4 years ago

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

arnchkv commented 3 years ago

I had an issue after installing autojump it was not working. My configuration was Ubuntu 20.4 with bash-it installed. What I did was I placed the ". /usr/share/autojump/autojump.sh" before "HISTCONTROL" is set in my .bashrc file. I sourced the .bashrc file and it worked like a charm.