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

Getting error "no entry" when using cd in some directories. #101

Closed
conradludgate opened this issue Sep 21, 2019 · 29 comments
Closed

Getting error "no entry" when using cd in some directories. #101

conradludgate opened this issue Sep 21, 2019 · 29 comments
Labels
kind/bug A bug; unintended behavior

Comments

@conradludgate
Copy link

conradludgate commented Sep 21, 2019

What did you expect to happen?
enhancd to let me traverse all local directories

What actually happened?
In only a certain subset of directories, I get either the "no entry" response when I give no arguments, or if I provide .., it won't actually change to the directory I selected.

Output

no entry

Additional context
This only seems to happen in a directory named c++ (~/Projects/c++). Maybe it doesn't work with non alphanumerics.

@conradludgate
Copy link
Author

I moved the directory to be cpp instead and it works fine now

@babarot
Copy link
Owner

babarot commented Sep 24, 2019

Seems fixed. Please check it out with latest master.

@conradludgate
Copy link
Author

Seems to be, can't reproduce the issue

@babarot
Copy link
Owner

babarot commented Sep 24, 2019

Can I say done?

@a5ob7r
Copy link

a5ob7r commented Sep 25, 2019

Hello, @b4b4r07. I think this problem is rather happened by 0d39876. It is conflicting of grep matcher selection options(-E and -F).

https://github.com/b4b4r07/enhancd/blob/0d39876a09b210798c3bde2dd89271bf8dbde506/src/filter.sh#L98-L101

https://github.com/b4b4r07/enhancd/blob/100b809043a04010ae836f25e4bbab07089e41ab/src/command.sh#L1-L11

$ grep -E -F ~/.enhancd/enhancd.log
grep: conflicting matchers specified

@juliogc
Copy link

juliogc commented Sep 25, 2019

Same here to me! I'm using enhancd via zplug but I don't believe that's the problem.
The traditional navigation goes well. but every time I need the fuzzy search I get the no entry message.

Fuzzy search engine - fzy

➜ sudo apt list --installed | grep fzy   
fzy/disco,now 1.0-1 amd64 [installed]

➜ echo $ENHANCD_FILTER     
fzy:fzf-tmux:fzf:peco:percol:gof:pick:icepick:sentaku:selecta

Current enhancd version/revision

* 0d39876 - (HEAD -> master, origin/master, origin/HEAD) Take care about escape char (2 days ago) b4b4r07

Error sample
Try to navigate between root / to ~/Desktop via fuzzy search

18:20 in /
➜ cd Desktop
no entry

18:20 in /
➜ cd ~                             

18:20 in ~cd Desktop

18:20 in ~/Desktop
➜ echo $PWD           
/home/jcorradi/Desktop

As @a5ob7r mentioned, I already have noticed grep conflict matchers:

➜ grep -EF ~/.enhancd/enhancd.log
grep: conflicting matchers specified

I tried to remove ~/.enhancd/enhancd.log and even uninstall/reinstall it again, but still having this problem.

@LanikSJ
Copy link

LanikSJ commented Sep 25, 2019

I can confirm when I go back to 2ccdaca which doesn't have the above fix the issue @a5ob7r and @juliogc are seeing is no longer there. I imagine if I backed out the above commit only in my fork same would be true.

@juliogc
Copy link

juliogc commented Sep 25, 2019

More infos:

I returned the repository revision to 2ccdaca and the things worked again.

* 2ccdaca - Do not use ternary operator (8 weeks ago) b4b4r07

@juliogc
Copy link

juliogc commented Sep 25, 2019

I can confirm when I go back to 2ccdaca which doesn't have the above fix the issue @a5ob7r and @juliogc are seeing is no longer there. I imagine if I backed out the above commit only in my fork same would be true.

Wow! Same idea on same time! lol

I'll try others revisions to understand when the things goes wrong.

@juliogc
Copy link

juliogc commented Sep 25, 2019

It seens to be the latest 0d39876 commit that adds -F on __enhancd::filter::exclude(). Every thing before this works fine.

* 0d39876 - (HEAD -> master, origin/master, origin/HEAD) Take care about escape char (2 days ago) b4b4r07

@babarot
Copy link
Owner

babarot commented Sep 27, 2019

