Paste in neovim with Terminal cannot stop #23400

Closed
opened 2026-01-31 08:41:08 +00:00 by claunia · 5 comments
Owner

Originally created by @mengq627 on GitHub (Jun 28, 2025).

Windows Terminal version

1.22.11141.0

Windows build number

10.0.22621.0

Other Software

neovim:
NVIM v0.11.0
Build type: Release
LuaJIT 2.1.1741730670

ssh:
OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

linux:
5.10.0-182

Steps to reproduce

  1. Open Windows Terminal, use ssh to login a linux server which has installed neovim;
  2. Execute neovim .test in bash;
  3. Paste ratelimit one time/multi times by Shift+Insert;

Expected Behavior

Paste with correct words, like:
ratelimitratelimitratelimitratelimitratelimitratelimit

Actual Behavior

Some special characters appear:
ratelimitratelimitratelimitratelimitratelimitratelimit[201~[200~ratelimitratelimit

As you can see, it is accidental. If it happend when paste only once, it will show as ratelimit[201~, in fact, ratelimit^[[201~,at now, I can not exit neovim paste mode/insert mode by esc, esc will show as ^[.

Then I paste again after again, ^[[200~ratelimit appear, I can exit neovim with esc now.

I can not reproduce this in tabby/Mobaxterm, I think it is a terminal bug.

Image

Originally created by @mengq627 on GitHub (Jun 28, 2025). ### Windows Terminal version 1.22.11141.0 ### Windows build number 10.0.22621.0 ### Other Software neovim: NVIM v0.11.0 Build type: Release LuaJIT 2.1.1741730670 ssh: OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2 linux: 5.10.0-182 ### Steps to reproduce 1. Open Windows Terminal, use ssh to login a linux server which has installed neovim; 2. Execute `neovim .test` in bash; 3. Paste `ratelimit` one time/multi times by `Shift`+`Insert`; ### Expected Behavior Paste with correct words, like: ratelimitratelimitratelimitratelimitratelimitratelimit ### Actual Behavior Some special characters appear: `ratelimitratelimitratelimitratelimitratelimitratelimit[201~[200~ratelimitratelimit` As you can see, it is accidental. If it happend when paste only once, it will show as `ratelimit[201~`, in fact, `ratelimit^[[201~`,at now, I can not exit neovim paste mode/insert mode by `esc`, `esc` will show as `^[`. Then I paste again after again, `^[[200~ratelimit` appear, I can exit neovim with `esc` now. I can not reproduce this in tabby/Mobaxterm, I think it is a terminal bug. ![Image](https://github.com/user-attachments/assets/723e305b-9738-4f3f-ab7d-ccdc1cdd347e)
Author
Owner

@mengq627 commented on GitHub (Jun 29, 2025):

There are some issues like this, but I can not find solution in them:

https://github.com/microsoft/terminal/issues/14717

@mengq627 commented on GitHub (Jun 29, 2025): There are some issues like this, but I can not find solution in them: https://github.com/microsoft/terminal/issues/14717
Author
Owner

@mengq627 commented on GitHub (Jun 29, 2025):

I tried the debug:

␛(B␛[0;1;7m.test␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣0,0-1␣␣␣␣␣␣␣␣␣␣All␛(B␛[m␍␊
␛[J␛[2;5H␛[?25h␛[86;47;118;0;1056;1_␛[16;42;0;1;48;1_␛[16;42;0;1;48;1_␛[16;42;0;1;48;1_␛[16;42;0;1;48;1_␛[16;42;0;1;48;1_␛[17;29;0;1;40;1_␛[86;0;22;1;40;1_␛[86;47;22;0;40;1_␛[?25l␛[43;104H^V␣␣␣␣␣␣␣␣␛[2;5H␛[?25h␛[?25l␛[43;104H1x1␍␛[43;1H␛(B␛[0;1m--␣VISUAL␣BLOCK␣--␛(B␛[m␛[K␛[85C1x1␛[2␣q␛[2;5H␛[?25h␛[17;29;0;0;32;1_␛[13;28;13;1;32;1_␛[?25l␛[43;104H^M␣␛[2;5H␛[?25h␛[?25l␛[43;104H1x1␛[2;5H␛[?25h␛[13;28;13;0;32;1_␛[27;1;27;1;32;1_␛[?25l␛[43;104H^[␣␛[2;5H␛[?25h␛[?25l␛[43;104H␣␣␍␛[43;1H␛[18X␛[2␣q␛[2;5H␛[?25h␛[27;1;27;0;32;1_␛[16;42;0;1;48;1_␛[200ratelimit␛[201␛[?25lratelimit␛[42;7H␛(B␛[0;1;7m[+]␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣1,9␣␣␛]0;.test␣+␣()␣-␣Nvim␇␛[2;5H␛[?25h␛[?25l␛[1;2H␛(B␛[0;1;7m␛[38;2;255;0;0m␣␣␣␣␛(B␛[0;1;7m␛[38;2;109;128;134m␛[1;7H␣␛(B␛[0;1;7m␛[38;2;255;0;0m.test␣␣␣␣●␛[1;18H␣␛[2;5H␛[?25h␛[?25l␛[8C␛[?25h␛[45;82;0;0;304;1_␛[200ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m18␛[2;22H␛[?25h␛[45;82;0;0;304;1_␛[200ratelimit␛[201␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m27␛[2;31H␛[?25h␛[45;82;0;0;304;1_␛[200ratelimit␛[201␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m36␛[2;40H␛[?25h␛[45;82;0;0;304;1_␛[200ratelimit␛[201␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m45␛[2;49H␛[?25h␛[45;82;0;0;304;1_␛[200ratelimit␛[201␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m54␛[2;58H␛[?25h␛[45;82;0;0;304;1_␛[200ratelimit␛[201␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m63␛[2;67H␛[?25h␛[45;82;0;0;304;1_␛[200ratelimit␛[201␛[?25l␛[C␛(B␛[mratelimit␛[38;2;0;255;255m^[␛[42;99H␛(B␛[0;1;7m7␛[2;77H␛[?25h␛[?25l␛[C␛[C␛(B␛[m[201~␛[42;100H␛(B␛[0;1;7m8-79␛[2;83H␛[?25h␛[45;82;0;0;304;1_␛[200ratelimit␛[201␛[?25l␛[C␛(B␛[m␛[38;2;0;255;255m^[␛(B␛[m[200ratelimit␛[17D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m93-95␛[2;99H␛[?25h␛[45;82;0;0;304;1_␛[200ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[38;2;0;255;255m^[␛[42;99H␛(B␛[0;1;7m103-105␛[2;109H␛[?25h␛[?25l␛[C␛[C␛(B␛[m[201␛[38;2;255;255;0m␣␣␣␣␛(B␛[m~␛[K␛[42;101H␛(B␛[0;1;7m8-111␛[3;5H␛[?25h␛[45;82;0;0;304;1_␛[16;42;0;0;32;1_␛[17;29;0;1;40;1_␛[18;56;0;1;42;1_␛[O␛[I␛[O␛[I␛[O

@mengq627 commented on GitHub (Jun 29, 2025): I tried the debug: ␛(B␛[0;1;7m.test␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣0,0-1␣␣␣␣␣␣␣␣␣␣All␛(B␛[m␍␊ ␛[J␛[2;5H␛[?25h␛[86;47;118;0;1056;1_␛[16;42;0;1;48;1_␛[16;42;0;1;48;1_␛[16;42;0;1;48;1_␛[16;42;0;1;48;1_␛[16;42;0;1;48;1_␛[17;29;0;1;40;1_␛[86;0;22;1;40;1_␛[86;47;22;0;40;1_␛[?25l␛[43;104H^V␣␣␣␣␣␣␣␣␛[2;5H␛[?25h␛[?25l␛[43;104H1x1␍␛[43;1H␛(B␛[0;1m--␣VISUAL␣BLOCK␣--␛(B␛[m␛[K␛[85C1x1␛[2␣q␛[2;5H␛[?25h␛[17;29;0;0;32;1_␛[13;28;13;1;32;1_␛[?25l␛[43;104H^M␣␛[2;5H␛[?25h␛[?25l␛[43;104H1x1␛[2;5H␛[?25h␛[13;28;13;0;32;1_␛[27;1;27;1;32;1_␛[?25l␛[43;104H^[␣␛[2;5H␛[?25h␛[?25l␛[43;104H␣␣␍␛[43;1H␛[18X␛[2␣q␛[2;5H␛[?25h␛[27;1;27;0;32;1_␛[16;42;0;1;48;1_␛[200~ratelimit␛[201~␛[?25lratelimit␛[42;7H␛(B␛[0;1;7m[+]␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣␣1,9␣␣␛]0;.test␣+␣(~)␣-␣Nvim␇␛[2;5H␛[?25h␛[?25l␛[1;2H␛(B␛[0;1;7m␛[38;2;255;0;0m␣␣␣␣␛(B␛[0;1;7m␛[38;2;109;128;134m␛[1;7H␣␛(B␛[0;1;7m␛[38;2;255;0;0m.test␣␣␣␣●␛[1;18H␣␛[2;5H␛[?25h␛[?25l␛[8C␛[?25h␛[45;82;0;0;304;1_␛[200~ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m18␛[2;22H␛[?25h␛[45;82;0;0;304;1_␛[200~ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m27␛[2;31H␛[?25h␛[45;82;0;0;304;1_␛[200~ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m36␛[2;40H␛[?25h␛[45;82;0;0;304;1_␛[200~ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m45␛[2;49H␛[?25h␛[45;82;0;0;304;1_␛[200~ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m54␛[2;58H␛[?25h␛[45;82;0;0;304;1_␛[200~ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[10D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m63␛[2;67H␛[?25h␛[45;82;0;0;304;1_␛[200~ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[38;2;0;255;255m^[␛[42;99H␛(B␛[0;1;7m7␛[2;77H␛[?25h␛[?25l␛[C␛[C␛(B␛[m[201~␛[42;100H␛(B␛[0;1;7m8-79␛[2;83H␛[?25h␛[45;82;0;0;304;1_␛[200~ratelimit␛[201~␛[?25l␛[C␛(B␛[m␛[38;2;0;255;255m^[␛(B␛[m[200~ratelimit␛[17D␛[?25h␛[?25l␛[42;99H␛(B␛[0;1;7m93-95␛[2;99H␛[?25h␛[45;82;0;0;304;1_␛[200~ratelimit␛[201~␛[?25l␛[C␛(B␛[mratelimit␛[38;2;0;255;255m^[␛[42;99H␛(B␛[0;1;7m103-105␛[2;109H␛[?25h␛[?25l␛[C␛[C␛(B␛[m[201␛[38;2;255;255;0m␣␣␣␣␛(B␛[m~␛[K␛[42;101H␛(B␛[0;1;7m8-111␛[3;5H␛[?25h␛[45;82;0;0;304;1_␛[16;42;0;0;32;1_␛[17;29;0;1;40;1_␛[18;56;0;1;42;1_␛[O␛[I␛[O␛[I␛[O <!-- Failed to upload "image.png" -->
Author
Owner

@lhecker commented on GitHub (Jun 30, 2025):

I think this is the same as #18579. I'm currently working on that.

@lhecker commented on GitHub (Jun 30, 2025): I think this is the same as #18579. I'm currently working on that.
Author
Owner

@mengq627 commented on GitHub (Jul 14, 2025):

sorry, but it reproduce in Windows Terminal Canary Version: 1.24.1901.0, which is the latest version. @lhecker

@mengq627 commented on GitHub (Jul 14, 2025): sorry, but it reproduce in Windows Terminal Canary Version: 1.24.1901.0, which is the latest version. @lhecker
Author
Owner

@mengq627 commented on GitHub (Aug 2, 2025):

I found the root cause is the setting vim.o.ttimeoutlen = 0 in neovim which is copied from blog. However, other terminals, like MobaxTerm, Tabby, do not have this question. I think it is a compound problem, need Windows terminal and the neovim config.

Now, my problem has been solved, so thanks.

@mengq627 commented on GitHub (Aug 2, 2025): I found the root cause is the setting `vim.o.ttimeoutlen = 0` in neovim which is copied from blog. However, other terminals, like MobaxTerm, Tabby, do not have this question. I think it is a compound problem, need Windows terminal and the neovim config. Now, my problem has been solved, so thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#23400