-
Notifications
You must be signed in to change notification settings - Fork 469
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
strange terminal output in wsl on wezterm with tmux #1557
Comments
Please comment out these 3 lines one by one and all together to see what happens: Lines 31 to 33 in cd7209c
|
commenting line 33 fixes fzf from starting and the the filter dialog from opening. although after starting, the screen blanks, and it takes about 10 seconds for the initial screen to load. Also immediately after execution the window looses mouse focus. so once the screen paints I have to press a key to regain focus then yazi accepts input. seems CSI u is not supported in tmux quite yet: tmux/tmux#4072 (comment) |
Please try #1564 |
behaviour is same as the original. i am patching against 0.3.1 if that's ok yazi = pkgs.yazi-unwrapped.overrideAttrs (
_: super: {
pname = super.pname + "-patched";
patches = super.patches or [ ] ++ [
(pkgs.fetchpatch {
url = "https://github.com/sxyazi/yazi/pull/1564.patch";
hash = "sha256-bzX4ImTyiqZ0PRXlqycWMb/RBMIm7+58Vh8OAeKg6i8=";
})
];
}
); |
Well, if this doesn't work, then I really don't know what else to do. My best guess is that it could be either I'll merge that PR first, as in my testing it does have some effect. Then I'll keep this issue open for a while to see if anyone else encounters it and can help debug it at the code level. |
i am using this and its working for me diff --git a/yazi-adapter/src/emulator.rs b/yazi-adapter/src/emulator.rs
index 1d6cf10..7e6d7ab 100644
--- a/yazi-adapter/src/emulator.rs
+++ b/yazi-adapter/src/emulator.rs
@@ -209,7 +209,7 @@ impl Emulator {
Ok(())
};
- match timeout(Duration::from_secs(10), read).await {
+ match timeout(Duration::from_secs(1), read).await {
Err(e) => error!("read_until_da1 timed out: {buf:?}, error: {e:?}"),
Ok(Err(e)) => error!("read_until_da1 failed: {buf:?}, error: {e:?}"),
Ok(Ok(())) => {}
diff --git a/yazi-fm/src/term.rs b/yazi-fm/src/term.rs
index f68cd61..37a4ecd 100644
--- a/yazi-fm/src/term.rs
+++ b/yazi-fm/src/term.rs
@@ -30,7 +30,7 @@ impl Term {
BufWriter::new(stderr()),
Print("\x1b[?12$p"), // Request cursor blink status (DECSET)
Print("\x1bP$q q\x1b\\"), // Request cursor shape (DECRQM)
- Print("\x1b[?u\x1b[c"), // Request keyboard enhancement flags (CSI u)
+ // Print("\x1b[?u\x1b[c"), // Request keyboard enhancement flags (CSI u)
EnterAlternateScreen,
EnableBracketedPaste,
mouse::SetMouse(true), |
What happens when you run each of these 3 lines separately? echo -e '\x1b[?u\x1b[c'; cat
echo -e '\x1b[?u'; cat
echo -e '\x1b[c'; cat |
Is it inside |
The one above is from the same WSL (NixOS) / WezTerm / Tmux. I am not using default configs, but i can't think of anything in it that would change that behaviour. In a separate WSL with Ubuntu-22.04, tmux 3.2a, yazi 0.3.1 -- everything default:
and after starting yazi it will open the filter dialog Same Ubuntu all defaults: I tried connecting through WezTerm SSHMUX and everything there is fine with stock 0.3.1 |
If SSH is working fine, then it's very likely that the issue is caused by ConPTY, in this case, there's not much that Yazi can do. Keep in mind that it's still possible that the combination of tmux and ConPTY is causing the problem as they tend to reorder CSI sequences and interfere with the communication between Yazi and the terminal in various ways. However, in this case, using SSH to bypass ConPTY seems to make tmux function normally. I'll keep this issue open for a while to see if anyone familiar with Windows can help debug and find a workaround. Although in the end, it might not be solvable because it's beyond Yazi's scope. |
Thanks for the info! If this issue only happens in WezTerm and not in Windows Terminal or Alacritty, then I think it's very likely related to WezTerm, but it could still be ConPTY or tmux interfering in some way with the communication between Yazi and the terminal. Maybe filing an issue with WezTerm would help, since it seems like the issue is only showing up there. I'm going to close this issue now, as it’s really a bit outside the scope of Yazi. Yazi just receives key events from the terminal and executes them as is. In this case, WezTerm sent the key event to open the search box, so some debugging might be needed at the terminal level. |
Oh just a quick check - @mau-mauricelim I noticed that your Yazi version is 0.3.0, but the PR (#1564) that tried to fix this issue was only included in version 0.3.2. Have you tried the latest version of Yazi to see if the issue still? |
@sxyazi thanks for the update! I went and tested |
@sxyazi I can't comment on the tmux side of things, but one of places where ConPTY is likely to cause problems is with your yazi/yazi-adapter/src/emulator.rs Line 129 in 61c0db8
This is because ConPTY handles most of the VT sequences itself, but when it encounters something it doesn't recognise (like So in the code above, the And since you're blocking on the The good news is that this should be fixed by the new ConPTY implementation that Windows Terminal is currently previewing. With the new implementation, essentially all VT sequences are passed through to the client terminal, so all the responses should come back in the right order. That new version of ConPTY is still being tested, and there are a few issues that still need to be resolved, but once it's stable I suspect WezTerm will be keen to start using it, and then problems like this should be a thing of the past. |
Oh my lord, you saved my day! Thank you for the detailed explanation, everything makes sense now! As a TUI tool developer, I'm really excited to hear this amazing news, this means I won't have to deal with all the quirks of ConPTY anymore. I really hope it stabilizes soon, and I'm also super grateful for all the work you've done on Windows Terminal. Much respect! |
I'm going to lock this issue because it has been closed for 30 days. ⏳ |
What system are you running Yazi on?
Windows WSL
What terminal are you running Yazi in?
wezterm 20240203-110809-5046fc22
yazi --debug
outputDid 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 triedDescribe the bug
Under WSL (NixOS) with WezTerm and Tmux i am getting strange output from yazi when running
--version
--help
--debug
. When starting yazi directly it opens FZF before starting yazi, then after I cancel FZF, yazi opens then asks me to enter a filter.Here is asciicinema:
The above configuration that is broken is:
WSL (NixOS unstable), connected with WezTerm, executing under Tmux
These configurations of the same machine work fine:
Here is WSL Ubuntu, Wezterm, Tmux and Yazi 0.3.1:
It opens the rename dialog upon open:
Minimal reproducer
WSL Wezterm and Tmux
Anything else?
No response
The text was updated successfully, but these errors were encountered: