-
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
Multiple tmux clients causes buggy inputs #2050
Comments
I can reproduce it, but I'm not sure how to fix it, or what Yazi can do, because it looks like an issue with Specifically, Yazi needs to detect the terminal's image support when it starts up, so it sends a Kitty graphics protocol probe sequence to the actual user terminal (like kitty, not yazi/yazi-adapter/src/emulator.rs Lines 38 to 47 in c1048de
So, it needs to have Somehow, The only related issue I found is tmux/tmux#3489, but it looks like it has already been fixed. I tried changing the value of
I'm not familiar with Note that in your case, Yazi sends Line 32 in c1048de
But the issue is the same — somehow You can test it with |
After further testing, I found that moving execute!(
BufWriter::new(stderr()),
- EnterAlternateScreen,
Print(Mux::csi("\x1bP$q q\x1b\\")), // Request cursor shape (DECRQM)
Print(Mux::csi("\x1b[?12$p")), // Request cursor blink status (DECSET)
Print("\x1b[?u"), // Request keyboard enhancement flags (CSI u)
Print(Mux::csi("\x1b[0c")), // Request device attributes
+ EnterAlternateScreen,
EnableBracketedPaste,
mouse::SetMouse(true),
)?; I'll create a PR to fix it shortly. |
Please try #2052 |
Thank you for the quick response! It works! 🎉 |
Actually, there's one more bug related to this. The reproduction method is the same, except that in |
Can you record a video to show me your steps? I'm a bit confused about the concepts of session, window, and pane in |
I meant viewing the same tmux window from two different sessions. Here's a video: Screencast.From.2024-12-16.18-01-54.webmThe reproduction steps is exactly the same as above, but you skip this particular step:
|
This is how tmux set -p allow-passthrough on
echo -e -n "\x1bPtmux;\x1b\x1b[0c\x1b\\" you'll get the same result. In other words, unless
In your case, even though you're in different sessions, they are still both visible panes. |
I see, but what I'm confused about is why is it preventing |
Because Tmux forwards the terminal's response to Yazi twice (once for each "visible pane"), but Yazi assumes and only needs the first one. So, it stops reading when it reaches the end of the first response, and the second one is treated as a keypress event, which might include the I don't think there's a solution for this right now. It could only be fixed if |
I created a new PR #2058, where I replaced Note that this is just a workaround - |
Thank you for the PR! I think it now works some of the time. But it still fails occasionally, with the following printed to shell: 12;2$y62;4;9;22cnq Not sure why. |
This might be caused by Specifically, Yazi now sends However, since Yazi reads and processes the terminal responses very quickly, it moves on to request As far as I know, WezTerm solved this by introducing a delay to give if is_tmux || cfg!(windows) {
self.write.flush()?;
// I really wanted to avoid a delay here, but tmux and conpty will
// both re-order the response to dev_attributes before sending the
// response for the passthru of query_pixels if we don't delay.
// The delay is potentially imperfect for things like a laggy ssh
// connection. The consequence of the timing being wrong is that
// we won't be able to reason about the pixel dimensions, which is
// "OK", but that was kinda the whole point of probing this way
// vs. termios.
std::thread::sleep(std::time::Duration::from_millis(100));
} However, this is still quite a hacky solution because it's time-based and slows down the startup for every As I mentioned earlier, to fully solve this, it would require |
I'm going to lock this issue because it has been closed for 30 days. ⏳ |
What system are you running Yazi on?
Linux Wayland
What terminal are you running Yazi in?
kitty 0.37.0
yazi --debug
outputDescribe the bug
When you have multiple active tmux clients sharing the same group, opening
yazi
in one of them causes other windows in other clients to receive weird key inputs.Minimal reproducer
Finally, we open
yazi
in this window.You should now see strange characters getting inputted to the first terminal window (
child_1
). I think this varies depending on certain factors, but in my case I'm seeing::1$r1 q^[\^[[?12;0$y^[[?62;c
.Anything else?
My tmux version:
$ tmux display-message -p "#{version}" 3.5a
I've also made sure that there's no side-effects from custom config:
Checklist
yazi --debug
) input box to the nightly that I triedmv ~/.config/yazi ~/.config/yazi-backup
)The text was updated successfully, but these errors were encountered: