From b6676f60e918b147e60ed9b6b11f458fa1315fa1 Mon Sep 17 00:00:00 2001 From: Daniel Imms <2193314+Tyriar@users.noreply.github.com> Date: Wed, 2 Aug 2023 07:34:26 -0700 Subject: [PATCH] Add ignoreBracketedPasteMode setting Fixes #187480 --- package.json | 6 ++--- remote/package.json | 6 ++--- remote/web/package.json | 4 ++-- remote/web/yarn.lock | 16 ++++++------- remote/yarn.lock | 24 +++++++++---------- src/vs/platform/terminal/common/terminal.ts | 1 + .../terminal/browser/xterm/xtermTerminal.ts | 4 +++- .../contrib/terminal/common/terminal.ts | 1 + .../terminal/common/terminalConfiguration.ts | 5 ++++ yarn.lock | 24 +++++++++---------- 10 files changed, 50 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index d1bed1250dbd1..cb1ac52bf18de 100644 --- a/package.json +++ b/package.json @@ -95,14 +95,14 @@ "vscode-oniguruma": "1.7.0", "vscode-regexpp": "^3.1.0", "vscode-textmate": "9.0.0", - "xterm": "5.3.0-beta.21", + "xterm": "5.3.0-beta.24", "xterm-addon-canvas": "0.5.0-beta.7", - "xterm-addon-image": "0.4.3", + "xterm-addon-image": "0.5.0", "xterm-addon-search": "0.13.0-beta.4", "xterm-addon-serialize": "0.11.0-beta.6", "xterm-addon-unicode11": "0.5.0", "xterm-addon-webgl": "0.16.0-beta.6", - "xterm-headless": "5.3.0-beta.21", + "xterm-headless": "5.3.0-beta.24", "yauzl": "^2.9.2", "yazl": "^2.4.3" }, diff --git a/remote/package.json b/remote/package.json index 03295dbb0e0ac..cb2f00dcd8a17 100644 --- a/remote/package.json +++ b/remote/package.json @@ -27,14 +27,14 @@ "vscode-oniguruma": "1.7.0", "vscode-regexpp": "^3.1.0", "vscode-textmate": "9.0.0", - "xterm": "5.3.0-beta.21", + "xterm": "5.3.0-beta.24", "xterm-addon-canvas": "0.5.0-beta.7", - "xterm-addon-image": "0.4.3", + "xterm-addon-image": "0.5.0", "xterm-addon-search": "0.13.0-beta.4", "xterm-addon-serialize": "0.11.0-beta.6", "xterm-addon-unicode11": "0.5.0", "xterm-addon-webgl": "0.16.0-beta.6", - "xterm-headless": "5.3.0-beta.21", + "xterm-headless": "5.3.0-beta.24", "yauzl": "^2.9.2", "yazl": "^2.4.3" } diff --git a/remote/web/package.json b/remote/web/package.json index ff0ed3155d99b..a0ab2c68bd25d 100644 --- a/remote/web/package.json +++ b/remote/web/package.json @@ -11,9 +11,9 @@ "tas-client-umd": "0.1.8", "vscode-oniguruma": "1.7.0", "vscode-textmate": "9.0.0", - "xterm": "5.3.0-beta.21", + "xterm": "5.3.0-beta.24", "xterm-addon-canvas": "0.5.0-beta.7", - "xterm-addon-image": "0.4.3", + "xterm-addon-image": "0.5.0", "xterm-addon-search": "0.13.0-beta.4", "xterm-addon-unicode11": "0.5.0", "xterm-addon-webgl": "0.16.0-beta.6" diff --git a/remote/web/yarn.lock b/remote/web/yarn.lock index eaba3881931c2..a6e62ad0a8fbf 100644 --- a/remote/web/yarn.lock +++ b/remote/web/yarn.lock @@ -73,10 +73,10 @@ xterm-addon-canvas@0.5.0-beta.7: resolved "https://registry.yarnpkg.com/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0-beta.7.tgz#27a6753a0d8551248bffb15c29d5d88bf6b2a071" integrity sha512-33a8kSR/uirSrtPkNiCO5MnRwuvR0hTvm1K+541XDsa9QS0VF0xPZoC4MEWHHXfSMzrTFgx1edpXqYOKc2yWtw== -xterm-addon-image@0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.4.3.tgz#b9e563d908c6aa82458852eb5b8a7ea931c19dd3" - integrity sha512-OyNs5qpW884CXJGRdqOnaiH2L9HLNyfO4oCHOH9mCVFjp099Aqc4u/DBs4nyTPcBgdeKrlE8xzI1i6y8H94aCw== +xterm-addon-image@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.5.0.tgz#3c9bb332a3de55ab200dbefd3411e3b0d985314f" + integrity sha512-bWXUBeDzhisYh0clVKx4JgQrZjpn+/QRMRwNsfnRpjCMhgmZ+SL3Bivktd7q03O4uKMMcAOe6bSmppwP9/um0Q== xterm-addon-search@0.13.0-beta.4: version "0.13.0-beta.4" @@ -93,7 +93,7 @@ xterm-addon-webgl@0.16.0-beta.6: resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0-beta.6.tgz#5f8a598081a117dec15b4ead8160bf8e972fbfd0" integrity sha512-bRFahQyVuiRmeakLzTrs3V3KSWBDOcePfT/Q7dwWfh8NPpilg6/Zm04ijq99Nsg1AYbfNWh+P05Myppa8uimCA== -xterm@5.3.0-beta.21: - version "5.3.0-beta.21" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.21.tgz#6b19160e8442bdc0a505213a4aa1c6a231af9deb" - integrity sha512-AtkHnXSRbQ+uKgpYyQ4fkQRMur7rzM7kLY5hKcYZ8R8OpQmsbQxahStRNVBPP32rk+uKOmuZIQ61eQR7y44tGQ== +xterm@5.3.0-beta.24: + version "5.3.0-beta.24" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.24.tgz#ba8762b66cba543de13c70eaa2e5e2687060c6b3" + integrity sha512-XMk54jwvWJKJVVBm0wh2SCUB9vnXzg872yAytEKlspEWim62nM1lMfYMI/yNjr5RhL3YtBNOR4ewE4ubfhUINA== diff --git a/remote/yarn.lock b/remote/yarn.lock index 5a0410701ec56..635d40dc7593b 100644 --- a/remote/yarn.lock +++ b/remote/yarn.lock @@ -882,10 +882,10 @@ xterm-addon-canvas@0.5.0-beta.7: resolved "https://registry.yarnpkg.com/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0-beta.7.tgz#27a6753a0d8551248bffb15c29d5d88bf6b2a071" integrity sha512-33a8kSR/uirSrtPkNiCO5MnRwuvR0hTvm1K+541XDsa9QS0VF0xPZoC4MEWHHXfSMzrTFgx1edpXqYOKc2yWtw== -xterm-addon-image@0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.4.3.tgz#b9e563d908c6aa82458852eb5b8a7ea931c19dd3" - integrity sha512-OyNs5qpW884CXJGRdqOnaiH2L9HLNyfO4oCHOH9mCVFjp099Aqc4u/DBs4nyTPcBgdeKrlE8xzI1i6y8H94aCw== +xterm-addon-image@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.5.0.tgz#3c9bb332a3de55ab200dbefd3411e3b0d985314f" + integrity sha512-bWXUBeDzhisYh0clVKx4JgQrZjpn+/QRMRwNsfnRpjCMhgmZ+SL3Bivktd7q03O4uKMMcAOe6bSmppwP9/um0Q== xterm-addon-search@0.13.0-beta.4: version "0.13.0-beta.4" @@ -907,15 +907,15 @@ xterm-addon-webgl@0.16.0-beta.6: resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0-beta.6.tgz#5f8a598081a117dec15b4ead8160bf8e972fbfd0" integrity sha512-bRFahQyVuiRmeakLzTrs3V3KSWBDOcePfT/Q7dwWfh8NPpilg6/Zm04ijq99Nsg1AYbfNWh+P05Myppa8uimCA== -xterm-headless@5.3.0-beta.21: - version "5.3.0-beta.21" - resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.3.0-beta.21.tgz#3d41388c25c07530ecaeb081546e3e660d707f5d" - integrity sha512-hCwZHS13NU9bNZAE8BK5FDERjkLGXwDUh1M/Zz46S8WB/AtSRN2kt0lIES3IzZdEOzUjPdfiI4UNGXiLIpLZ/w== +xterm-headless@5.3.0-beta.24: + version "5.3.0-beta.24" + resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.3.0-beta.24.tgz#53fd4cb1074df32b8380f8648e27b30402afbf52" + integrity sha512-POltAlizoSkgbjxloTkmn0Rzwh0viOdM6kpRir8yorSOMctOWXe94tNL2vgdEJxXRvMLFo8wXNjFz0g7N4wZ8w== -xterm@5.3.0-beta.21: - version "5.3.0-beta.21" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.21.tgz#6b19160e8442bdc0a505213a4aa1c6a231af9deb" - integrity sha512-AtkHnXSRbQ+uKgpYyQ4fkQRMur7rzM7kLY5hKcYZ8R8OpQmsbQxahStRNVBPP32rk+uKOmuZIQ61eQR7y44tGQ== +xterm@5.3.0-beta.24: + version "5.3.0-beta.24" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.24.tgz#ba8762b66cba543de13c70eaa2e5e2687060c6b3" + integrity sha512-XMk54jwvWJKJVVBm0wh2SCUB9vnXzg872yAytEKlspEWim62nM1lMfYMI/yNjr5RhL3YtBNOR4ewE4ubfhUINA== yallist@^4.0.0: version "4.0.0" diff --git a/src/vs/platform/terminal/common/terminal.ts b/src/vs/platform/terminal/common/terminal.ts index 874aef7bb3802..f8a98e4aa7d99 100644 --- a/src/vs/platform/terminal/common/terminal.ts +++ b/src/vs/platform/terminal/common/terminal.ts @@ -112,6 +112,7 @@ export const enum TerminalSettingId { ShellIntegrationSuggestEnabled = 'terminal.integrated.shellIntegration.suggestEnabled', EnableImages = 'terminal.integrated.enableImages', SmoothScrolling = 'terminal.integrated.smoothScrolling', + IgnoreBracketedPasteMode = 'terminal.integrated.ignoreBracketedPasteMode', // Debug settings that are hidden from user diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts index 0eb141ad11aa2..ce8b46bb9c39e 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.ts @@ -234,7 +234,8 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID scrollSensitivity: config.mouseWheelScrollSensitivity, wordSeparator: config.wordSeparators, overviewRulerWidth: 10, - smoothScrollDuration: config.smoothScrolling ? RenderConstants.SmoothScrollDuration : 0 + smoothScrollDuration: config.smoothScrolling ? RenderConstants.SmoothScrollDuration : 0, + ignoreBracketedPasteMode: config.ignoreBracketedPasteMode })); this._core = (this.raw as any)._core as IXtermCore; @@ -393,6 +394,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID this.raw.options.wordSeparator = config.wordSeparators; this.raw.options.customGlyphs = config.customGlyphs; this.raw.options.smoothScrollDuration = config.smoothScrolling ? RenderConstants.SmoothScrollDuration : 0; + this.raw.options.ignoreBracketedPasteMode = config.ignoreBracketedPasteMode; if (this._attached?.options.enableGpu) { if (this._shouldLoadWebgl()) { this._enableWebglRenderer(); diff --git a/src/vs/workbench/contrib/terminal/common/terminal.ts b/src/vs/workbench/contrib/terminal/common/terminal.ts index c1d5c806b2f47..219ca791ee1e3 100644 --- a/src/vs/workbench/contrib/terminal/common/terminal.ts +++ b/src/vs/workbench/contrib/terminal/common/terminal.ts @@ -207,6 +207,7 @@ export interface ITerminalConfiguration { }; enableImages: boolean; smoothScrolling: boolean; + ignoreBracketedPasteMode: boolean; } export const DEFAULT_LOCAL_ECHO_EXCLUDE: ReadonlyArray = ['vim', 'vi', 'nano', 'tmux']; diff --git a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts index 1ca34b88c2e3b..528abcf5ffe9b 100644 --- a/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts +++ b/src/vs/workbench/contrib/terminal/common/terminalConfiguration.ts @@ -593,6 +593,11 @@ const terminalConfiguration: IConfigurationNode = { type: 'boolean', default: false }, + [TerminalSettingId.IgnoreBracketedPasteMode]: { + markdownDescription: localize('terminal.integrated.ignoreBracketedPasteMode', "Controls whether the terminal will ignore bracketed paste mode even if the terminal was put into the mode, omitting the {0} and {1} sequences when pasting. This is useful when the shell is not respecting the mode which can happen in sub-shells for example.", '`\\x1b[200~`', '`\\x1b[201~`'), + type: 'boolean', + default: false + }, [TerminalSettingId.EnableImages]: { restricted: true, markdownDescription: localize('terminal.integrated.enableImages', "Enables image support in the terminal, this will only work when {0} is enabled. Both sixel and iTerm's inline image protocol are supported on Linux and macOS, Windows support will light up automatically when ConPTY passes through the sequences. Images will currently not be restored between window reloads/reconnects.", `\`#${TerminalSettingId.GpuAcceleration}#\``), diff --git a/yarn.lock b/yarn.lock index f4b57d7e0aabd..faff98e940466 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10764,10 +10764,10 @@ xterm-addon-canvas@0.5.0-beta.7: resolved "https://registry.yarnpkg.com/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0-beta.7.tgz#27a6753a0d8551248bffb15c29d5d88bf6b2a071" integrity sha512-33a8kSR/uirSrtPkNiCO5MnRwuvR0hTvm1K+541XDsa9QS0VF0xPZoC4MEWHHXfSMzrTFgx1edpXqYOKc2yWtw== -xterm-addon-image@0.4.3: - version "0.4.3" - resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.4.3.tgz#b9e563d908c6aa82458852eb5b8a7ea931c19dd3" - integrity sha512-OyNs5qpW884CXJGRdqOnaiH2L9HLNyfO4oCHOH9mCVFjp099Aqc4u/DBs4nyTPcBgdeKrlE8xzI1i6y8H94aCw== +xterm-addon-image@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.5.0.tgz#3c9bb332a3de55ab200dbefd3411e3b0d985314f" + integrity sha512-bWXUBeDzhisYh0clVKx4JgQrZjpn+/QRMRwNsfnRpjCMhgmZ+SL3Bivktd7q03O4uKMMcAOe6bSmppwP9/um0Q== xterm-addon-search@0.13.0-beta.4: version "0.13.0-beta.4" @@ -10789,15 +10789,15 @@ xterm-addon-webgl@0.16.0-beta.6: resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0-beta.6.tgz#5f8a598081a117dec15b4ead8160bf8e972fbfd0" integrity sha512-bRFahQyVuiRmeakLzTrs3V3KSWBDOcePfT/Q7dwWfh8NPpilg6/Zm04ijq99Nsg1AYbfNWh+P05Myppa8uimCA== -xterm-headless@5.3.0-beta.21: - version "5.3.0-beta.21" - resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.3.0-beta.21.tgz#3d41388c25c07530ecaeb081546e3e660d707f5d" - integrity sha512-hCwZHS13NU9bNZAE8BK5FDERjkLGXwDUh1M/Zz46S8WB/AtSRN2kt0lIES3IzZdEOzUjPdfiI4UNGXiLIpLZ/w== +xterm-headless@5.3.0-beta.24: + version "5.3.0-beta.24" + resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.3.0-beta.24.tgz#53fd4cb1074df32b8380f8648e27b30402afbf52" + integrity sha512-POltAlizoSkgbjxloTkmn0Rzwh0viOdM6kpRir8yorSOMctOWXe94tNL2vgdEJxXRvMLFo8wXNjFz0g7N4wZ8w== -xterm@5.3.0-beta.21: - version "5.3.0-beta.21" - resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.21.tgz#6b19160e8442bdc0a505213a4aa1c6a231af9deb" - integrity sha512-AtkHnXSRbQ+uKgpYyQ4fkQRMur7rzM7kLY5hKcYZ8R8OpQmsbQxahStRNVBPP32rk+uKOmuZIQ61eQR7y44tGQ== +xterm@5.3.0-beta.24: + version "5.3.0-beta.24" + resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.24.tgz#ba8762b66cba543de13c70eaa2e5e2687060c6b3" + integrity sha512-XMk54jwvWJKJVVBm0wh2SCUB9vnXzg872yAytEKlspEWim62nM1lMfYMI/yNjr5RhL3YtBNOR4ewE4ubfhUINA== y18n@^3.2.1: version "3.2.2"