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

Ctrl-z sometimes break yazi #1309

Closed
ricardoseriani opened this issue Jul 18, 2024 · 13 comments · Fixed by #1310
Closed

Ctrl-z sometimes break yazi #1309

ricardoseriani opened this issue Jul 18, 2024 · 13 comments · Fixed by #1310
Labels
bug Something isn't working cant reproduce The issue cannot be reproduced as described help wanted Extra attention is needed

Comments

@ricardoseriani
Copy link

What system are you running Yazi on?

Linux X11

What terminal are you running Yazi in?

wezterm 20240203-110809-5046fc22

yazi --debug output

Yazi
    Version: 0.2.5 (VERGEN_IDEMPOTENT_OUTPUT 2024-04-23)
    OS: linux-x86_64 (unix)
    Debug: false

Emulator
    Emulator.via_env: ("xterm-256color", "WezTerm")
    Emulator.via_csi: Ok(WezTerm)
    Emulator.detect: WezTerm

Adaptor
    Adaptor.matches: Iterm2

Desktop
    XDG_SESSION_TYPE: Some("tty")
    WAYLAND_DISPLAY: None
    DISPLAY: Some(":0")

SSH
    shared.in_ssh_connection: false

WSL
    /proc/sys/fs/binfmt_misc/WSLInterop: false

Variables
    SHELL: Some("/usr/bin/zsh")
    EDITOR: Some("vim")
    ZELLIJ_SESSION_NAME: None
    YAZI_FILE_ONE: None
    YAZI_CONFIG_HOME: None

file(1)
    Version: Ok(Output { status: ExitStatus(unix_wait_status(0)), stdout: "file-5.41\nmagic file from /etc/magic:/usr/share/misc/magic\n", stderr: "" })

Text Opener
    default: Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block: Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

tmux
    TMUX: false

Ueberzug++
    Version: Err(Os { code: 2, kind: NotFound, message: "No such file or directory" })


--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "/home/rseriani/.local/state/yazi" directory.

Did you try the latest nightly build to see if the problem got fixed?

Yes, and I updated the debug information above (yazi --debug) to the nightly that I tried

Describe the bug

When I press ctrl-z to suspend yazi and then run fg to bring it back to foreground, the window is "freeze/broken".
This sometimes occurs, but not always, so you may need a few tries to reproduce.

Expected Behavior

Yazi should be working when it's back to foreground.

To Reproduce

run yazi
press ctrl-z
run fg to bring it back to foreground
try using yazi normally

Configuration

no config

Anything else?

2024-07-18_10-13

@ricardoseriani ricardoseriani added the bug Something isn't working label Jul 18, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 18, 2024

I made some fixes to the behavior of Ctrl-Z earlier in #1307, please give it a try

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Jul 18, 2024
@ricardoseriani
Copy link
Author

I tried applying the PR locally, but I'm not really sure if this is the correct way:

  • git pull origin pull/1307/head:ctrl-z
  • git switch ctrl-z
  • cargo build --release --target=x86_64-unknown-linux-musl
  • ./target/x86_64-unknown-linux-musl/release/yazi

Apparently, the PR was applied.

If what I was made is correct, unfortunately, the problem still persists.

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Jul 18, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 18, 2024

What does the yazi --debug output look like? Does it include the hash of that commit? Can you record a gif so I can see your steps and what happens?

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Jul 18, 2024
@ricardoseriani
Copy link
Author

yazi --debug output

Yazi
    Version: 0.2.5 (d88211c 2024-07-18)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.2.5

Emulator
    Emulator.via_env: ("xterm-256color", "WezTerm")
    Emulator.via_csi: Ok(WezTerm)
    Emulator.detect : WezTerm

Adapter
    Adapter.matches: Iterm2

Desktop
    XDG_SESSION_TYPE: Some("tty")
    WAYLAND_DISPLAY : None
    DISPLAY         : Some(":0")

SSH
    shared.in_ssh_connection: false

WSL
    /proc/sys/fs/binfmt_misc/WSLInterop: false

Variables
    SHELL              : Some("/usr/bin/zsh")
    EDITOR             : Some("vim")
    ZELLIJ_SESSION_NAME: None
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

