-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Cursor shape keep changing #12313
Comments
If you search through the script.log file for the letters It's not clear to me what the script.log file is capturing, though. If that's coming directly from tmux, then that would suggest this is a tmux or nvim issue. If it's just a capture of the debug tap then it could still be a conpty problem. |
I am aware that it changes the cursor style. However, in other terminals, this simply isn't displayed as the time between the 2 set cursor style is very short. In fact, the time should be short enough that it shouldn't be visible on the screen at all. Windows Terminal displayed the cursor style for too long before it changes to the correct style. |
This cursor style change is coming from tmux when drawing the status line at the bottom. However it didn't cause issue on other terminals. In fact, I think tmux emit the entire sequence at the same time and there shouldn't be any time interval where the cursor style should be a steady block style. The script.log is capturing the output of tmux |
Well most of the time on my system I don't see the cursor change. I suspect it might depend on the speed of the machine and the throughput of your connection when in a real session. Expecting the cursor not to visibly change after you're explicitly requested a cursor change seems like a very flaky design. Not my call to make, put personally I'd consider this a tmux or nvim problem. Funnily enough, we actually once got a bug report for the exact opposite scenario - a mode that was briefly changed produced no visible effect because there wasn't enough of a delay between turning it on and off again! |
One thing worth noting from the script.log - it looks like it's hiding the cursor before changing to the block style, which seems like it should prevent the block cursor being visible. Unfortunately it then sets the cursor to visible again before changing back to the bar cursor, so that doesn't really help. But this might work better if/when we get a conpty passthrough mode (#1173), since the current conpty architecture possibly does have an effect on the timing of these controls. |
@j4james I've done some investigation on the cursor visibility thing and even if I swapped the cursor visibility thing the issue is still present. with open("modified.log", "rb") as scriptFile, open("timing.log") as timeFile:
while scriptFile.read(1) != b'\n':
pass
while True:
ln = timeFile.readline().rstrip()
if ln == '':
break
numChars = int(ln.split(' ')[1])
print(scriptFile.read(numChars)) output for the
It's now On the other hand, the default terminal in windows you open by Here is the modified file: |
I'm testing it locally using |
Let's simplify the issue a bit. I've created a bash script that can reproduce the issue. #!/bin/bash
while true; do
# emit sequence when the cursor is hidden
echo -en "\e[?25l\e[2 q\e[6 q\e[?25h"
sleep 1
done I can see cursor style change with this script on my machine. But on #!/bin/bash
while true; do
# emit the sequence order in a way similar to tmux did.
# while tmux doesn't emit the sequence in a proper way, it still doesn't reproduce the issue on terminals other than windows terminal
echo -en "\e[?25l\e[2 q\e[?25h\e[6 q"
done Even with the tmux emitted sequence and without the sleep, I couldn't observe the issue at all. Note that |
Should I close this issue? I just built tmux from the current newest source and it don't emit |
Meh, leave it open. I can see the flickering with your bash script on my machine, even if it happens super rarely. Probably a timing issue, but meh, we could probably come up with a fix. |
Yeah there's definitely a bug evident from that bash script. If I watch the debug tap while that's running, none of the cursor show/hide sequences are getting through. I assume that's because they're being buffered, and the net result is a noop. This is similar to issue #8698 - sequences that get "passed through" (in this case the cursor style changes) can end up out of sync with sequences that are buffered (in this case the cursor visibility changes). At least I think that's what is happening here. This would hopefully be solved by #1173. |
Just bumping this and confirming that this is still definitely an issue, and not limited to wsl/tmux/bash. Even on the windows builds of neovim the cursor stays as a block even after exiting neovim. |
hello, just a bump, are there any planned updates on this? |
Windows Terminal version
1.11.3741.0
Windows build number
10.0.19042.1466
Other Software
tmux 3.0a (inside WSL)
NVIM v0.7.0-dev
Steps to reproduce
~/.tmux.conf
:tmux
nvim
i
Expected Behavior
The cursor should not be changing. I've tested it on other terminals and it behaves correctly. Here is the recording of the terminal output and I've tested this on other terminal and didn't experience any cursor issue with it. However, it causes cursor issue on Windows Terminal.
script.log
timing.log
Actual Behavior
The cursor will keep changing randomly when the status line redraws. This does not happen on every frame but about half of the time.
CursorIssue.mp4
The following is what gets repeatedly emitted to the console after following https://github.com/microsoft/terminal/wiki/Enabling-the-debug-tap
The text was updated successfully, but these errors were encountered: