mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
Replace escape sequence logging with terminal log channel
Fixes #185349
This commit is contained in:
parent
aedd8038a2
commit
6287e1f583
14
package.json
14
package.json
|
@ -92,14 +92,14 @@
|
|||
"vscode-oniguruma": "1.7.0",
|
||||
"vscode-regexpp": "^3.1.0",
|
||||
"vscode-textmate": "9.0.0",
|
||||
"xterm": "5.3.0-beta.1",
|
||||
"xterm-addon-canvas": "0.5.0-beta.1",
|
||||
"xterm": "5.3.0-beta.3",
|
||||
"xterm-addon-canvas": "0.5.0-beta.2",
|
||||
"xterm-addon-image": "0.4.1",
|
||||
"xterm-addon-search": "0.13.0-beta.1",
|
||||
"xterm-addon-serialize": "0.11.0-beta.1",
|
||||
"xterm-addon-search": "0.13.0-beta.2",
|
||||
"xterm-addon-serialize": "0.11.0-beta.2",
|
||||
"xterm-addon-unicode11": "0.5.0",
|
||||
"xterm-addon-webgl": "0.16.0-beta.1",
|
||||
"xterm-headless": "5.3.0-beta.1",
|
||||
"xterm-addon-webgl": "0.16.0-beta.2",
|
||||
"xterm-headless": "5.3.0-beta.3",
|
||||
"yauzl": "^2.9.2",
|
||||
"yazl": "^2.4.3"
|
||||
},
|
||||
|
@ -230,4 +230,4 @@
|
|||
"optionalDependencies": {
|
||||
"windows-foreground-love": "0.5.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,14 +26,14 @@
|
|||
"vscode-oniguruma": "1.7.0",
|
||||
"vscode-regexpp": "^3.1.0",
|
||||
"vscode-textmate": "9.0.0",
|
||||
"xterm": "5.3.0-beta.1",
|
||||
"xterm-addon-canvas": "0.5.0-beta.1",
|
||||
"xterm": "5.3.0-beta.3",
|
||||
"xterm-addon-canvas": "0.5.0-beta.2",
|
||||
"xterm-addon-image": "0.4.1",
|
||||
"xterm-addon-search": "0.13.0-beta.1",
|
||||
"xterm-addon-serialize": "0.11.0-beta.1",
|
||||
"xterm-addon-search": "0.13.0-beta.2",
|
||||
"xterm-addon-serialize": "0.11.0-beta.2",
|
||||
"xterm-addon-unicode11": "0.5.0",
|
||||
"xterm-addon-webgl": "0.16.0-beta.1",
|
||||
"xterm-headless": "5.3.0-beta.1",
|
||||
"xterm-addon-webgl": "0.16.0-beta.2",
|
||||
"xterm-headless": "5.3.0-beta.3",
|
||||
"yauzl": "^2.9.2",
|
||||
"yazl": "^2.4.3"
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
"tas-client-umd": "0.1.8",
|
||||
"vscode-oniguruma": "1.7.0",
|
||||
"vscode-textmate": "9.0.0",
|
||||
"xterm": "5.3.0-beta.1",
|
||||
"xterm-addon-canvas": "0.5.0-beta.1",
|
||||
"xterm": "5.3.0-beta.3",
|
||||
"xterm-addon-canvas": "0.5.0-beta.2",
|
||||
"xterm-addon-image": "0.4.1",
|
||||
"xterm-addon-search": "0.13.0-beta.1",
|
||||
"xterm-addon-search": "0.13.0-beta.2",
|
||||
"xterm-addon-unicode11": "0.5.0",
|
||||
"xterm-addon-webgl": "0.16.0-beta.1"
|
||||
"xterm-addon-webgl": "0.16.0-beta.2"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,32 +68,32 @@ vscode-textmate@9.0.0:
|
|||
resolved "https://registry.yarnpkg.com/vscode-textmate/-/vscode-textmate-9.0.0.tgz#313c6c8792b0507aef35aeb81b6b370b37c44d6c"
|
||||
integrity sha512-Cl65diFGxz7gpwbav10HqiY/eVYTO1sjQpmRmV991Bj7wAoOAjGQ97PpQcXorDE2Uc4hnGWLY17xme+5t6MlSg==
|
||||
|
||||
xterm-addon-canvas@0.5.0-beta.1:
|
||||
version "0.5.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0-beta.1.tgz#b5ae185741423715460a66029c944b4dededfab0"
|
||||
integrity sha512-A7yjIpyTcOh8ckPJw1YFDvwbTbQ+grM+kTtutOvu5LjLSV9EoCHX17kVoiT2V29ywF7KJMeLYwfBwyFE3uA3QQ==
|
||||
xterm-addon-canvas@0.5.0-beta.2:
|
||||
version "0.5.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0-beta.2.tgz#1b83c2a9a306766c47a4f80b8c65cc9ee5f5a5c4"
|
||||
integrity sha512-oTb/2krdbHYGxH2X6yiBZzAB/1WB+apUu4nXHdhBnht20bl8E+YVWqg95D4o0Gl+QJI+XOfB3mqmWaBx1x531A==
|
||||
|
||||
xterm-addon-image@0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.4.1.tgz#ec8f750af48005ad641c1128fa1f551ac198472a"
|
||||
integrity sha512-iJpYyvtbHg4oXSv+D6J73ZfCjnboZpbZ567MLplXDBlYSUknv3kvPTfVMPJATV7Zsx7+bDgyXboCh9vsDf/m/w==
|
||||
|
||||
xterm-addon-search@0.13.0-beta.1:
|
||||
version "0.13.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.13.0-beta.1.tgz#9fb6ede402d4c369d59d5d6faefe54a05b125bcf"
|
||||
integrity sha512-rdOIhwkfRASqTriUO8QP9UY0p6BosLMv1NXTZqhgq3/5xAXx4VZg6mlQjTRGnUz/GJIN1jU9e/Vp20SpocP/Hw==
|
||||
xterm-addon-search@0.13.0-beta.2:
|
||||
version "0.13.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.13.0-beta.2.tgz#c984a35312acad4ce768d17bc49adffa90eece61"
|
||||
integrity sha512-+VoPhIRmfiX2uh2t6xD/RJtBYjVjrkNa3dKQnOYEp4UbYzDjK57rZX652mnZ82TQfk/juxf7v+jV5aRdNLZVbA==
|
||||
|
||||
xterm-addon-unicode11@0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.5.0.tgz#41c0d96acc1e3bb6c6596eee64e163b6bca74be7"
|
||||
integrity sha512-Jm4/g4QiTxiKiTbYICQgC791ubhIZyoIwxAIgOW8z8HWFNY+lwk+dwaKEaEeGBfM48Vk8fklsUW9u/PlenYEBg==
|
||||
|
||||
xterm-addon-webgl@0.16.0-beta.1:
|
||||
version "0.16.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0-beta.1.tgz#e2b41c6b5f838724a5cb3cfa4231e2d1b8f3f130"
|
||||
integrity sha512-iJK+Uk+23Mh84BNa/44JqAdPESdNKN0ONfw6UztmDk2HTvsy47sU+d/lgF2kOcuI3ew2tRzK9YlupOUhVPwe9g==
|
||||
xterm-addon-webgl@0.16.0-beta.2:
|
||||
version "0.16.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0-beta.2.tgz#30489ef235405255ee54077002c90553531870d8"
|
||||
integrity sha512-DAt4E/QI1w34ToBhcDj0vaZOAHOO+ffwMt2HGDAB7amPXRcMb0LBIjLpyZhB9sD4tbIgsE0vuqZi1R9vKxZwbg==
|
||||
|
||||
xterm@5.3.0-beta.1:
|
||||
version "5.3.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.1.tgz#68e76f2818965592c60bb269360f1fc37219f4ae"
|
||||
integrity sha512-2v/Qmk1A0wO5oouRWUWZ3wxqtfFjxsQbZ1sWxPGJTQvoTSdkORLG44gxrU+Sk2jB5Ojz+3Kg42bnfFghsXVzlw==
|
||||
xterm@5.3.0-beta.3:
|
||||
version "5.3.0-beta.3"
|
||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.3.tgz#1a1aaf9a57afe4dcf86e87d8dc85e80a41d68644"
|
||||
integrity sha512-NGxpV25U2W/KKk6M5V2OXuLgrKY+w05ABi66ZEYuCTi7ux1Qv0z+jm7bkgzk1pGGiTVLG+90OGr2nrhbFr5Y4w==
|
||||
|
|
|
@ -836,45 +836,45 @@ wrappy@1:
|
|||
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
|
||||
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
|
||||
|
||||
xterm-addon-canvas@0.5.0-beta.1:
|
||||
version "0.5.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0-beta.1.tgz#b5ae185741423715460a66029c944b4dededfab0"
|
||||
integrity sha512-A7yjIpyTcOh8ckPJw1YFDvwbTbQ+grM+kTtutOvu5LjLSV9EoCHX17kVoiT2V29ywF7KJMeLYwfBwyFE3uA3QQ==
|
||||
xterm-addon-canvas@0.5.0-beta.2:
|
||||
version "0.5.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0-beta.2.tgz#1b83c2a9a306766c47a4f80b8c65cc9ee5f5a5c4"
|
||||
integrity sha512-oTb/2krdbHYGxH2X6yiBZzAB/1WB+apUu4nXHdhBnht20bl8E+YVWqg95D4o0Gl+QJI+XOfB3mqmWaBx1x531A==
|
||||
|
||||
xterm-addon-image@0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.4.1.tgz#ec8f750af48005ad641c1128fa1f551ac198472a"
|
||||
integrity sha512-iJpYyvtbHg4oXSv+D6J73ZfCjnboZpbZ567MLplXDBlYSUknv3kvPTfVMPJATV7Zsx7+bDgyXboCh9vsDf/m/w==
|
||||
|
||||
xterm-addon-search@0.13.0-beta.1:
|
||||
version "0.13.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.13.0-beta.1.tgz#9fb6ede402d4c369d59d5d6faefe54a05b125bcf"
|
||||
integrity sha512-rdOIhwkfRASqTriUO8QP9UY0p6BosLMv1NXTZqhgq3/5xAXx4VZg6mlQjTRGnUz/GJIN1jU9e/Vp20SpocP/Hw==
|
||||
xterm-addon-search@0.13.0-beta.2:
|
||||
version "0.13.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.13.0-beta.2.tgz#c984a35312acad4ce768d17bc49adffa90eece61"
|
||||
integrity sha512-+VoPhIRmfiX2uh2t6xD/RJtBYjVjrkNa3dKQnOYEp4UbYzDjK57rZX652mnZ82TQfk/juxf7v+jV5aRdNLZVbA==
|
||||
|
||||
xterm-addon-serialize@0.11.0-beta.1:
|
||||
version "0.11.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-serialize/-/xterm-addon-serialize-0.11.0-beta.1.tgz#a4bc1ef5d8b8db0180c07f071ce543536d806db1"
|
||||
integrity sha512-2I9Dq49nXUc6ymznwJp8SUsDq5owUdYviUy11HzLh35baDjzbG31CCu5Gs8KSlfUxpNRr3BxaV5/hx7MRPu7Qg==
|
||||
xterm-addon-serialize@0.11.0-beta.2:
|
||||
version "0.11.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-serialize/-/xterm-addon-serialize-0.11.0-beta.2.tgz#fff924decfbf1bc08434317894f985fef7bb260b"
|
||||
integrity sha512-tN4IT2e+EIpsoFpMONUh1OAuoVAcV7AYOLsqMKgH6GNWB1D/LKGo3cwjpw1vwRZzDJJcCcLxYgxlUzhPbDbLxQ==
|
||||
|
||||
xterm-addon-unicode11@0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.5.0.tgz#41c0d96acc1e3bb6c6596eee64e163b6bca74be7"
|
||||
integrity sha512-Jm4/g4QiTxiKiTbYICQgC791ubhIZyoIwxAIgOW8z8HWFNY+lwk+dwaKEaEeGBfM48Vk8fklsUW9u/PlenYEBg==
|
||||
|
||||
xterm-addon-webgl@0.16.0-beta.1:
|
||||
version "0.16.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0-beta.1.tgz#e2b41c6b5f838724a5cb3cfa4231e2d1b8f3f130"
|
||||
integrity sha512-iJK+Uk+23Mh84BNa/44JqAdPESdNKN0ONfw6UztmDk2HTvsy47sU+d/lgF2kOcuI3ew2tRzK9YlupOUhVPwe9g==
|
||||
xterm-addon-webgl@0.16.0-beta.2:
|
||||
version "0.16.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0-beta.2.tgz#30489ef235405255ee54077002c90553531870d8"
|
||||
integrity sha512-DAt4E/QI1w34ToBhcDj0vaZOAHOO+ffwMt2HGDAB7amPXRcMb0LBIjLpyZhB9sD4tbIgsE0vuqZi1R9vKxZwbg==
|
||||
|
||||
xterm-headless@5.3.0-beta.1:
|
||||
version "5.3.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.3.0-beta.1.tgz#8c7db703b9f57496c2f052411721c00909b08e8b"
|
||||
integrity sha512-6rsv6l44hLL9Eg2UrfAbCiZcAucdHuPyIsovl2BEmluo4chwd4LD7VINRlPV/x8ML2HgD9SohFyNs5BQAc07Gg==
|
||||
xterm-headless@5.3.0-beta.3:
|
||||
version "5.3.0-beta.3"
|
||||
resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.3.0-beta.3.tgz#153cf330082f4b2aae64ff736ef0b62d93c30da8"
|
||||
integrity sha512-4i/bpFoAn4D4ZA4g8RKrJdhq2EcB1HN2E25yUg3omRbWCOZ2Gp9nAn+62LYzX5rvGqdNbpUTRJLX0lKwEFyLFw==
|
||||
|
||||
xterm@5.3.0-beta.1:
|
||||
version "5.3.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.1.tgz#68e76f2818965592c60bb269360f1fc37219f4ae"
|
||||
integrity sha512-2v/Qmk1A0wO5oouRWUWZ3wxqtfFjxsQbZ1sWxPGJTQvoTSdkORLG44gxrU+Sk2jB5Ojz+3Kg42bnfFghsXVzlw==
|
||||
xterm@5.3.0-beta.3:
|
||||
version "5.3.0-beta.3"
|
||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.3.tgz#1a1aaf9a57afe4dcf86e87d8dc85e80a41d68644"
|
||||
integrity sha512-NGxpV25U2W/KKk6M5V2OXuLgrKY+w05ABi66ZEYuCTi7ux1Qv0z+jm7bkgzk1pGGiTVLG+90OGr2nrhbFr5Y4w==
|
||||
|
||||
yallist@^4.0.0:
|
||||
version "4.0.0"
|
||||
|
|
|
@ -230,7 +230,6 @@ export interface ITerminalService extends ITerminalInstanceHost {
|
|||
|
||||
resolveLocation(location?: ITerminalLocationOptions): TerminalLocation | undefined;
|
||||
setNativeDelegate(nativeCalls: ITerminalServiceNativeDelegate): void;
|
||||
toggleEscapeSequenceLogging(): Promise<void>;
|
||||
|
||||
getEditingTerminal(): ITerminalInstance | undefined;
|
||||
setEditingTerminal(instance: ITerminalInstance | undefined): void;
|
||||
|
@ -240,8 +239,6 @@ export class TerminalLinkQuickPickEvent extends MouseEvent {
|
|||
}
|
||||
export interface ITerminalServiceNativeDelegate {
|
||||
getWindowCount(): Promise<number>;
|
||||
openDevTools(): Promise<void>;
|
||||
toggleDevTools(): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -857,11 +854,6 @@ export interface ITerminalInstance {
|
|||
*/
|
||||
toggleSizeToContentWidth(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Toggles escape sequence logging in the devtools console.
|
||||
*/
|
||||
toggleEscapeSequenceLogging(): Promise<boolean>;
|
||||
|
||||
/**
|
||||
* Sets whether escape seqeunce logging is enabled in the devtools console.
|
||||
*/
|
||||
|
|
|
@ -928,13 +928,6 @@ export function registerTerminalActions() {
|
|||
}
|
||||
});
|
||||
|
||||
registerTerminalAction({
|
||||
id: TerminalCommandId.ToggleEscapeSequenceLogging,
|
||||
title: { value: localize('workbench.action.terminal.toggleEscapeSequenceLogging', "Toggle Escape Sequence Logging"), original: 'Toggle Escape Sequence Logging' },
|
||||
precondition: ContextKeyExpr.or(TerminalContextKeys.processSupported, TerminalContextKeys.terminalHasBeenCreated),
|
||||
run: (c) => c.service.toggleEscapeSequenceLogging()
|
||||
});
|
||||
|
||||
registerTerminalAction({
|
||||
id: TerminalCommandId.SendSequence,
|
||||
title: terminalStrings.sendSequence,
|
||||
|
|
|
@ -2110,12 +2110,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
|
|||
this.statusList.add(info.getStatus({ workspaceFolder }));
|
||||
}
|
||||
|
||||
async toggleEscapeSequenceLogging(): Promise<boolean> {
|
||||
const xterm = await this._xtermReadyPromise;
|
||||
xterm.raw.options.logLevel = xterm.raw.options.logLevel === 'debug' ? 'info' : 'debug';
|
||||
return xterm.raw.options.logLevel === 'debug';
|
||||
}
|
||||
|
||||
async getInitialCwd(): Promise<string> {
|
||||
if (!this._initialCwd) {
|
||||
this._initialCwd = this._processManager.initialCwd;
|
||||
|
|
|
@ -477,17 +477,6 @@ export class TerminalService implements ITerminalService {
|
|||
return reconnectCounter;
|
||||
}
|
||||
|
||||
async toggleEscapeSequenceLogging(): Promise<void> {
|
||||
if (this.instances.length === 0) {
|
||||
return;
|
||||
}
|
||||
this._escapeSequenceLoggingEnabled = await this.instances[0].toggleEscapeSequenceLogging();
|
||||
for (let i = 1; i < this.instances.length; i++) {
|
||||
this.instances[i].setEscapeSequenceLogging(this._escapeSequenceLoggingEnabled);
|
||||
}
|
||||
await this._toggleDevTools(this._escapeSequenceLoggingEnabled);
|
||||
}
|
||||
|
||||
private _attachProcessLayoutListeners(): void {
|
||||
this.onDidChangeActiveGroup(() => this._saveState());
|
||||
this.onDidChangeActiveInstance(() => this._saveState());
|
||||
|
@ -621,14 +610,6 @@ export class TerminalService implements ITerminalService {
|
|||
this._nativeDelegate = nativeDelegate;
|
||||
}
|
||||
|
||||
private async _toggleDevTools(open?: boolean): Promise<void> {
|
||||
if (open) {
|
||||
this._nativeDelegate?.openDevTools();
|
||||
} else {
|
||||
this._nativeDelegate?.toggleDevTools();
|
||||
}
|
||||
}
|
||||
|
||||
private _shouldReviveProcesses(reason: ShutdownReason): boolean {
|
||||
if (!this._configHelper.config.enablePersistentSessions) {
|
||||
return false;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import type { IBuffer, ITheme, Terminal as RawXtermTerminal } from 'xterm';
|
||||
import type { IBuffer, ITheme, Terminal as RawXtermTerminal, LogLevel as XtermLogLevel } from 'xterm';
|
||||
import type { CanvasAddon as CanvasAddonType } from 'xterm-addon-canvas';
|
||||
import type { ISearchOptions, SearchAddon as SearchAddonType } from 'xterm-addon-search';
|
||||
import type { Unicode11Addon as Unicode11AddonType } from 'xterm-addon-unicode11';
|
||||
|
@ -20,7 +20,7 @@ import { IShellIntegration, TerminalSettingId } from 'vs/platform/terminal/commo
|
|||
import { ITerminalFont } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { isSafari } from 'vs/base/browser/browser';
|
||||
import { IMarkTracker, IInternalXtermTerminal, IXtermTerminal, ISuggestController, IXtermColorProvider, XtermTerminalConstants, IXtermAttachToElementOptions, IDetachedXtermTerminal } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { ILogger, ILoggerService, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
import { TerminalStorageKeys } from 'vs/workbench/contrib/terminal/common/terminalStorageKeys';
|
||||
import { INotificationService, IPromptChoice, Severity } from 'vs/platform/notification/common/notification';
|
||||
|
@ -114,16 +114,6 @@ function getFullBufferLineAsString(lineIndex: number, buffer: IBuffer): { lineDa
|
|||
export class XtermTerminal extends DisposableStore implements IXtermTerminal, IDetachedXtermTerminal, IInternalXtermTerminal {
|
||||
/** The raw xterm.js instance */
|
||||
readonly raw: RawXtermTerminal;
|
||||
|
||||
*getBufferReverseIterator(): IterableIterator<string> {
|
||||
for (let i = this.raw.buffer.active.length; i >= 0; i--) {
|
||||
const { lineData, lineIndex } = getFullBufferLineAsString(i, this.raw.buffer.active);
|
||||
if (lineData) {
|
||||
i = lineIndex;
|
||||
yield lineData;
|
||||
}
|
||||
}
|
||||
}
|
||||
private _core: IXtermCore;
|
||||
private static _suggestedRendererType: 'canvas' | 'dom' | undefined = undefined;
|
||||
private _attached?: { container: HTMLElement; options: IXtermAttachToElementOptions };
|
||||
|
@ -131,23 +121,25 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID
|
|||
// Always on addons
|
||||
private _markNavigationAddon: MarkNavigationAddon;
|
||||
private _shellIntegrationAddon: ShellIntegrationAddon;
|
||||
|
||||
private _decorationAddon: DecorationAddon;
|
||||
private _suggestAddon?: SuggestAddon;
|
||||
|
||||
// Optional addons
|
||||
private _suggestAddon?: SuggestAddon;
|
||||
private _canvasAddon?: CanvasAddonType;
|
||||
private _searchAddon?: SearchAddonType;
|
||||
private _unicode11Addon?: Unicode11AddonType;
|
||||
private _webglAddon?: WebglAddonType;
|
||||
private _serializeAddon?: SerializeAddonType;
|
||||
private _imageAddon?: ImageAddonType;
|
||||
|
||||
private readonly _logger: ILogger;
|
||||
private readonly _attachedDisposables = this.add(new DisposableStore());
|
||||
private readonly _anyTerminalFocusContextKey: IContextKey<boolean>;
|
||||
private readonly _anyFocusedTerminalHasSelection: IContextKey<boolean>;
|
||||
|
||||
private _lastFindResult: { resultIndex: number; resultCount: number } | undefined;
|
||||
get findResult(): { resultIndex: number; resultCount: number } | undefined { return this._lastFindResult; }
|
||||
|
||||
get isStdinDisabled(): boolean { return !!this.raw.options.disableStdin; }
|
||||
|
||||
private readonly _onDidRequestRunCommand = new Emitter<{ command: ITerminalCommand; copyAsHtml?: boolean; noNewLine?: boolean }>();
|
||||
|
@ -199,7 +191,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID
|
|||
disableShellIntegrationReporting: boolean,
|
||||
@IConfigurationService private readonly _configurationService: IConfigurationService,
|
||||
@IInstantiationService private readonly _instantiationService: IInstantiationService,
|
||||
@ILogService private readonly _logService: ILogService,
|
||||
@ILoggerService private readonly _loggerService: ILoggerService,
|
||||
@INotificationService private readonly _notificationService: INotificationService,
|
||||
@IStorageService private readonly _storageService: IStorageService,
|
||||
@IThemeService private readonly _themeService: IThemeService,
|
||||
|
@ -212,6 +204,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID
|
|||
const config = this._configHelper.config;
|
||||
const editorOptions = this._configurationService.getValue<IEditorOptions>('editor');
|
||||
|
||||
this._logger = this._loggerService.createLogger('terminal', { name: localize('terminalLoggerName', 'Terminal') });
|
||||
this.raw = this.add(new xtermCtor({
|
||||
allowProposedApi: true,
|
||||
cols,
|
||||
|
@ -226,6 +219,8 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID
|
|||
fontSize: font.fontSize,
|
||||
letterSpacing: font.letterSpacing,
|
||||
lineHeight: font.lineHeight,
|
||||
logLevel: vscodeToXtermLogLevel(this._logger.getLevel()),
|
||||
logger: this._logger,
|
||||
minimumContrastRatio: config.minimumContrastRatio,
|
||||
tabStopWidth: config.tabStopWidth,
|
||||
cursorBlink: config.cursorBlinking,
|
||||
|
@ -256,6 +251,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID
|
|||
}));
|
||||
|
||||
this.add(this._themeService.onDidColorThemeChange(theme => this._updateTheme(theme)));
|
||||
this.add(this._logger.onDidChangeLogLevel(e => this.raw.options.logLevel = vscodeToXtermLogLevel(e)));
|
||||
|
||||
// Refire events
|
||||
this.add(this.raw.onSelectionChange(() => {
|
||||
|
@ -291,6 +287,16 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID
|
|||
}
|
||||
}
|
||||
|
||||
*getBufferReverseIterator(): IterableIterator<string> {
|
||||
for (let i = this.raw.buffer.active.length; i >= 0; i--) {
|
||||
const { lineData, lineIndex } = getFullBufferLineAsString(i, this.raw.buffer.active);
|
||||
if (lineData) {
|
||||
i = lineIndex;
|
||||
yield lineData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async getContentsAsHtml(): Promise<string> {
|
||||
if (!this._serializeAddon) {
|
||||
const Addon = await this._getSerializeAddonConstructor();
|
||||
|
@ -630,9 +636,9 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID
|
|||
this._disposeOfCanvasRenderer();
|
||||
try {
|
||||
this.raw.loadAddon(this._webglAddon);
|
||||
this._logService.trace('Webgl was loaded');
|
||||
this._logger.trace('Webgl was loaded');
|
||||
this._webglAddon.onContextLoss(() => {
|
||||
this._logService.info(`Webgl lost context, disposing of webgl renderer`);
|
||||
this._logger.info(`Webgl lost context, disposing of webgl renderer`);
|
||||
this._disposeOfWebglRenderer();
|
||||
});
|
||||
// Uncomment to add the texture atlas to the DOM
|
||||
|
@ -642,7 +648,7 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID
|
|||
// }
|
||||
// }, 5000);
|
||||
} catch (e) {
|
||||
this._logService.warn(`Webgl could not be loaded. Falling back to the canvas renderer type.`, e);
|
||||
this._logger.warn(`Webgl could not be loaded. Falling back to the canvas renderer type.`, e);
|
||||
const neverMeasureRenderTime = this._storageService.getBoolean(TerminalStorageKeys.NeverMeasureRenderTime, StorageScope.APPLICATION, false);
|
||||
// if it's already set to dom, no need to measure render time
|
||||
if (!neverMeasureRenderTime && this._configHelper.config.gpuAcceleration !== 'off') {
|
||||
|
@ -663,9 +669,9 @@ export class XtermTerminal extends DisposableStore implements IXtermTerminal, ID
|
|||
this._disposeOfWebglRenderer();
|
||||
try {
|
||||
this.raw.loadAddon(this._canvasAddon);
|
||||
this._logService.trace('Canvas renderer was loaded');
|
||||
this._logger.trace('Canvas renderer was loaded');
|
||||
} catch (e) {
|
||||
this._logService.warn(`Canvas renderer could not be loaded, falling back to dom renderer`, e);
|
||||
this._logger.warn(`Canvas renderer could not be loaded, falling back to dom renderer`, e);
|
||||
const neverMeasureRenderTime = this._storageService.getBoolean(TerminalStorageKeys.NeverMeasureRenderTime, StorageScope.APPLICATION, false);
|
||||
// if it's already set to dom, no need to measure render time
|
||||
if (!neverMeasureRenderTime && this._configHelper.config.gpuAcceleration !== 'off') {
|
||||
|
@ -900,3 +906,14 @@ export function getXtermScaledDimensions(font: ITerminalFont, width: number, hei
|
|||
|
||||
return { rows, cols };
|
||||
}
|
||||
|
||||
function vscodeToXtermLogLevel(logLevel: LogLevel): XtermLogLevel {
|
||||
switch (logLevel) {
|
||||
case LogLevel.Trace:
|
||||
case LogLevel.Debug: return 'debug';
|
||||
case LogLevel.Info: return 'info';
|
||||
case LogLevel.Warning: return 'warn';
|
||||
case LogLevel.Error: return 'error';
|
||||
default: return 'off';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -576,7 +576,6 @@ export const enum TerminalCommandId {
|
|||
SelectToNextCommand = 'workbench.action.terminal.selectToNextCommand',
|
||||
SelectToPreviousLine = 'workbench.action.terminal.selectToPreviousLine',
|
||||
SelectToNextLine = 'workbench.action.terminal.selectToNextLine',
|
||||
ToggleEscapeSequenceLogging = 'toggleEscapeSequenceLogging',
|
||||
SendSequence = 'workbench.action.terminal.sendSequence',
|
||||
ToggleFindRegex = 'workbench.action.terminal.toggleFindRegex',
|
||||
ToggleFindWholeWord = 'workbench.action.terminal.toggleFindWholeWord',
|
||||
|
|
|
@ -29,9 +29,7 @@ export class TerminalNativeContribution extends Disposable implements IWorkbench
|
|||
this._register(nativeHostService.onDidResumeOS(() => this._onOsResume()));
|
||||
|
||||
this._terminalService.setNativeDelegate({
|
||||
getWindowCount: () => nativeHostService.getWindowCount(),
|
||||
openDevTools: () => nativeHostService.openDevTools(),
|
||||
toggleDevTools: () => nativeHostService.toggleDevTools()
|
||||
getWindowCount: () => nativeHostService.getWindowCount()
|
||||
});
|
||||
|
||||
const connection = remoteAgentService.getConnection();
|
||||
|
|
48
yarn.lock
48
yarn.lock
|
@ -10453,45 +10453,45 @@ xtend@~2.1.1:
|
|||
dependencies:
|
||||
object-keys "~0.4.0"
|
||||
|
||||
xterm-addon-canvas@0.5.0-beta.1:
|
||||
version "0.5.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0-beta.1.tgz#b5ae185741423715460a66029c944b4dededfab0"
|
||||
integrity sha512-A7yjIpyTcOh8ckPJw1YFDvwbTbQ+grM+kTtutOvu5LjLSV9EoCHX17kVoiT2V29ywF7KJMeLYwfBwyFE3uA3QQ==
|
||||
xterm-addon-canvas@0.5.0-beta.2:
|
||||
version "0.5.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-canvas/-/xterm-addon-canvas-0.5.0-beta.2.tgz#1b83c2a9a306766c47a4f80b8c65cc9ee5f5a5c4"
|
||||
integrity sha512-oTb/2krdbHYGxH2X6yiBZzAB/1WB+apUu4nXHdhBnht20bl8E+YVWqg95D4o0Gl+QJI+XOfB3mqmWaBx1x531A==
|
||||
|
||||
xterm-addon-image@0.4.1:
|
||||
version "0.4.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-image/-/xterm-addon-image-0.4.1.tgz#ec8f750af48005ad641c1128fa1f551ac198472a"
|
||||
integrity sha512-iJpYyvtbHg4oXSv+D6J73ZfCjnboZpbZ567MLplXDBlYSUknv3kvPTfVMPJATV7Zsx7+bDgyXboCh9vsDf/m/w==
|
||||
|
||||
xterm-addon-search@0.13.0-beta.1:
|
||||
version "0.13.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.13.0-beta.1.tgz#9fb6ede402d4c369d59d5d6faefe54a05b125bcf"
|
||||
integrity sha512-rdOIhwkfRASqTriUO8QP9UY0p6BosLMv1NXTZqhgq3/5xAXx4VZg6mlQjTRGnUz/GJIN1jU9e/Vp20SpocP/Hw==
|
||||
xterm-addon-search@0.13.0-beta.2:
|
||||
version "0.13.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-search/-/xterm-addon-search-0.13.0-beta.2.tgz#c984a35312acad4ce768d17bc49adffa90eece61"
|
||||
integrity sha512-+VoPhIRmfiX2uh2t6xD/RJtBYjVjrkNa3dKQnOYEp4UbYzDjK57rZX652mnZ82TQfk/juxf7v+jV5aRdNLZVbA==
|
||||
|
||||
xterm-addon-serialize@0.11.0-beta.1:
|
||||
version "0.11.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-serialize/-/xterm-addon-serialize-0.11.0-beta.1.tgz#a4bc1ef5d8b8db0180c07f071ce543536d806db1"
|
||||
integrity sha512-2I9Dq49nXUc6ymznwJp8SUsDq5owUdYviUy11HzLh35baDjzbG31CCu5Gs8KSlfUxpNRr3BxaV5/hx7MRPu7Qg==
|
||||
xterm-addon-serialize@0.11.0-beta.2:
|
||||
version "0.11.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-serialize/-/xterm-addon-serialize-0.11.0-beta.2.tgz#fff924decfbf1bc08434317894f985fef7bb260b"
|
||||
integrity sha512-tN4IT2e+EIpsoFpMONUh1OAuoVAcV7AYOLsqMKgH6GNWB1D/LKGo3cwjpw1vwRZzDJJcCcLxYgxlUzhPbDbLxQ==
|
||||
|
||||
xterm-addon-unicode11@0.5.0:
|
||||
version "0.5.0"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-unicode11/-/xterm-addon-unicode11-0.5.0.tgz#41c0d96acc1e3bb6c6596eee64e163b6bca74be7"
|
||||
integrity sha512-Jm4/g4QiTxiKiTbYICQgC791ubhIZyoIwxAIgOW8z8HWFNY+lwk+dwaKEaEeGBfM48Vk8fklsUW9u/PlenYEBg==
|
||||
|
||||
xterm-addon-webgl@0.16.0-beta.1:
|
||||
version "0.16.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0-beta.1.tgz#e2b41c6b5f838724a5cb3cfa4231e2d1b8f3f130"
|
||||
integrity sha512-iJK+Uk+23Mh84BNa/44JqAdPESdNKN0ONfw6UztmDk2HTvsy47sU+d/lgF2kOcuI3ew2tRzK9YlupOUhVPwe9g==
|
||||
xterm-addon-webgl@0.16.0-beta.2:
|
||||
version "0.16.0-beta.2"
|
||||
resolved "https://registry.yarnpkg.com/xterm-addon-webgl/-/xterm-addon-webgl-0.16.0-beta.2.tgz#30489ef235405255ee54077002c90553531870d8"
|
||||
integrity sha512-DAt4E/QI1w34ToBhcDj0vaZOAHOO+ffwMt2HGDAB7amPXRcMb0LBIjLpyZhB9sD4tbIgsE0vuqZi1R9vKxZwbg==
|
||||
|
||||
xterm-headless@5.3.0-beta.1:
|
||||
version "5.3.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.3.0-beta.1.tgz#8c7db703b9f57496c2f052411721c00909b08e8b"
|
||||
integrity sha512-6rsv6l44hLL9Eg2UrfAbCiZcAucdHuPyIsovl2BEmluo4chwd4LD7VINRlPV/x8ML2HgD9SohFyNs5BQAc07Gg==
|
||||
xterm-headless@5.3.0-beta.3:
|
||||
version "5.3.0-beta.3"
|
||||
resolved "https://registry.yarnpkg.com/xterm-headless/-/xterm-headless-5.3.0-beta.3.tgz#153cf330082f4b2aae64ff736ef0b62d93c30da8"
|
||||
integrity sha512-4i/bpFoAn4D4ZA4g8RKrJdhq2EcB1HN2E25yUg3omRbWCOZ2Gp9nAn+62LYzX5rvGqdNbpUTRJLX0lKwEFyLFw==
|
||||
|
||||
xterm@5.3.0-beta.1:
|
||||
version "5.3.0-beta.1"
|
||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.1.tgz#68e76f2818965592c60bb269360f1fc37219f4ae"
|
||||
integrity sha512-2v/Qmk1A0wO5oouRWUWZ3wxqtfFjxsQbZ1sWxPGJTQvoTSdkORLG44gxrU+Sk2jB5Ojz+3Kg42bnfFghsXVzlw==
|
||||
xterm@5.3.0-beta.3:
|
||||
version "5.3.0-beta.3"
|
||||
resolved "https://registry.yarnpkg.com/xterm/-/xterm-5.3.0-beta.3.tgz#1a1aaf9a57afe4dcf86e87d8dc85e80a41d68644"
|
||||
integrity sha512-NGxpV25U2W/KKk6M5V2OXuLgrKY+w05ABi66ZEYuCTi7ux1Qv0z+jm7bkgzk1pGGiTVLG+90OGr2nrhbFr5Y4w==
|
||||
|
||||
y18n@^3.2.1:
|
||||
version "3.2.2"
|
||||
|
|
Loading…
Reference in a new issue