Giter Club home page Giter Club logo

Comments (8)

slak44 avatar slak44 commented on May 28, 2024 1

It might be a good idea to mention PROMPT_COMMAND in the documentation somewhere, as the reason why zoxide should be last. I set that variable in my bash config as well, and until @kringalf mentioned it in his comment, I didn't notice the order.

from zoxide.

kringalf avatar kringalf commented on May 28, 2024

I have the same issue on ubuntu 22.04 but running eval "$(zoxide init bash)" again doesn't solve the issue here, the db file only grows if i call zoxide add . in the directory

user@host:~>zoxide --version; fzf --version; alias cd;mkdir /tmp/new_dir;stat --printf="%s\n" ~/.local/share/zoxide/db.zo; cd /tmp/new_dir; cd; stat --printf="%s\n" ~/.local/share/zoxide/db.zo
zoxide 0.9.4
0.46.1 (3c0a630)
alias cd='z'
165
165

from zoxide.

ajeetdsouza avatar ajeetdsouza commented on May 28, 2024

It's possible something else is overriding the prompt. Could you try making zoxide init the last line in your shell config?

from zoxide.

kringalf avatar kringalf commented on May 28, 2024

Note: This is only usefull for my setup since i wanna use the history command in a non default way. So this might only be helpfull for users that also change the bash environment variable PROMPT_COMMAND on their system
For me, with my history -a addon, it helped setting the PROMPT_COMMAND to:

PROMPT_COMMAND="history -a ; __zoxide_hook;${PROMPT_COMMAND#;}"

Now the db file increases after using cd to a new dir

from zoxide.

aidandeli avatar aidandeli commented on May 28, 2024

eval "$(zoxide init --cmd cd bash)" is the last line in my config file.

I added the line @kringalf mentioned but I'm still having no luck.

from zoxide.

ajeetdsouza avatar ajeetdsouza commented on May 28, 2024

@aidandeli what's the output of echo "$PROMPT_COMMAND"? It should contain __zoxide_hook, otherwise something is overriding your prompt.

from zoxide.

aidandeli avatar aidandeli commented on May 28, 2024

Ah yeah, the output was just echo

Adding export PROMPT_COMMAND="__zoxide_hook;echo" after zoxide init in my config file fixed it.

from zoxide.

ajeetdsouza avatar ajeetdsouza commented on May 28, 2024

Ah yeah, the output was just echo

That typically means something is running after zoxide init and overriding your PROMPT_COMMAND. You can use set -x in your .bashrc to debug this.

from zoxide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.