lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

`Enter` doesn't work when `Press enter to return to lazygit`

Open c02y opened this issue 4 years ago • 5 comments

Describe the bug A clear and concise description of what the bug is.

When lazygit prompts Press enter to return to lazygit, but Enter key is not working, I have to hit Esc to return to lazygit.

To Reproduce Steps to reproduce the behavior:

  1. in lazygit, use e to modify a unstaged file using your editor
  2. exit the editor
  3. lazygit prompts Press enter to return to lazygit, but Enter is not working, I have to hit Esc

There are other scenarios that lazygit Press enter to return to lazygit, and it seems Enter is never working.

Expected behavior A clear and concise description of what you expected to happen.

When lazygit prpmpts Press enter to return to lazygit, Enter should work as expected.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. Windows] Manjaro-Linux
  • Lazygit Version [e.g. v0.1.45] 0.25.1 install from go get
  • The last commit id if you built project from sources (run : git-rev parse HEAD)

Additional context Add any other context about the problem here.

c02y avatar Mar 03 '21 14:03 c02y

I believe this is caused by a lazygit panic occurring earlier in your terminal session. When this happens, certain codes aren't sent to the terminal on exit which causes problems the next time you run lazygit. I haven't really found a good solution to this other than wrapping all goroutines in a panic handler that manually sends those codes, but it's not a full solution

jesseduffield avatar Apr 02 '21 11:04 jesseduffield

I can confirm when I bind lazygit in fish or bash to a key, and start lazygit using the binding, the problem occurs, but when I start lazygit normally by typing the command in shell prompt, Enter works without problem.

I mentioned the fish/bash binding problem when I'm using ranger too.https://github.com/ranger/ranger/issues/2287

I don't know what is the root cause since

  1. Since the problem happens for binding in both bash and fish
  2. ranger is written in Python, lazygit is written Go, they both have this problem.

c02y avatar Apr 02 '21 20:04 c02y

it seem fish don't know the key binding run a long fg program in my fish key binding
bind \cg 'commandline -r lazygit; commandline -f execute' it works well

zeekrs avatar Jan 06 '24 17:01 zeekrs

In my case, launching lazygit from nvim, I often do :q to exit by mistake and I get stuck there. Esc won't work either.

~~I tried to pass config to disable execute shell binding but whatever I do, it won't work either (likely a problem with lazygit-nvim plugin).~~

Edit: Nevermind, it was my nvim lazy git config that was wrong. Keybinding works properly.

DeepReef11 avatar Sep 29 '24 15:09 DeepReef11

working normally on v0.50.0

simonpham avatar May 13 '25 08:05 simonpham