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

Process suspended after shell command execution #3903

Open
abobov opened this issue Sep 10, 2024 · 6 comments
Open

Process suspended after shell command execution #3903

abobov opened this issue Sep 10, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@abobov
Copy link

abobov commented Sep 10, 2024

Describe the bug

When shell command executed with : hotkey lazygit process become suspended.

To Reproduce
Steps to reproduce the behavior:

  1. Open lazygit
  2. Type : to enter shell command menu
  3. Type any command, ex.: date
  4. Command output displayed and lazygit process suspended, your shell is open.

Expected behavior

Lazygit ask to press any key and after return to lazygit.

Screenshots

demo.webm

Version info:
Run lazygit --version and paste the result here

commit=2d0c7cb0fc85e3c262837eb9691813fa97e00e80, build date=2024-09-07T02:26:26Z, build source=binaryRelease, version=0.44.0, os=linux, arch=amd64, git version=2.39.2

Run git --version and paste the result here

git version 2.39.2

Additional context

Problem appears with version 0.44.0 and master.

@abobov abobov added the bug Something isn't working label Sep 10, 2024
@abobov
Copy link
Author

abobov commented Sep 10, 2024

Reverting #3793 on master fix my issue. Maybe it is expected behavior now?

@stefanhaller
Copy link
Collaborator

No, it's not the expected behavior, and it doesn't happen for me.

I can't explain why this happens to you, but I suspect it has something to do with what's in your .zshrc (or maybe .zprofile). Could you post those?

@abobov
Copy link
Author

abobov commented Sep 10, 2024

It is not related to my zsh config. I also tested it on debian:latest docker image with default bash:

docker run -it debian:latest

# In container shell
apt update && apt install -y git wget
wget https://github.com/jesseduffield/lazygit/releases/download/v0.44.0/lazygit_0.44.0_Linux_x86_64.tar.gz
tar xf lazygit_0.44.0_Linux_x86_64.tar.gz
git init
./lazygit

@stefanhaller
Copy link
Collaborator

Hm, ok. I can reproduce it on my Mac when doing SHELL=bash lazygit from my zsh prompt:

$ SHELL=bash lazygit

+ bash -i -c date

Di 10 Sep 2024 09:57:16 CEST
zsh: suspended (tty output)  SHELL=bash lazygit
$

Note that it is my zsh that suspends the lazygit process, not bash.

A bit of cursory googling finds this, which sounds related. I'm still not sure what to make of this, I'm hoping somebody with more knowledge about this can suggest a fix. I'd hate to have to revert #3793, it's a useful feature.

Another data point: executing :date </dev/null in lazygit seems to work without suspending. Not that I'm suggesting this as a workaround, but maybe it can help shed some light.

@huhu415
Copy link

huhu415 commented Sep 11, 2024

i have the same issue, i am so confuse that i search everywhere. oh..

@stkr
Copy link

stkr commented Oct 10, 2024

Just to add a bit more information, the behavior is reproducible also on WSL Ubuntu-24.04 with lazygit version 0.44.1_Linux_x86_64:

  • It happens using either bash or fish - so does not seem to be shell (zsh) specific (?)
  • It happens in windows conpty as well as alacritty as terminal emulator - so maybe not terminal specific either (?)
  • The workaround of adding "</dev/null" as described above works in all tested cases

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants