Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

autojump not working in Ubuntu #389

Open
loveencounterflow opened this issue Nov 10, 2015 · 7 comments
Open

autojump not working in Ubuntu #389

loveencounterflow opened this issue Nov 10, 2015 · 7 comments

Comments

@loveencounterflow
Copy link

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
Copy link
Author

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
Copy link

jettero commented Feb 9, 2016

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
Copy link

mgcrea commented Feb 24, 2016

👍 on ubuntu autojump does not cd, only prints the path

@r-barnes
Copy link

Is this still an issue?

@jettero
Copy link

jettero commented Aug 10, 2018

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
Copy link

himat commented Nov 26, 2020

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

@arnchkv
Copy link

arnchkv commented Jul 2, 2021

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.

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

No branches or pull requests

6 participants