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

Strange output "No such file or directory" #209

Open
daryapotanina opened this issue Apr 22, 2023 · 6 comments
Open

Strange output "No such file or directory" #209

daryapotanina opened this issue Apr 22, 2023 · 6 comments
Labels
area/bash Catch all for changes in bash files area/zsh Catch all for changes in zsh files kind/bug A bug; unintended behavior

Comments

@daryapotanina
Copy link

What did you expect to happen?
Just cd

What actually happened?
cd with strange output

Output

base ❯ cd src
find: /Users/admin/my_znap_path/enhancd
/Users/admin/my_znap_path
/Users/admin
/Users
/: No such file or directory

Additional context

Mac OS 13.1 (22C65) (Macbook air Apple M2)

base ❯ zsh --version
zsh 5.8.1 (x86_64-apple-darwin22.0)

/Users/admin/.zshrc

source ~/my_znap_path/zsh-snap/znap.zsh
znap prompt sindresorhus/pure
znap source b4b4r07/enhancd

video

Kapture.2023-04-22.at.18.04.13.mp4
@renantmagalhaes
Copy link

renantmagalhaes commented Apr 23, 2023

I'm facing the same issue on OpenSuse Tumbleweed (and Leap on WSL2).

My fix, for now, is to revert to tag v2.5.0

cd ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/enhancd/
git checkout tags/v2.5.0

Seems like the program is adding a \n on all folders (but that only happens in some cases, just like you showed in the video,

or is trying to concatenate the previous folder, with the new one and add those \n in the middle, just a guess based on the behavior though :D

My ZSH config: https://github.com/renantmagalhaes/workstation/blob/master/zsh/zshrc#L370

Taking a deeper look seems to be related with this file: https://github.com/b4b4r07/enhancd/blob/9a54fc3c6312eeaa7016f1744dd964524e686d61/functions/enhancd/lib/help.awk changed by @b4b4r07.

I will see if I can fix that for my use case, and let you know

@vlaw
Copy link

vlaw commented Apr 28, 2023

I'm facing the issue too.

OS: macOS 13.3.1 22E261 x86_64
Shell: zsh 5.9

Looks like d56316d#diff-f4b9a07e00178cdb558a83c33afbf12a26940082674585f16ef62ea0fa7c896b cause this issue.

-  dirs=( "${PWD}" $(__enhancd::filepath::get_parent_dirs "${1:-${PWD}}") )
+  dirs=( "${PWD}" "$(__enhancd::filepath::get_parent_dirs "${1:-${PWD}}")" )
+__enhancd::filepath::walk:6> dirs=+__enhancd::filepath::walk:6> __enhancd::filepath::get_parent_dirs /etc/apache2
+__enhancd::filepath::get_parent_dirs:1> __enhancd::command::awk -f /Users/******/.zim/modules/enhancd/functions/enhancd/lib/step_by_step.awk -v 'dir=/etc/apache2'
+__enhancd::command::awk:2> type gawk
+__enhancd::command::awk:3> gawk -f /Users/*******/.zim/modules/enhancd/functions/enhancd/lib/step_by_step.awk -v 'dir=/etc/apache2'
+__enhancd::filepath::walk:6> dirs=( /etc/apache2 $'/etc\n/' ) # <-- HERE!!!
+__enhancd::filepath::walk:7> set +x
find: /etc
/: No such file or directory

revert 83fca51 should work for bash and zsh users.

Obviously, this will re-cause the fish shell issue that #204 tries to fix.
And the problem seems to be related to 'capturing output of awk into array'

I'm not familiar with fish, can't go further.

@gatspy
Copy link

gatspy commented May 13, 2023

save issue on macOS 12.6, zsh 5.9 (x86_64-apple-darwin21.3.0)

@grozmus
Copy link

grozmus commented May 16, 2023

It happens to me too. Can't say when exactly but I see it quite often.

home\n/’: No such file or directory

OS: Linux Mint 21.1 x86_64
Shell: zsh 5.8.1 

Hzbeta added a commit to Hzbeta/dotfiles that referenced this issue May 20, 2023
pin enhancd to tags/v2.5.0 temporarily in order to fix babarot/enhancd#209
@babarot babarot mentioned this issue May 30, 2023
@babarot babarot added kind/bug A bug; unintended behavior area/bash Catch all for changes in bash files area/zsh Catch all for changes in zsh files labels May 30, 2023
@andreicozma1
Copy link

Can confirm I am experiencing the same issue on zsh 5.8.1 (x86_64-apple-darwin22.0)

@babarot
Copy link
Owner

babarot commented Jun 16, 2023

Sorry for inconvenience. I reverted the cause part. Please check it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/bash Catch all for changes in bash files area/zsh Catch all for changes in zsh files kind/bug A bug; unintended behavior
Projects
None yet
Development

No branches or pull requests

7 participants