Freeze when pasting large text into vim (WSL) #21429

Open
opened 2026-01-31 07:44:30 +00:00 by claunia · 10 comments
Owner

Originally created by @danielniccoli on GitHub (Mar 22, 2024).

Originally assigned to: @lhecker on GitHub.

Windows Terminal version

1.19.10573.0

Windows build number

10.0.22631.0

Other Software

vim 8.2.2121 (inside WSL Ubuntu 22.04.4 LTS)

Steps to reproduce

  1. Find a large enough text block. You can generate one with 1,000,000 characters at https://www.lipsum.com
  2. Open vim and switch into insert mode.
  3. Paste the sample text into vim using CTRL-v or SHIFT-INS

Expected Behavior

It should paste the text and the terminal / wsl / vim shall remain reactive.

Actual Behavior

The terminal / wsl / vim freezes midst the paste operation and cannot be recovered. The tab must be closed and a new one opened, to continue work in the terminal / wsl / vim.

Originally created by @danielniccoli on GitHub (Mar 22, 2024). Originally assigned to: @lhecker on GitHub. ### Windows Terminal version 1.19.10573.0 ### Windows build number 10.0.22631.0 ### Other Software vim 8.2.2121 (inside WSL Ubuntu 22.04.4 LTS) ### Steps to reproduce 1. Find a large enough text block. You can generate one with 1,000,000 characters at https://www.lipsum.com 2. Open `vim` and switch into *insert mode*. 3. Paste the sample text into vim using <kbd>CTRL-v</kbd> or <kbd>SHIFT-INS</kbd> ### Expected Behavior It should paste the text and the terminal / wsl / vim shall remain reactive. ### Actual Behavior The terminal / wsl / vim freezes midst the paste operation and cannot be recovered. The tab must be closed and a new one opened, to continue work in the terminal / wsl / vim.
claunia added the Issue-BugArea-InputProduct-Terminal labels 2026-01-31 07:44:30 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Mar 22, 2024):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Mar 22, 2024): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Open similar issues: - [pasting large multiline text is extremelly slow (#9232)](https://github.com/microsoft/terminal/issues/9232), similarity score: 0.79 - [Pasting specific texts into vim (WSL) breaks some keys (#16655)](https://github.com/microsoft/terminal/issues/16655), similarity score: 0.78 ### Closed similar issues: - [Neovim often freezes when pasting in Windows Terminal (#13645)](https://github.com/microsoft/terminal/issues/13645), similarity score: 0.83 - [Windows terminal randomly freezes with Neovim 0.6 in debian Bullseye when using MCTRL>-<SHIFT>C or <CTRL-SHIFT>V (#11945)](https://github.com/microsoft/terminal/issues/11945), similarity score: 0.77 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@lhecker commented on GitHub (Mar 25, 2024):

Out of 10 tests I did manage to reproduce a freeze once. How often does this happen for you? Is this always reproducible? I did notice that if I SIGTERM vim my original tab still works. So I think it should either be a bug in vim, or we're failing to send some input to it and it's waiting indefinitely on that (for instance the end of the bracketed paste?).

@lhecker commented on GitHub (Mar 25, 2024): Out of 10 tests I did manage to reproduce a freeze once. How often does this happen for you? Is this always reproducible? I did notice that if I `SIGTERM` vim my original tab still works. So I think it should either be a bug in vim, or we're failing to send some input to it and it's waiting indefinitely on that (for instance the end of the bracketed paste?).
Author
Owner

@danielniccoli commented on GitHub (Mar 26, 2024):

I can reproduce it reliably, always. SIGTERM ist ctrl-c, no? The terminal does not respond to ctrl-c or ctrl-z. It also freezes at random positions for the same text. I don't know what you mean by bracket.

@danielniccoli commented on GitHub (Mar 26, 2024): I can reproduce it reliably, always. SIGTERM ist ctrl-c, no? The terminal does not respond to ctrl-c or ctrl-z. It also freezes at random positions for the same text. I don't know what you mean by bracket.
Author
Owner

@lhecker commented on GitHub (Mar 26, 2024):

I can reproduce it reliably, always. SIGTERM ist ctrl-c, no?

No that's SIGINT. What I did is open a new WSL tab in parallel and run killall vim.

I don't know what you mean by bracket.

Bracketed paste is a technique with which the terminal can tell an application that the input comes from the clipboard (or similar) and not keyboard. For instance, in vim you may want automatic indentation when typing, but when pasting you may want it to be preserved as is. You can read more about it here: https://en.wikipedia.org/wiki/Bracketed-paste

@lhecker commented on GitHub (Mar 26, 2024): > I can reproduce it reliably, always. SIGTERM ist ctrl-c, no? No that's SIGINT. What I did is open a new WSL tab in parallel and run `killall vim`. > I don't know what you mean by bracket. Bracketed paste is a technique with which the terminal can tell an application that the input comes from the clipboard (or similar) and not keyboard. For instance, in `vim` you may want automatic indentation when typing, but when _pasting_ you may want it to be preserved as is. You can read more about it here: https://en.wikipedia.org/wiki/Bracketed-paste
Author
Owner

@danielniccoli commented on GitHub (Mar 26, 2024):

I can run killall vim on a different WSL tab, which kills the process, but it still stays unresponsive. You can't see that in the video, but before and after I run the killall vim command, I'm pressing esc, ctrl-c, ctrl-z, and some other keys in a-z and nothing happens.

After the killall vim you can see that some more text get's pasted into the terminal. I can't reproduce that always. It just happened to happen when I recorded it.

https://github.com/microsoft/terminal/assets/2971735/5c87ec1a-c1ce-495a-946a-25d81315083c

@danielniccoli commented on GitHub (Mar 26, 2024): I can run `killall vim` on a different WSL tab, which kills the process, but it still stays unresponsive. You can't see that in the video, but before and after I run the `killall vim` command, I'm pressing esc, ctrl-c, ctrl-z, and some other keys in a-z and nothing happens. After the `killall vim` you can see that some more text get's pasted into the terminal. I can't reproduce that always. It just happened to happen when I recorded it. https://github.com/microsoft/terminal/assets/2971735/5c87ec1a-c1ce-495a-946a-25d81315083c
Author
Owner

@zadjii-msft commented on GitHub (Mar 27, 2024):

Fascinating. That's an interesting repro for sure. Thanks for filing!

@zadjii-msft commented on GitHub (Mar 27, 2024): Fascinating. That's an interesting repro for sure. Thanks for filing!
Author
Owner

@danielniccoli commented on GitHub (Jan 13, 2025):

@zadjii-msft, the problem still persists. Is there any progress planned on this issue in the foreseeable future?

@danielniccoli commented on GitHub (Jan 13, 2025): @zadjii-msft, the problem still persists. Is there any progress planned on this issue in the foreseeable future?
Author
Owner

@koakuma-chan commented on GitHub (Mar 8, 2025):

I have the same issue.

@koakuma-chan commented on GitHub (Mar 8, 2025): I have the same issue.
Author
Owner

@akhosravian commented on GitHub (Aug 13, 2025):

Also seeing this

@akhosravian commented on GitHub (Aug 13, 2025): Also seeing this
Author
Owner

@lhecker commented on GitHub (Aug 13, 2025):

Possibly fixed by #18816. You can install Canary here to test it: https://aka.ms/terminal-canary-installer

@lhecker commented on GitHub (Aug 13, 2025): Possibly fixed by #18816. You can install Canary here to test it: https://aka.ms/terminal-canary-installer
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21429