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

lf hangs forever with fzf #501

Closed
noib3 opened this issue Nov 5, 2020 · 5 comments
Closed

lf hangs forever with fzf #501

noib3 opened this issue Nov 5, 2020 · 5 comments
Labels

Comments

@noib3
Copy link

noib3 commented Nov 5, 2020

After lf switched to tcell, the following function stopped working properly

cmd fuzzy_edit ${{
  clear
  filename="$(fzf --height=80%)" \
  && $EDITOR ~/"$filename" || true
}}

If I just call it hangs forever without printing any output from fzf. However if I press any key after calling it, fzf shows up after a few seconds.

@gokcehan
Copy link
Owner

gokcehan commented Nov 6, 2020

@noib3 I can't reproduce this on my machine. Are you on Mac by any chance? Do you think this is #480 ?

@noib3
Copy link
Author

noib3 commented Nov 6, 2020

@gokcehan Yes, I'm on macOS. I'm also experiencing #480, but I don't know if this is related to it. I think #480 is more shell-dependent. This should be more shell-agnostic as everything happens within lf.

Indeed, the issue remains if I call lf from sh, bash, zsh or fish and if I set shell to sh, bash, zsh or fish in my lfrc.

@gokcehan
Copy link
Owner

gokcehan commented Nov 6, 2020

@noib3 That issue is reported to happen on both bash and zsh so I don't think it is shell-dependent. The issue is that stdin is closed on Mac when ui is paused so any spawned command can't reliably use stdin, whether it is simply a shell like bash or a command like fzf.

@noib3
Copy link
Author

noib3 commented Nov 6, 2020

That issue is reported to happen on both bash and zsh so I don't think it is shell-dependent.

I get a different behaviour with the fish shell: lf correctly sets the shell's cwd, however the first character the user inputs after pressing w is consumed, idk by what.

So for example, if I launch lf from ~, go to ~/Documents and press w, the shell's cwd will be ~/Documents. However if I now type abc, only bc will be in fish's cli buffer.

This is different from sh, bash or zsh where, at least on my machine, w causes the underlying shell to exit.

P.S. should this be posted in #480?

@gokcehan
Copy link
Owner

gokcehan commented Nov 7, 2020

@noib3 You may post it to #480 if you like, but note that I'm not able to work on that issue myself and I doubt anyone else is actively working on it either. We need a Mac developer to fix it in tcell as detailed in gdamore/tcell#394. But it seems like a long standing issue/design so it may not be worked out anytime soon. At this point, I'm half regretful that we switched from termbox to tcell because it makes many commands unusable on Mac. On the other hand, termbox had its own set of bugs so this may be the lesser evil approach.

The way you described the situtation in fish sounds to me like gdamore/tcell#194. As far as I understand, this might be more or less the same issue as gdamore/tcell#394. I can't really tell much without being able to try it myself.

Regarding this issue, as I said I'm not able to reproduce it on my machine. If it's Mac only, then it is likely the same issue, but if you think this is a different issue then I can label it as a bug and keep it open.

@noib3 noib3 closed this as completed Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants