wavetermdev / waveterm

An open-source, cross-platform terminal for seamless workflows
https://www.waveterm.dev
Apache License 2.0
4.32k stars 111 forks source link

cd does not change directory #161

Open Hamatti opened 10 months ago

Hamatti commented 10 months ago

Describe the bug Running cd [folder] does not do anything.

To Reproduce Steps to reproduce the behavior:

  1. run cd folder/
  2. [nothing happens]

(see screenshot below)

Expected behavior It should change to [folder].

Screenshots waveterm-bug-cd

Desktop (please complete the following information):

sawka commented 10 months ago

Thanks for submitting. This is a really strange bug. Not sure why it is coming up for you -- obviously cd works when we do our internal testing, and I haven't seen this happening to anyone else (note that #163 is a different issue).

Not sure where to start. Do you have anything unusual in your .bashrc or .bash_profile files? I'm thinking specifically of something that might cause an exit trap to fire? We use an exit trap to read the new directory after a command like cd, and if you have one already it might be causing some strange behavior. If it isn't that, anything else unusual in your dotfiles would be really helpful to see (if you don't mind sharing).

geoffroycochard commented 10 months ago

Hie,

I've the same behaviour. I've commented some line in my dotfiles (.bashrc, .bash_profile) and saved. After that i was able to work with cd ...

And after uncomment my lines and touch / reload waveterm it's working yet... hum...

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

Juste resaved this dotfiles has to be work again... 😄

Hamatti commented 10 months ago

Do you have anything unusual in your .bashrc or .bash_profile files?

I don't. I tried by removing both .bashrc and .zshrc files temporarily, restarted Waveterm, created a new tab and nothing changed. I assume this means it's not related but if there's some sort of cache I need to clear to make sure, let me know how to do that and I can double check.

It's really interesting because so far it's the only command that I've noticed that wouldn't work. Everything else has been spot on.

If it helps, I can share my .zshrc and .bashrc files but would prefer to do that privately.

geoffroycochard commented 10 months ago

Hie,

I've the same behaviour. I've commented some line in my dotfiles (.bashrc, .bash_profile) and saved. After that i was able to work with cd ...

And after uncomment my lines and touch / reload waveterm it's working yet... hum...

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

Juste resaved this dotfiles has to be work again... 😄

this worked temporarily on a single workspace

chrislatimer commented 10 months ago

Same issue here. I also tried removing my .bash_profile but still couldn't cd into another directory.

geoffroycochard commented 10 months ago

I've to comment this line in my ~/.bash_profile and force restart wave, and it seems working again...

image

Strange behavior...

amorando10 commented 9 months ago

I have just tried out Waveterm for the first time and I am also experiencing the same "cd" issue described above.

Waveterm seems to be really nice but the "cd" issue really is a showstopper.

I run Ubuntu 23.04.

Hamatti commented 9 months ago

With version 0.5.3, I now get an error when trying to cd:

bash: /Users/juhis/.mshell/rcfiles/bcce4410-8846-4b6e-b93d-d4e2465b446c: line 6843: syntax error: unexpected end of file

So something related has changed, maybe this gives you more help @sawka

sawka commented 9 months ago

Okay, I have a lead on this bug. I think it might be related to the EXIT trap running multiple times (possibly because of exiting subshells?). Haven't tested it with bash yet, but I ran into a similar issue while working on zsh support so it is possible it is related.

amorando10 commented 8 months ago

Any news on this bug?

I had not touched Waveterm since my last comment as this bug makes it unusable. I have just installed version 0.6.1 but sadly no change

blackisle51 commented 8 months ago

Had a similar issue with being unable to cd. I was in a directory, on a mounted external disk '/media//virtual machines/' and ejected the disk. I was then unable to cd out of the directory as the current working directory no longer existed. Expected behavior would be 'cd /' or 'cd ~' would take you to the new directory whether the current directory existed or not. Linux_x64 machine with Client Version v0.6.1 20240131-063952.

guardiande commented 6 months ago

I've had the same problem and as others already suggested commenting the RVM initialization fixed the problem

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
MrMarCode commented 6 months ago

I hope this extra information helps find the issue:

I'm having a similar problem, but I think mine might be related to #163. In my .bash-aliases I have an alias which runs cd /path/to/dir && nvm use. The command works fine, but does not update the state for the current directory in Wave. Note: I'm running on linux, Wave version 0.7.2.

sawka commented 5 months ago

I think this might be fixed as of v0.7.4. There was a similar issue where people's git branch was not updating in the prompt. It had to do with zsh's exittrap not firing for us as expected. I have a feeling the same thing was going on with respect to this "cd" problem as well (that last "nvm" call might have caused the exittrap to not work).

If anyone is still active on this issue, if you install v0.7.4, please let me know if this clears up the bug.

guardiande commented 5 months ago

Problem persists with 0.7.5.

Hamatti commented 5 months ago

If anyone is still active on this issue, if you install v0.7.4, please let me know if this clears up the bug.

I updated to Client Version 0.7.5 (20240502-224736) today and cd works for me now!

I'm excited to finally give Wave a proper go. Thank you for the work, hopefully the rest of the bugs around this also get discovered.

monnetchr commented 5 months ago

With 0.75 cd still does not work when defined as an alias image

tayloraleach commented 1 month ago

Just installed on Ubuntu 22 and I thought I was going crazy. cd does not change the directory.

I was questioning what this application is supposed to do...