Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upGarbage typed when starting Neovim in Alacritty #10131
Comments
This comment has been minimized.
This comment has been minimized.
|
I've figured out that on some startups this if statement https://github.com/neovim/neovim/blob/master/src/nvim/tui/input.c#L406 is entered and sometimes it isn't. |
This comment has been minimized.
This comment has been minimized.
alacritty decided to do it a different way. Vim patches: Patch welcome. |
justinmk
added this to the todo milestone
Jun 6, 2019
justinmk
added
+plan
good first issue
tui
labels
Jun 6, 2019
This comment has been minimized.
This comment has been minimized.
|
That still doesn't explain why https://github.com/neovim/neovim/blob/master/src/nvim/tui/input.c#L406 is sometimes entered and sometimes it isn't. I've wrote a small C program that checked how many characters were Where termite (libvte) always returned 24 characters ( Alacritty returned different results. Sometimes 18 chars ( |
This comment has been minimized.
This comment has been minimized.
This comment https://github.com/neovim/neovim/blob/master/src/nvim/tui/input.c#L387 and if I'm reading the code correct suggests different lengths of RGB are parsed correctly. I think #10131 (comment) is the real issue here. I haven't dug into the Vim source code, but I assume it will just sit and wait for a complete response to |
This comment has been minimized.
This comment has been minimized.
|
#10195 mentions this might crash even. |
This comment has been minimized.
This comment has been minimized.
sanga
commented
Jun 13, 2019
|
Master (v0.4.0-1016-g6f27f5ef9) doesn't seem to crash anymore for me, btw (or it hasn't crashed so far in 5mins of trying to crash it). Anecdotally, it seems like master is a lot less likely to get garbage chars at startup also |
This comment has been minimized.
This comment has been minimized.
sanga
commented
Jun 13, 2019
|
I stand corrected. It also crashes on v0.4.0-1016-g6f27f5ef9 but it seems a lot less frequent. Same error as I mentioned in #10195 and I don't have symbols in this build so that stack is basically useless (sorry). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
No, different problems unfortunately. The issue here is that, unlike other terminals, Alacritty's response is not always contained in one Neovim will crash when only |
This comment has been minimized.
This comment has been minimized.
|
So fixing the crash is as easy as wrapping https://github.com/neovim/neovim/blob/master/src/nvim/tui/input.c#L445 in an Fixing the garbage typing will be a bit more difficult. |
This comment has been minimized.
This comment has been minimized.
|
From a quick look it seems like |
This comment has been minimized.
This comment has been minimized.
It seems to me that it cuts the input stream so the escape character doesn't appear in the middle, but always at the start. But it doesn't seem that it will wait for a complete sequence when it's already at the start?
That sounds like an idea, but therefore |
This comment has been minimized.
This comment has been minimized.
|
This has just been reported to me in jwilm/alacritty#2543. While looking into it, I came to the same conclusion that this must be because the output is not written in a single go and I'll see if I can patch this in Alacritty. Regarding the format, this is planned to change to the more common rgb:ffff/0000/ffff format, however it should probably be noted that even #fff000fff is a valid format. Full info about allowed color formats can be found in |
justinmk
added
the
bug
label
Jun 25, 2019
This comment has been minimized.
This comment has been minimized.
craigbarnes
commented
Jul 14, 2019
•
|
Split reads/writes are not a bug, but an explicit result of the termios settings used by neovim. As noted in the
Applications shouldn't be relying on the terminal to never split escape sequences across multiple writes -- they should either be waiting for the sequence terminator or detecting truncation then re-reading and re-parsing. Most apps that handle it at all do the latter. |
HarmtH commentedJun 6, 2019
nvim --version: master, 8e8c7d7$TERM: alacrittySteps to reproduce using
nvim -u NORCActual behaviour
Garbage typed after start
Expected behaviour
No garbage typed after start
Explanation
I've bisected first wrong commit to 298608f (background detection)
Termite's response to
\x1b]11;?\x07(WORKS):Alacritty's response to
\x1b]11;?\x07(BROKEN):Both are correct responses afaik.
Vim also has an implementation of background detection, which seems to work fine.