Code change:
<ins> /*--------------------------------------------------------------------------------------------- *  Copyright (c) Microsoft Corporation. All rights reserved. *  Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { deepStrictEqual } from 'assert'; import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils'; import { chunkInput } from 'vs/platform/terminal/common/terminalProcess'; suite('platform - terminalProcess', () => { ensureNoDisposablesAreLeakedInTestSuite(); suite('chunkInput', () => { test('single chunk', () => { deepStrictEqual(chunkInput('foo bar'), ['foo bar']); }); test('multi chunk', () => { deepStrictEqual(chunkInput('foo'.repeat(50)), [ 'foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofo', 'ofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoof', 'oofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo' ]); }); test('small data with escapes', () => { deepStrictEqual(chunkInput('foo x1b[30mbar'), [ 'foo ', 'x1b[30mbar' ]); }); test('large data with escapes', () => { deepStrictEqual(chunkInput('foofoofoofoox1b[30mbarbarbarbarbarx1b[0m'.repeat(3)), [ 'foofoofoofoo', 'x1B[30mbarbarbarbarbar', 'x1B[0mfoofoofoofoo', 'x1B[30mbarbarbarbarbar', 'x1B[0mfoofoofoofoo', 'x1B[30mbarbarbarbarbar', 'x1B[0m' ]); }); }); }); </ins>

Related discussion:
text: <!-- Do Not Delete This! bugreporttemplate --<!-- Please read our Rules of Conduct: --<!-- Read our guide about submitting issues: --<!-- Search existing issues to avoid creating duplicates. --<!-- Test using the latest Insiders build to see if your issue has already been fixed: --<!-- Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. --<!-- Launch with to check. --Does this issue occur when all extensions are disabled?: Yes <!-- If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. --<!-- Issues caused by an extension need to be reported directly to the extension publisher. The 'Help Report Issue' dialog can assist with this. --- VS Code Version: 1.77.3 OS Version: Ubuntu 20.04.6 Steps to Reproduce: VSCode on an Ubuntu computer (or on Windows using WSL) the built-in terminal the command and paste the following 39-character string into nano: : nano shows the error message "Unknown Sequence". Can no longer interact with the terminal, need to kill it and open a new one More details: nano version 4.8 This does not happen in nano using an external terminal. Only in VSCode's built-in terminal This does not happen for any other length of string, even other multiples of 39 This does not happen in other CLI text editors, such as vim
I can confirm this issue on Windows using WSL.
It happens with other 39 long strings as well. It also happens when not using WSL. Copying more characters solves the problem. For us it also happens with multiples of 39 (e.g. 156 characters, line breaks included)
When trace logs are enabled this is the exact sequence we send: Compared to 1 less : Note that the 200/201 wrapped around it is bracketed paste mode (which I just a way to disable so that may help ). So this seems to be either a problem with one of nano, conpty or node-pty.
I also just ran into this. I'm on Windows 10, using Remote - SSH plugin to connect to an Ubuntu 22.04 server. Right-click to paste in Nano, terminal locks up, have to Kill it.