Oh, nice report. Thank you all. I couldn't get this behavior with my grep so couldn't find this problem.

Anyway I'll work on this problem.

kampka added a commit to kampka/dotfiles that referenced this issue Sep 28, 2019
enhancd introduces an issue with rev 0d39876 that prevents it from
working properly on some situations.
See babarot/enhancd#101 for details.
@babarot babarot reopened this Oct 2, 2019
@babarot babarot closed this as completed in ff6040a Oct 2, 2019
@babarot
Copy link
Owner

babarot commented Oct 2, 2019

Hi, all.

Sorry for inconvenience 😞 I managed to fix this reported behavior. All seemed to get back before. Please check it out. Thank you!

@babarot babarot added the kind/bug A bug; unintended behavior label Oct 2, 2019
kampka added a commit to kampka/dotfiles that referenced this issue Oct 2, 2019
@juliogc
Copy link

juliogc commented Oct 2, 2019

Hey, @b4b4r07
I saw your work but I'm sad to say that the problem persists in my environment 😢
I really can not understand why the the grep flags are causing this issue 😕 I'm trying to better understand the root cause to collaborate with some code.

Here the steps I take to update:

  1. Clean the old log
11:39 in ~/.enhancd
➜ mv ~/.enhancd/enhancd.log ~/.enhancd/enhancd.log.old

11:39 in ~/.enhancd
➜ touch ~/.enhancd/enhancd.log
  1. Back to latest revision in zplug, shell reload and zplug update

  2. Try some fzy cd

11:43 in ~/.enhancd
➜ cd Desktop 
__enhancd::cd::builtin:cd:5: no such file or directory: Desktop

11:43 in ~/.enhancd
➜ cd Desktop
no entry
  1. Check log file
11:43 in ~/.enhancd
➜ grep -EF ~/.enhancd/enhancd.log
grep: conflicting matchers specified

PS: Even with the old enhancd.log I get a no entry in my face 😂

@babarot babarot reopened this Oct 2, 2019
@kampka
Copy link

kampka commented Oct 2, 2019

Just FYI this is fixed for me as of the latest master.
@juliogc I had a quick look at your dotfiles and it seems like you are using a Mac. My guess is that MacOS ships a different grep than most linux do (GNU grep), likely some BSD version with different bugs as GNUs

@juliogc
Copy link

juliogc commented Oct 2, 2019

Just FYI this is fixed for me as of the latest master.
@juliogc I had a quick look at your dotfiles and it seems like you are using a Mac. My guess is that MacOS ships a different grep than most linux do (GNU grep), likely some BSD version with different bugs as GNUs

Thanks for your advice, @kampka, but you possible dived into old MacOS setup files that I keep in the repo for historical purposes, but I'm in Ubuntu 19.04 and the grep I use is the distro built in that I believe it's the GNU release.

➜ uname -a
Linux (hidden user/host names) 5.0.0-29-generic #31-Ubuntu SMP Thu Sep 12 13:05:32 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

@a5ob7r
Copy link

a5ob7r commented Oct 3, 2019

Hello, @juliogc. When it occured "no entry" using enhancd in your environment, does it have a destination directory path in your enhancd.log file?

# when
$ cd Desktop

no entry

# the entry in enhancd.log
$ grep Desktop ~/.enhancd/enhancd.log

/home/user/Desktop

@juliogc
Copy link

juliogc commented Oct 3, 2019

Hello, @juliogc. When it occured "no entry" using enhancd in your environment, does it have a destination directory path in your enhancd.log file?

# when
$ cd Desktop

no entry

# the entry in enhancd.log
$ grep Desktop ~/.enhancd/enhancd.log

/home/user/Desktop

Hi, @a5ob7r ! I checked out the log file with tail -f and it seems to do nothing when no entry appears. 😞

Peek 2019-10-03 14-41

@a5ob7r
Copy link

a5ob7r commented Oct 4, 2019

Hi, @juliogc. Thank you for your replay appnding gif! 👍

Did you use an AUTO_CD option of zsh to change directory? Maybe, implicit cd of AUTO_CD and explicit cd of enhancd (= __enhancd::cd) are not same. You need use explicit cd of enhancd to write a directory entory to enhancd.log. Please try using explicit cd of enhancd once.

Implicit cd

