@codingame/monaco-vscode-xterm-common 31.0.1 → 32.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +154 -90
- package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.js +4 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +9 -9
- package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +82 -19
- package/vscode/src/vs/platform/agentHost/common/state/sessionState.js +5 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.d.ts +12 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.js +52 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.js +55 -10
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +61 -61
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +42 -38
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +15 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +3 -3
- package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +0 -1418
- package/vscode/src/vs/platform/agentHost/common/state/protocol/state.js +0 -118
|
@@ -80,7 +80,7 @@ import { getTerminalUri, getTerminalResourcesFromDragEvent } from '@codingame/mo
|
|
|
80
80
|
import { TerminalWidgetManager } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/widgets/widgetManager';
|
|
81
81
|
import { LineDataEventAddon } from './xterm/lineDataEventAddon.js';
|
|
82
82
|
import { getXtermScaledDimensions, XtermTerminal } from '@codingame/monaco-vscode-xterm-addons-common/vscode/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal';
|
|
83
|
-
import { ProcessState, TERMINAL_VIEW_ID, TerminalCommandId
|
|
83
|
+
import { ProcessState, TERMINAL_VIEW_ID, TerminalCommandId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal';
|
|
84
84
|
import { ITerminalProfileResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal.service';
|
|
85
85
|
import { TERMINAL_BACKGROUND_COLOR } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminalColorRegistry';
|
|
86
86
|
import { TerminalContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminalContextKey';
|
|
@@ -453,7 +453,6 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
453
453
|
this._wrapperElement = createElement("div");
|
|
454
454
|
this._wrapperElement.classList.add("terminal-wrapper");
|
|
455
455
|
this._widgetManager = this._register(instantiationService.createInstance(TerminalWidgetManager));
|
|
456
|
-
this._skipTerminalCommands = [];
|
|
457
456
|
this._isExiting = false;
|
|
458
457
|
this._hadFocusOnExit = false;
|
|
459
458
|
this._isVisible = false;
|
|
@@ -775,13 +774,13 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
775
774
|
}
|
|
776
775
|
xtermConstructor = Promises.withAsyncBody(async resolve => {
|
|
777
776
|
const Terminal = (await import('@xterm/xterm')).Terminal;
|
|
778
|
-
Terminal.strings.promptLabel = ( localize(
|
|
777
|
+
Terminal.strings.promptLabel = ( localize(13844, "Terminal input"));
|
|
779
778
|
Terminal.strings.tooMuchOutput = keybinding ? ( localize(
|
|
780
|
-
|
|
779
|
+
13845,
|
|
781
780
|
"Use the accessible buffer {0} to manually review output",
|
|
782
781
|
keybinding.getLabel()
|
|
783
782
|
)) : ( localize(
|
|
784
|
-
|
|
783
|
+
13846,
|
|
785
784
|
"Use the Terminal: Focus Accessible Buffer command to manually review output"
|
|
786
785
|
));
|
|
787
786
|
resolve(Terminal);
|
|
@@ -804,12 +803,21 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
804
803
|
}, this.onDidExecuteText);
|
|
805
804
|
this.xterm = xterm;
|
|
806
805
|
this._resizeDebouncer = this._register(( new TerminalResizeDebouncer(() => this._isVisible, () => xterm, async (cols, rows) => {
|
|
806
|
+
if (this.isDisposed) {
|
|
807
|
+
return;
|
|
808
|
+
}
|
|
807
809
|
xterm.resize(cols, rows);
|
|
808
810
|
await this._updatePtyDimensions(xterm.raw);
|
|
809
811
|
}, async cols => {
|
|
812
|
+
if (this.isDisposed) {
|
|
813
|
+
return;
|
|
814
|
+
}
|
|
810
815
|
xterm.resize(cols, xterm.raw.rows);
|
|
811
816
|
await this._updatePtyDimensions(xterm.raw);
|
|
812
817
|
}, async rows => {
|
|
818
|
+
if (this.isDisposed) {
|
|
819
|
+
return;
|
|
820
|
+
}
|
|
813
821
|
xterm.resize(xterm.raw.cols, rows);
|
|
814
822
|
await this._updatePtyDimensions(xterm.raw);
|
|
815
823
|
})));
|
|
@@ -834,7 +842,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
834
842
|
id: TerminalStatus.Bell,
|
|
835
843
|
severity: Severity.Warning,
|
|
836
844
|
icon: Codicon.bell,
|
|
837
|
-
tooltip: ( localize(
|
|
845
|
+
tooltip: ( localize(13847, "Bell"))
|
|
838
846
|
}, this._terminalConfigurationService.config.bellDuration);
|
|
839
847
|
}
|
|
840
848
|
this._accessibilitySignalService.playSignal(AccessibilitySignal.terminalBell);
|
|
@@ -912,7 +920,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
912
920
|
if (!instance.xterm) {
|
|
913
921
|
return;
|
|
914
922
|
}
|
|
915
|
-
const cmdDetectionType = (instance.capabilities.get(TerminalCapability.CommandDetection)?.hasRichCommandDetection ? ( localize(
|
|
923
|
+
const cmdDetectionType = (instance.capabilities.get(TerminalCapability.CommandDetection)?.hasRichCommandDetection ? ( localize(13848, "Rich")) : ( instance.capabilities.has(TerminalCapability.CommandDetection)) ? ( localize(13849, "Basic")) : instance.usedShellIntegrationInjection ? ( localize(13850, "Injection failed to activate")) : ( localize(13851, "No")));
|
|
916
924
|
const detailedAdditions = [];
|
|
917
925
|
if (instance.shellType) {
|
|
918
926
|
detailedAdditions.push(`Shell type: \`${instance.shellType}\``);
|
|
@@ -937,8 +945,8 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
937
945
|
instance.statusList.add({
|
|
938
946
|
id: TerminalStatus.ShellIntegrationInfo,
|
|
939
947
|
severity: Severity.Info,
|
|
940
|
-
tooltip: `${( localize(
|
|
941
|
-
detailedTooltip: `${( localize(
|
|
948
|
+
tooltip: `${( localize(13852, "Shell integration"))}: ${cmdDetectionType}`,
|
|
949
|
+
detailedTooltip: `${( localize(13852, "Shell integration"))}: ${cmdDetectionType}${detailedAdditionsString}`
|
|
942
950
|
});
|
|
943
951
|
}
|
|
944
952
|
async runCommand(
|
|
@@ -1056,7 +1064,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1056
1064
|
event.preventDefault();
|
|
1057
1065
|
return false;
|
|
1058
1066
|
}
|
|
1059
|
-
if (!this._terminalConfigurationService.config.sendKeybindingsToShell && resolveResult.kind === ResultKind.KbFound && resolveResult.commandId && (event.metaKey ||
|
|
1067
|
+
if (!this._terminalConfigurationService.config.sendKeybindingsToShell && resolveResult.kind === ResultKind.KbFound && resolveResult.commandId && (event.metaKey || this._terminalConfigurationService.shouldCommandSkipShell(resolveResult.commandId))) {
|
|
1060
1068
|
event.preventDefault();
|
|
1061
1069
|
return false;
|
|
1062
1070
|
}
|
|
@@ -1407,7 +1415,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1407
1415
|
id: TerminalStatus.Disconnected,
|
|
1408
1416
|
severity: Severity.Error,
|
|
1409
1417
|
icon: Codicon.debugDisconnect,
|
|
1410
|
-
tooltip: ( localize(
|
|
1418
|
+
tooltip: ( localize(13853, "Lost connection to process"))
|
|
1411
1419
|
});
|
|
1412
1420
|
}));
|
|
1413
1421
|
this._register(processManager.onPtyReconnect(() => {
|
|
@@ -1425,12 +1433,12 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1425
1433
|
const trusted = await this._trust();
|
|
1426
1434
|
if (!trusted && !this.remoteAuthority && !this._workbenchEnvironmentService.remoteAuthority) {
|
|
1427
1435
|
this._onProcessExit({
|
|
1428
|
-
message: ( localize(
|
|
1436
|
+
message: ( localize(13854, "Cannot launch a terminal process in an untrusted workspace"))
|
|
1429
1437
|
});
|
|
1430
1438
|
} else if (this._workspaceContextService.getWorkspace().folders.length === 0 && this._cwd && this._userHome && normalizeDriveLetter(this._cwd) !== normalizeDriveLetter(this._userHome)) {
|
|
1431
1439
|
this._onProcessExit({
|
|
1432
1440
|
message: ( localize(
|
|
1433
|
-
|
|
1441
|
+
13855,
|
|
1434
1442
|
"Cannot launch a terminal process in an empty workspace with cwd {0} different from userHome {1}",
|
|
1435
1443
|
this._cwd,
|
|
1436
1444
|
this._userHome
|
|
@@ -1543,6 +1551,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1543
1551
|
"processState",
|
|
1544
1552
|
this._processManager.processState
|
|
1545
1553
|
);
|
|
1554
|
+
this._onExit.fire(exitCodeOrError);
|
|
1546
1555
|
const waitOnExit = this.waitOnExit;
|
|
1547
1556
|
if (waitOnExit && this._processManager.processState !== ProcessState.KilledByUser) {
|
|
1548
1557
|
this._xtermReadyPromise.then(xterm => {
|
|
@@ -1588,7 +1597,6 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1588
1597
|
}
|
|
1589
1598
|
this.dispose(TerminalExitReason.Process);
|
|
1590
1599
|
}
|
|
1591
|
-
this._onExit.fire(exitCodeOrError);
|
|
1592
1600
|
if (this.isDisposed) {
|
|
1593
1601
|
this._onExit.dispose();
|
|
1594
1602
|
}
|
|
@@ -1600,10 +1608,10 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1600
1608
|
id: TerminalStatus.ShellIntegrationAttentionNeeded,
|
|
1601
1609
|
severity: Severity.Warning,
|
|
1602
1610
|
icon: Codicon.warning,
|
|
1603
|
-
tooltip: `${exitMessage} ` + ( localize(
|
|
1611
|
+
tooltip: `${exitMessage} ` + ( localize(13856, "Disabling shell integration in user settings might help.")),
|
|
1604
1612
|
hoverActions: [{
|
|
1605
1613
|
commandId: TerminalCommandId.ShellIntegrationLearnMore,
|
|
1606
|
-
label: ( localize(
|
|
1614
|
+
label: ( localize(13857, "Learn more about shell integration")),
|
|
1607
1615
|
run: () => {
|
|
1608
1616
|
this._openerService.open(
|
|
1609
1617
|
"https://code.visualstudio.com/docs/editor/integrated-terminal#_shell-integration"
|
|
@@ -1611,7 +1619,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1611
1619
|
}
|
|
1612
1620
|
}, {
|
|
1613
1621
|
commandId: "workbench.action.openSettings",
|
|
1614
|
-
label: ( localize(
|
|
1622
|
+
label: ( localize(13858, "Open user settings")),
|
|
1615
1623
|
run: () => {
|
|
1616
1624
|
this._commandService.executeCommand(
|
|
1617
1625
|
"workbench.action.openSettings",
|
|
@@ -1745,7 +1753,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1745
1753
|
return true;
|
|
1746
1754
|
}
|
|
1747
1755
|
const trustRequest = await this._workspaceTrustRequestService.requestWorkspaceTrust({
|
|
1748
|
-
message: ( localize(
|
|
1756
|
+
message: ( localize(13859, "Creating a terminal process requires executing code"))
|
|
1749
1757
|
});
|
|
1750
1758
|
return trustRequest === true;
|
|
1751
1759
|
}
|
|
@@ -1766,7 +1774,6 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1766
1774
|
}
|
|
1767
1775
|
}
|
|
1768
1776
|
updateConfig() {
|
|
1769
|
-
this._setCommandsToSkipShell(this._terminalConfigurationService.config.commandsToSkipShell);
|
|
1770
1777
|
this._refreshEnvironmentVariableInfoWidgetState(this._processManager.environmentVariableInfo);
|
|
1771
1778
|
}
|
|
1772
1779
|
async _updateUnicodeVersion() {
|
|
@@ -1775,12 +1782,6 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1775
1782
|
updateAccessibilitySupport() {
|
|
1776
1783
|
this.xterm.raw.options.screenReaderMode = this._accessibilityService.isScreenReaderOptimized();
|
|
1777
1784
|
}
|
|
1778
|
-
_setCommandsToSkipShell(commands) {
|
|
1779
|
-
const excludeCommands = ( commands.filter(command => command[0] === "-").map(command => command.slice(1)));
|
|
1780
|
-
this._skipTerminalCommands = DEFAULT_COMMANDS_TO_SKIP_SHELL.filter(defaultCommand => {
|
|
1781
|
-
return !excludeCommands.includes(defaultCommand);
|
|
1782
|
-
}).concat(commands);
|
|
1783
|
-
}
|
|
1784
1785
|
layout(dimension) {
|
|
1785
1786
|
this._lastLayoutDimensions = dimension;
|
|
1786
1787
|
if (this.disableLayout) {
|
|
@@ -1848,6 +1849,9 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1848
1849
|
this._resizeDebouncer.resize(cols, rows, immediate ?? false);
|
|
1849
1850
|
}
|
|
1850
1851
|
async _updatePtyDimensions(rawXterm) {
|
|
1852
|
+
if (this.isDisposed) {
|
|
1853
|
+
return;
|
|
1854
|
+
}
|
|
1851
1855
|
const pixelWidth = rawXterm.dimensions?.css.canvas.width;
|
|
1852
1856
|
const pixelHeight = rawXterm.dimensions?.css.canvas.height;
|
|
1853
1857
|
const roundedPixelWidth = pixelWidth ? Math.round(pixelWidth) : undefined;
|
|
@@ -1877,21 +1881,21 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1877
1881
|
const labelParts = [];
|
|
1878
1882
|
if (xterm && xterm.textarea) {
|
|
1879
1883
|
if (title && title.length > 0) {
|
|
1880
|
-
labelParts.push(( localize(
|
|
1884
|
+
labelParts.push(( localize(13860, "Terminal {0}, {1}", terminalId, title)));
|
|
1881
1885
|
} else {
|
|
1882
|
-
labelParts.push(( localize(
|
|
1886
|
+
labelParts.push(( localize(13861, "Terminal {0}", terminalId)));
|
|
1883
1887
|
}
|
|
1884
1888
|
const screenReaderOptimized = this._accessibilityService.isScreenReaderOptimized();
|
|
1885
1889
|
if (!screenReaderOptimized) {
|
|
1886
1890
|
labelParts.push(( localize(
|
|
1887
|
-
|
|
1891
|
+
13862,
|
|
1888
1892
|
"Run the command: Toggle Screen Reader Accessibility Mode for an optimized screen reader experience"
|
|
1889
1893
|
)));
|
|
1890
1894
|
}
|
|
1891
1895
|
const accessibilityHelpKeybinding = this._keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibilityHelp)?.getLabel();
|
|
1892
1896
|
if (this._configurationService.getValue(AccessibilityVerbositySettingId.Terminal) && accessibilityHelpKeybinding) {
|
|
1893
1897
|
labelParts.push(( localize(
|
|
1894
|
-
|
|
1898
|
+
13863,
|
|
1895
1899
|
"Use {0} for terminal accessibility help",
|
|
1896
1900
|
accessibilityHelpKeybinding
|
|
1897
1901
|
)));
|
|
@@ -1945,7 +1949,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1945
1949
|
}
|
|
1946
1950
|
async setFixedDimensions() {
|
|
1947
1951
|
const cols = await this._quickInputService.input({
|
|
1948
|
-
title: ( localize(
|
|
1952
|
+
title: ( localize(13864, "Set Fixed Dimensions: Column")),
|
|
1949
1953
|
placeHolder: "Enter a number of columns or leave empty for automatic width",
|
|
1950
1954
|
validateInput: async text => text.length > 0 && !text.match(/^\d+$/) ? {
|
|
1951
1955
|
content: "Enter a number or leave empty size automatically",
|
|
@@ -1959,7 +1963,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1959
1963
|
this._labelComputer?.refreshLabel(this);
|
|
1960
1964
|
this._terminalHasFixedWidth.set(!!this._fixedCols);
|
|
1961
1965
|
const rows = await this._quickInputService.input({
|
|
1962
|
-
title: ( localize(
|
|
1966
|
+
title: ( localize(13865, "Set Fixed Dimensions: Row")),
|
|
1963
1967
|
placeHolder: "Enter a number of rows or leave empty for automatic height",
|
|
1964
1968
|
validateInput: async text => text.length > 0 && !text.match(/^\d+$/) ? {
|
|
1965
1969
|
content: "Enter a number or leave empty size automatically",
|
|
@@ -2069,7 +2073,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
2069
2073
|
_onEnvironmentVariableInfoChanged(info) {
|
|
2070
2074
|
if (info.requiresAction) {
|
|
2071
2075
|
this.xterm?.raw.textarea?.setAttribute("aria-label", ( localize(
|
|
2072
|
-
|
|
2076
|
+
13866,
|
|
2073
2077
|
"Terminal {0} environment is stale, run the 'Show Environment Information' command for more information",
|
|
2074
2078
|
this._instanceId
|
|
2075
2079
|
)));
|
|
@@ -2225,7 +2229,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
2225
2229
|
disposables.push(quickPick);
|
|
2226
2230
|
quickPick.items = items;
|
|
2227
2231
|
quickPick.matchOnDescription = true;
|
|
2228
|
-
quickPick.placeholder = ( localize(
|
|
2232
|
+
quickPick.placeholder = ( localize(13867, "Select a color for the terminal"));
|
|
2229
2233
|
quickPick.show();
|
|
2230
2234
|
const result = await ( new Promise(r => {
|
|
2231
2235
|
disposables.push(quickPick.onDidHide(() => r(undefined)));
|
|
@@ -2562,24 +2566,24 @@ function parseExitResult(exitCodeOrError, shellLaunchConfig, processState, initi
|
|
|
2562
2566
|
if (processState === ProcessState.KilledDuringLaunch) {
|
|
2563
2567
|
if (commandLine) {
|
|
2564
2568
|
message = ( localize(
|
|
2565
|
-
|
|
2569
|
+
13868,
|
|
2566
2570
|
"The terminal process \"{0}\" failed to launch (exit code: {1}).",
|
|
2567
2571
|
commandLine,
|
|
2568
2572
|
code
|
|
2569
2573
|
));
|
|
2570
2574
|
} else {
|
|
2571
|
-
message = ( localize(
|
|
2575
|
+
message = ( localize(13869, "The terminal process failed to launch (exit code: {0}).", code));
|
|
2572
2576
|
}
|
|
2573
2577
|
} else {
|
|
2574
2578
|
if (commandLine) {
|
|
2575
2579
|
message = ( localize(
|
|
2576
|
-
|
|
2580
|
+
13870,
|
|
2577
2581
|
"The terminal process \"{0}\" terminated with exit code: {1}.",
|
|
2578
2582
|
commandLine,
|
|
2579
2583
|
code
|
|
2580
2584
|
));
|
|
2581
2585
|
} else {
|
|
2582
|
-
message = ( localize(
|
|
2586
|
+
message = ( localize(13871, "The terminal process terminated with exit code: {0}.", code));
|
|
2583
2587
|
}
|
|
2584
2588
|
}
|
|
2585
2589
|
break;
|
|
@@ -2605,7 +2609,7 @@ function parseExitResult(exitCodeOrError, shellLaunchConfig, processState, initi
|
|
|
2605
2609
|
break;
|
|
2606
2610
|
}
|
|
2607
2611
|
}
|
|
2608
|
-
message = ( localize(
|
|
2612
|
+
message = ( localize(13872, "The terminal process failed to launch: {0}.", innerMessage));
|
|
2609
2613
|
break;
|
|
2610
2614
|
}
|
|
2611
2615
|
}
|
|
@@ -202,7 +202,7 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
|
|
|
202
202
|
} catch (e) {
|
|
203
203
|
this._notificationService.notify({
|
|
204
204
|
message: ( localize(
|
|
205
|
-
|
|
205
|
+
13903,
|
|
206
206
|
"Could not kill process listening on port {0}, command exited with error {1}",
|
|
207
207
|
port,
|
|
208
208
|
e
|
|
@@ -538,7 +538,7 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
|
|
|
538
538
|
this._onExit(-1);
|
|
539
539
|
} else {
|
|
540
540
|
const message = ( localize(
|
|
541
|
-
|
|
541
|
+
13904,
|
|
542
542
|
"Restarting the terminal because the connection to the shell process was lost..."
|
|
543
543
|
));
|
|
544
544
|
let postRestartMessage = "";
|
|
@@ -28,6 +28,9 @@ class TerminalResizeDebouncer extends Disposable {
|
|
|
28
28
|
this._resizeYJob = this._register(( new MutableDisposable()));
|
|
29
29
|
}
|
|
30
30
|
async resize(cols, rows, immediate) {
|
|
31
|
+
if (this._store.isDisposed) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
31
34
|
this._latestX = cols;
|
|
32
35
|
this._latestY = rows;
|
|
33
36
|
if (immediate || this._getXterm().raw.buffer.normal.length < Constants.StartDebouncingThreshold) {
|
|
@@ -40,12 +43,18 @@ class TerminalResizeDebouncer extends Disposable {
|
|
|
40
43
|
if (win && !this._isVisible()) {
|
|
41
44
|
if (!this._resizeXJob.value) {
|
|
42
45
|
this._resizeXJob.value = runWhenWindowIdle(win, async () => {
|
|
46
|
+
if (this._store.isDisposed) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
43
49
|
this._resizeXCallback(this._latestX);
|
|
44
50
|
this._resizeXJob.clear();
|
|
45
51
|
});
|
|
46
52
|
}
|
|
47
53
|
if (!this._resizeYJob.value) {
|
|
48
54
|
this._resizeYJob.value = runWhenWindowIdle(win, async () => {
|
|
55
|
+
if (this._store.isDisposed) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
49
58
|
this._resizeYCallback(this._latestY);
|
|
50
59
|
this._resizeYJob.clear();
|
|
51
60
|
});
|
|
@@ -57,6 +66,9 @@ class TerminalResizeDebouncer extends Disposable {
|
|
|
57
66
|
this._debounceResizeX(cols);
|
|
58
67
|
}
|
|
59
68
|
flush() {
|
|
69
|
+
if (this._store.isDisposed) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
60
72
|
if (this._resizeXJob.value || this._resizeYJob.value) {
|
|
61
73
|
this._resizeXJob.clear();
|
|
62
74
|
this._resizeYJob.clear();
|
|
@@ -64,6 +76,9 @@ class TerminalResizeDebouncer extends Disposable {
|
|
|
64
76
|
}
|
|
65
77
|
}
|
|
66
78
|
_debounceResizeX(cols) {
|
|
79
|
+
if (this._store.isDisposed) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
67
82
|
this._resizeXCallback(cols);
|
|
68
83
|
}
|
|
69
84
|
}
|
|
@@ -93,8 +93,10 @@ let TerminalTabList = class TerminalTabList extends WorkbenchList {
|
|
|
93
93
|
container,
|
|
94
94
|
instantiationService.createInstance(ResourceLabels, DEFAULT_LABELS_CONTAINER),
|
|
95
95
|
() => this.getSelectedElements(),
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
{
|
|
97
|
+
getHasText: () => this.hasText,
|
|
98
|
+
getHasActionBar: () => this.hasActionBar
|
|
99
|
+
}
|
|
98
100
|
)], {
|
|
99
101
|
horizontalScrolling: false,
|
|
100
102
|
supportDynamicHeights: false,
|
|
@@ -259,8 +261,7 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
259
261
|
_container,
|
|
260
262
|
_labels,
|
|
261
263
|
_getSelection,
|
|
262
|
-
|
|
263
|
-
_getHasActionBar,
|
|
264
|
+
_getVisibilityState,
|
|
264
265
|
_instantiationService,
|
|
265
266
|
_terminalConfigurationService,
|
|
266
267
|
_terminalService,
|
|
@@ -276,8 +277,7 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
276
277
|
) {
|
|
277
278
|
this._labels = _labels;
|
|
278
279
|
this._getSelection = _getSelection;
|
|
279
|
-
this.
|
|
280
|
-
this._getHasActionBar = _getHasActionBar;
|
|
280
|
+
this._getVisibilityState = _getVisibilityState;
|
|
281
281
|
this._instantiationService = _instantiationService;
|
|
282
282
|
this._terminalConfigurationService = _terminalConfigurationService;
|
|
283
283
|
this._terminalService = _terminalService;
|
|
@@ -338,8 +338,8 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
338
338
|
};
|
|
339
339
|
}
|
|
340
340
|
renderElement(instance, index, template) {
|
|
341
|
-
const hasText = this.
|
|
342
|
-
const hasActionBar = this.
|
|
341
|
+
const hasText = this._getVisibilityState.getHasText();
|
|
342
|
+
const hasActionBar = this._getVisibilityState.getHasActionBar();
|
|
343
343
|
const group = this._terminalGroupService.getGroupForInstance(instance);
|
|
344
344
|
if (!group) {
|
|
345
345
|
throw ( new Error(`Could not find group for instance "${instance.instanceId}"`));
|
|
@@ -435,7 +435,7 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
},
|
|
438
|
-
ariaLabel: ( localize(
|
|
438
|
+
ariaLabel: ( localize(13931, "Type terminal name. Press Enter to confirm or Escape to cancel.")),
|
|
439
439
|
inputBoxStyles: defaultInputBoxStyles
|
|
440
440
|
}));
|
|
441
441
|
inputBox.element.style.height = "22px";
|
|
@@ -560,13 +560,13 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
560
560
|
this._listService.lastFocusedList?.focusNext();
|
|
561
561
|
}
|
|
562
562
|
};
|
|
563
|
-
TerminalTabsRenderer = ( __decorate([( __param(
|
|
563
|
+
TerminalTabsRenderer = ( __decorate([( __param(4, IInstantiationService)), ( __param(5, ITerminalConfigurationService)), ( __param(6, ITerminalService)), ( __param(7, ITerminalGroupService)), ( __param(8, ITerminalEditingService)), ( __param(9, IHoverService)), ( __param(10, IKeybindingService)), ( __param(11, IListService)), ( __param(12, IStorageService)), ( __param(13, IThemeService)), ( __param(14, IContextViewService)), ( __param(15, ICommandService))], TerminalTabsRenderer));
|
|
564
564
|
let TerminalTabsAccessibilityProvider = class TerminalTabsAccessibilityProvider {
|
|
565
565
|
constructor(_terminalGroupService) {
|
|
566
566
|
this._terminalGroupService = _terminalGroupService;
|
|
567
567
|
}
|
|
568
568
|
getWidgetAriaLabel() {
|
|
569
|
-
return localize(
|
|
569
|
+
return localize(13932, "Terminal tabs");
|
|
570
570
|
}
|
|
571
571
|
getAriaLabel(instance) {
|
|
572
572
|
let ariaLabel = "";
|
|
@@ -574,7 +574,7 @@ let TerminalTabsAccessibilityProvider = class TerminalTabsAccessibilityProvider
|
|
|
574
574
|
if (tab && tab.terminalInstances?.length > 1) {
|
|
575
575
|
const terminalIndex = tab.terminalInstances.indexOf(instance);
|
|
576
576
|
ariaLabel = ( localize(
|
|
577
|
-
|
|
577
|
+
13933,
|
|
578
578
|
"Terminal {0} {1}, split {2} of {3}",
|
|
579
579
|
instance.instanceId,
|
|
580
580
|
instance.title,
|
|
@@ -582,7 +582,7 @@ let TerminalTabsAccessibilityProvider = class TerminalTabsAccessibilityProvider
|
|
|
582
582
|
tab.terminalInstances.length
|
|
583
583
|
));
|
|
584
584
|
} else {
|
|
585
|
-
ariaLabel = ( localize(
|
|
585
|
+
ariaLabel = ( localize(13934, "Terminal {0} {1}", instance.instanceId, instance.title));
|
|
586
586
|
}
|
|
587
587
|
return ariaLabel;
|
|
588
588
|
}
|
|
@@ -770,7 +770,7 @@ let TabDecorationsProvider = class TabDecorationsProvider extends Disposable {
|
|
|
770
770
|
constructor(_terminalService) {
|
|
771
771
|
super();
|
|
772
772
|
this._terminalService = _terminalService;
|
|
773
|
-
this.label = ( localize(
|
|
773
|
+
this.label = ( localize(13935, "Terminal"));
|
|
774
774
|
this._onDidChange = this._register(( new Emitter()));
|
|
775
775
|
this.onDidChange = this._onDidChange.event;
|
|
776
776
|
this._register(
|
|
@@ -29,7 +29,7 @@ function getInstanceHoverInfo(instance, storageService) {
|
|
|
29
29
|
}
|
|
30
30
|
actions.push({
|
|
31
31
|
commandId: "toggleDetailedInfo",
|
|
32
|
-
label: showDetailed ? ( localize(
|
|
32
|
+
label: showDetailed ? ( localize(13936, "Hide Details")) : ( localize(13937, "Show Details")),
|
|
33
33
|
run() {
|
|
34
34
|
storageService.store(
|
|
35
35
|
TerminalStorageKeys.TabsShowDetailed,
|
|
@@ -51,7 +51,7 @@ function getInstanceHoverInfo(instance, storageService) {
|
|
|
51
51
|
function getShellProcessTooltip(instance, showDetailed) {
|
|
52
52
|
const lines = [];
|
|
53
53
|
if (instance.processId && instance.processId > 0) {
|
|
54
|
-
lines.push(( localize(
|
|
54
|
+
lines.push(( localize(13938, "Process ID ({0}): {1}", "PID", instance.processId)) + "\n");
|
|
55
55
|
}
|
|
56
56
|
if (instance.shellLaunchConfig.executable) {
|
|
57
57
|
let commandLine = "";
|
|
@@ -67,7 +67,7 @@ function getShellProcessTooltip(instance, showDetailed) {
|
|
|
67
67
|
if (args) {
|
|
68
68
|
commandLine += ` ${args}`;
|
|
69
69
|
}
|
|
70
|
-
lines.push(( localize(
|
|
70
|
+
lines.push(( localize(13939, "Command line: {0}", commandLine)));
|
|
71
71
|
}
|
|
72
72
|
return lines.length ? `\n\n---\n\n${lines.join("\n")}` : "";
|
|
73
73
|
}
|
|
@@ -3,7 +3,7 @@ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
|
3
3
|
import { registerColor } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
4
4
|
|
|
5
5
|
const terminalStickyScrollBackground = registerColor("terminalStickyScroll.background", null, ( localize(
|
|
6
|
-
|
|
6
|
+
14654,
|
|
7
7
|
"The background color of the sticky scroll overlay in the terminal."
|
|
8
8
|
)));
|
|
9
9
|
const terminalStickyScrollHoverBackground = registerColor("terminalStickyScrollHover.background", {
|
|
@@ -12,7 +12,7 @@ const terminalStickyScrollHoverBackground = registerColor("terminalStickyScrollH
|
|
|
12
12
|
hcDark: "#E48B39",
|
|
13
13
|
hcLight: "#0f4a85"
|
|
14
14
|
}, ( localize(
|
|
15
|
-
|
|
15
|
+
14655,
|
|
16
16
|
"The background color of the sticky scroll overlay in the terminal when hovered."
|
|
17
17
|
)));
|
|
18
18
|
registerColor("terminalStickyScroll.border", {
|
|
@@ -20,6 +20,6 @@ registerColor("terminalStickyScroll.border", {
|
|
|
20
20
|
light: null,
|
|
21
21
|
hcDark: "#6fc3df",
|
|
22
22
|
hcLight: "#0f4a85"
|
|
23
|
-
}, ( localize(
|
|
23
|
+
}, ( localize(14656, "The border of the sticky scroll overlay in the terminal.")));
|
|
24
24
|
|
|
25
25
|
export { terminalStickyScrollBackground, terminalStickyScrollHoverBackground };
|
|
@@ -304,19 +304,19 @@ let TerminalStickyScrollOverlay = class TerminalStickyScrollOverlay extends Disp
|
|
|
304
304
|
this._element = $(".terminal-sticky-scroll", undefined, hoverOverlay);
|
|
305
305
|
this._xterm.raw.element.parentElement.append(this._element);
|
|
306
306
|
this._register(toDisposable(() => this._element?.remove()));
|
|
307
|
-
let hoverTitle = ( localize(
|
|
307
|
+
let hoverTitle = ( localize(14657, "Navigate to Command"));
|
|
308
308
|
const scrollToPreviousCommandKeybinding = this._keybindingService.lookupKeybinding(TerminalCommandId.ScrollToPreviousCommand);
|
|
309
309
|
if (scrollToPreviousCommandKeybinding) {
|
|
310
310
|
const label = scrollToPreviousCommandKeybinding.getLabel();
|
|
311
311
|
if (label) {
|
|
312
|
-
hoverTitle += "\n" + ( localize(
|
|
312
|
+
hoverTitle += "\n" + ( localize(14658, "{0} ({1})", terminalStrings.scrollToPreviousCommand.value, label));
|
|
313
313
|
}
|
|
314
314
|
}
|
|
315
315
|
const scrollToNextCommandKeybinding = this._keybindingService.lookupKeybinding(TerminalCommandId.ScrollToNextCommand);
|
|
316
316
|
if (scrollToNextCommandKeybinding) {
|
|
317
317
|
const label = scrollToNextCommandKeybinding.getLabel();
|
|
318
318
|
if (label) {
|
|
319
|
-
hoverTitle += "\n" + ( localize(
|
|
319
|
+
hoverTitle += "\n" + ( localize(14658, "{0} ({1})", terminalStrings.scrollToNextCommand.value, label));
|
|
320
320
|
}
|
|
321
321
|
}
|
|
322
322
|
hoverOverlay.title = hoverTitle;
|