Text Opener
    default: Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "${EDITOR:=vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

tmux
    TMUX   : false
    Version: tmux 3.2a

Dependencies
    file             : 5.41
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: No such file or directory (os error 2)
    magick           : No such file or directory (os error 2)
    fzf              : 0.54.0
    fd               : 10.1.0
    rg               : 14.1.0
    chafa            : 
    zoxide           : No such file or directory (os error 2)
    unar             : 1.10.1
    jq               : 1.7.1


--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "/home/rseriani/.local/state/yazi" directory.

Video record of the problem

yazi-ctrlz-bug.mp4

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Jul 18, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 18, 2024

Hi, I made a new PR, please try #1310

@sxyazi sxyazi added the waiting on op Waiting for more information from the original poster label Jul 18, 2024
@ricardoseriani
Copy link
Author

I tried it, and the problem still persists.
But now, when this occurs, I can press ctrl-z to stop yazi and then send it back to foreground with fg and it's back working again.

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Jul 18, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 19, 2024

That's so weird, with fa297b3, I can't reproduce it on my Linux VM anymore, no matter how many times I try, it works fine for me.

screenshot-001857.mp4

Are you sure you're using that commit right? Did I miss any details to reproduce it?

@sxyazi sxyazi added cant reproduce The issue cannot be reproduced as described waiting on op Waiting for more information from the original poster labels Jul 19, 2024
@ricardoseriani
Copy link
Author

I tried again and recorded this time.

yazi-pr-1310.mp4

I tried with xfce4-terminal (xfce4-terminal 0.8.10 (Xfce 4.16)) and the problem occurs in it too.

I known it's hard to make sure that it's fixed, because it's not always reproducible.

@github-actions github-actions bot removed the waiting on op Waiting for more information from the original poster label Jul 19, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 19, 2024

Please apply these two patches separately on top of that PR and see what happens:

--- yazi/yazi-fm/src/app/commands/resume.rs
+++ yazi/yazi-fm/src/app/commands/resume_new.rs
@@ -4,7 +4,6 @@
 
 impl App {
 	pub(crate) fn resume(&mut self, _: Cmd) {
-		self.cx.manager.active_mut().preview.reset_image();
 		self.term = Some(Term::start().unwrap());
 
 		// While the app resumes, it's possible that the terminal size has changed.
--- yazi/yazi-fm/src/app/commands/resume.rs
+++ yazi/yazi-fm/src/app/commands/resume_new.rs
@@ -4,13 +4,12 @@
 
 impl App {
 	pub(crate) fn resume(&mut self, _: Cmd) {
-		self.cx.manager.active_mut().preview.reset_image();
+		self.signals.resume(None);
+
 		self.term = Some(Term::start().unwrap());
 
 		// While the app resumes, it's possible that the terminal size has changed.
 		// We need to trigger a resize, and render the UI based on the resized area.
 		self.resize(());
-
-		self.signals.resume(None);
 	}
 }

@ricardoseriani
Copy link
Author

I tried both separately, but it still doesn't work.

@sxyazi sxyazi reopened this Jul 19, 2024
@sxyazi
Copy link
Owner

sxyazi commented Jul 19, 2024

I have no idea then. After applying that PR, the issue completely disappeared for me, and before applying that PR, I could reproduce it with the Linux + WezTerm combo (it couldn't be reproduced on non-Linux systems or without WezTerm).

I'll keep it open for a while to see if anyone else encounters it and can provide more clues and help debug it.

@sxyazi sxyazi added the help wanted Extra attention is needed label Jul 19, 2024
@sxyazi
Copy link
Owner

sxyazi commented Sep 17, 2024

This issue has been open for 2 months, no other users have reported encountering it, I can't reproduce it either, so I'm going to close it since it's not doable for me and no one can help :(

My best guess is that this is related to your environment, or it's already been fixed in recent versions.

@sxyazi sxyazi closed this as not planned Won't fix, can't repro, duplicate, stale Sep 17, 2024
Copy link

I'm going to lock this issue because it has been closed for 30 days. ⏳
This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working cant reproduce The issue cannot be reproduced as described help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants