GithubHelp home page GithubHelp logo

Comments (11)

hat082 avatar hat082 commented on July 30, 2024 1

That solved the issue. My god you are a genius!

from zoxide.

ajeetdsouza avatar ajeetdsouza commented on July 30, 2024

the cd command doesn't seem to work?

Can you elaborate?

from zoxide.

ajeetdsouza avatar ajeetdsouza commented on July 30, 2024

P.S. you need cd to a directory the usual way at least once, so that zoxide can learn which directories you use.

This video might help: https://www.youtube.com/watch?v=aghxkpyRVDY

from zoxide.

hat082 avatar hat082 commented on July 30, 2024

I am so sorry for the late reply..
I'm new to github and didn't know how to check notifications...

I did use cd at least once, my understanding is that using $(zoxide init bash --cmd cd) aliases the z command with cd

but if I use this setup i can no longer use cd nor z?

from zoxide.

hat082 avatar hat082 commented on July 30, 2024

image
as you can see, if i set this --cmd cd, on startup of the wsl I cannot use cd anymore

but if i source the .bashrc file manually
image

cd (or z's replacement for cd) now works as expected.

the unknown option: --bash is probably from some other line in the .bashrc file I think

from zoxide.

ajeetdsouza avatar ajeetdsouza commented on July 30, 2024

Something is definitely wrong with your bashrc configuration. If you can share it here, I can take a look.

from zoxide.

hat082 avatar hat082 commented on July 30, 2024

Thank you so much QAQ
bashrc.txt

I believe the ~/.bash_aliases file is empty so that shouldn't be the problem

from zoxide.

ajeetdsouza avatar ajeetdsouza commented on July 30, 2024
  1. The same .bashrc file works for me (WSL + zoxide v0.9.4). Are you running a different version of zoxide?
zoxide -V
  1. Are you able to find the line that's causing the --bash error? You can find it by using set -x right at the top of your bashrc file (enables debugging).
  2. What is the output of type cd?

from zoxide.

hat082 avatar hat082 commented on July 30, 2024

with the --cmd cd option i could no longer use cd so i ctrl c out of it
image

here's the type cd and zoxide -V outputs
image

image
after i source bashrc it works now

I tried the set -x option and it gives me a lot of outputs but i dont really know how to interpret this output

from zoxide.

ajeetdsouza avatar ajeetdsouza commented on July 30, 2024

You have 2 versions of zoxide installed on your system. I'm guessing you first installed it using sudo apt install zoxide, and then ran the install script from the README after that.

To fix this:

sudo apt remove zoxide

In your .bashrc:

export PATH="$HOME/.local/bin:$PATH"
eval "$(zoxide init bash --cmd cd)"

from zoxide.

JacobKovarovic avatar JacobKovarovic commented on July 30, 2024

I'm having a similar issue and I've tried everything mentioned in this issue so far. I used the script to install zoxide and added it to my .bashrc. When I source .bashrc it works fine, but when I start a new terminal it says "Command 'zoxide' not found". I made sure everything was added to $PATH and it works whenever I source the bashrc.

image

Bashrc

image

$HOME/.local/bin is already in $PATH

OS: Ubuntu 22.04.4
Kernel: WSL2
Shell: Bash 5.1.16

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.