$ grep Desktop ~/.enhancd/enhancd.log

# None

# in zsh with AUTO_CD
$ ~/Desktop

$ grep Desktop ~/.enhancd/enhancd.log

# None

Explicit cd

$ grep Desktop ~/.enhancd/enhancd.log

# None

$ cd ~/Desktop

$ grep Desktop ~/.enhancd/enhancd.log

/home/user/Desktop

@juliogc
Copy link

juliogc commented Oct 4, 2019

@a5ob7r Usually I use to navigate via implicit cd, but I really doesn't know that it was a feature from zsh 😂 I thought it was related to enhancd.

Btw, here are another sample using explicit cd.

Peek 2019-10-04 16-09

@a5ob7r
Copy link

a5ob7r commented Oct 4, 2019

@juliogc I also had a similar experience, too. 😆

Did you solve your problem?

@juliogc
Copy link

juliogc commented Oct 7, 2019

@a5ob7r this weekend I spent more time making some tests but I don't found any final solution 😢 But there are two workarounds that you could try:

  1. If you made a backup from your ~/.enhancd/enhancd.log, you can make it active again and go to the latest revision 122a13b that it will back to work again.
  2. If you don't made any backup, just lock the plugin in the 718bd31 revision and it it will work fine too.
    zplug "b4b4r07/enhancd", from:github, at:718bd31, use:init.sh

The most worrying thing that I found in the whole process is that I tried to start a clean terminal setup with a fresh install from zsh, zplug and enhancd (without any ~/.enhancd/enhancd.log) and the plugin refuses to work with the same no entry error.

@babarot
Copy link
Owner

babarot commented Oct 8, 2019

Hey all, sorry for late response...!

Hmm, it's strange.. It didn't happen in my environment. Because I removed conflicting flags from grep command. Could you @juliogc tell me your grep command version? I wanna investigate why this happen in your env.

@juliogc
Copy link

juliogc commented Oct 8, 2019

Don't worry, @b4b4r07 !

Here some useful outputs:

➜ grep --version 
grep (GNU grep) 3.3
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others; see
<https://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.

➜ zsh --version
zsh 5.5.1 (x86_64-ubuntu-linux-gnu)

➜ zplug --version 
2.4.2

@stale
Copy link

stale bot commented Oct 22, 2019

This has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Oct 22, 2019
@juliogc
Copy link

juliogc commented Oct 23, 2019

Hello, guys, just a simple update: I'm using now the 9ac6887 revision and it backed to work properly.
My apologies to not inspect the full code to understand the reason, but my life backs to normal since that update.

Thank you everyone!!

@stale stale bot removed the stale label Oct 23, 2019
@stale
Copy link

stale bot commented Nov 6, 2019

This has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Nov 6, 2019
@stale stale bot removed the stale label Nov 13, 2019
@stale
Copy link

stale bot commented Nov 27, 2019

This has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Nov 27, 2019
@Paiusco
Copy link

Paiusco commented Jul 24, 2020

I think the issue I'm having here is the same.

fish, version 3.1.2
---
grep (GNU grep) 2.25
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
----
fzf --version
0.21.1 (334a4fa)

Consider the tree:

├── Backup-Trabalho
├── Desktop
├── Documents
├── Downloads
├── test-folder
        └── foo-bar
                └── foo-bar-example
└── WorkRelated
~
$ cd WorkRelated/

~/WorkRelated
$ cd download

~/Downloads
$ cd workrelated

~/WorkRelated
$ cd backup
no entry

~
$ 

--------

~
$ cd example (doesn't get me any way close to /test-folder/foo-bar/foo-bar-example/)
-------

~
$ cd bar
no entry

~
$ 

Also, anytime the no entry happens whenever dir I'm in, I'll be sent out back to ~/ for some reason. Should it be strictly necessary to write the complete full name [capital letters included] to expect it to work? (I'm just starting with the feature :) )

It looks like I'm having most of the problems with - on the dir names and capital letters too.

@babarot
Copy link
Owner

babarot commented Mar 31, 2023

It's maybe fixed now on latest master. Because I did some big changes. Close once but feel free to let me know if you have still some problems

@babarot babarot closed this as completed Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug; unintended behavior
Projects
None yet
Development

No branches or pull requests

7 participants