-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Open
Labels
Description
Steps to reproduce
-
Compile the following C program:
#include <stdio.h> #include <unistd.h> int main() { setbuf(stdout, NULL); printf("abc%c%c", 0xf0, 0x9f); // first half of 😅 sleep(1); fflush(stdout); printf("%c%c", 0x98, 0x85); // second half printf("\n"); return 0; }
clang -o prog test.c
-
Run Vim, open terminal by typing
:terminal
-
Run the compiled
prog
program. -
Observe that Vim shows a broken emoji because the time delay of printing the emoji "😅" caused the terminal emulator to improperly split it into two half:
➜ ychin ~/testbed/vim/broken_terminal_output% ./prog abc�� �%
Expected behaviour
It should look like this:
➜ ychin ~/testbed/vim/broken_terminal_output% ./prog
abc😅
Note that I tried this in Apple Terminal / Ghostty / iTerm2 / Kitty, and also Neovim's own terminal and they all work correctly.
I did notice that an old version of Neovim that I had lying around (0.9.5) would render this incorrectly. So they probably fixed it after then.
Version of Vim
9.1.1061
Environment
OS: macOS 15.2
Terminal: Tested on different ones, doesn't matter (since the bug happens in Vim's own libvterm terminal emulator)
Logs and stack traces
irisjae