@codingame/monaco-vscode-xterm-common 32.0.2 → 34.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 +5 -5
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/notifications.d.ts +51 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/notifications.js +9 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.js +15 -14
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.js +8 -8
- 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.js +55 -43
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +9 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +7 -16
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +321 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +78 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +83 -0
- 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/actions.d.ts +0 -1054
- package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.js +0 -59
- package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +0 -179
- package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.js +0 -16
- package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +0 -139
- package/vscode/src/vs/platform/agentHost/common/state/sessionState.js +0 -24
|
@@ -84,7 +84,7 @@ import { ProcessState, TERMINAL_VIEW_ID, TerminalCommandId } from '@codingame/mo
|
|
|
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';
|
|
87
|
-
import { getShellIntegrationTimeout, preparePathForShell, getUriLabelForShell, getWorkspaceForTerminal } from '
|
|
87
|
+
import { getShellIntegrationTimeout, preparePathForShell, getUriLabelForShell, getWorkspaceForTerminal } from '../common/terminalEnvironment.js';
|
|
88
88
|
import { IEditorService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorService.service';
|
|
89
89
|
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
90
90
|
import { IHistoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/history/common/history.service';
|
|
@@ -774,13 +774,13 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
774
774
|
}
|
|
775
775
|
xtermConstructor = Promises.withAsyncBody(async resolve => {
|
|
776
776
|
const Terminal = (await import('@xterm/xterm')).Terminal;
|
|
777
|
-
Terminal.strings.promptLabel = ( localize(
|
|
777
|
+
Terminal.strings.promptLabel = ( localize(14188, "Terminal input"));
|
|
778
778
|
Terminal.strings.tooMuchOutput = keybinding ? ( localize(
|
|
779
|
-
|
|
779
|
+
14189,
|
|
780
780
|
"Use the accessible buffer {0} to manually review output",
|
|
781
781
|
keybinding.getLabel()
|
|
782
782
|
)) : ( localize(
|
|
783
|
-
|
|
783
|
+
14190,
|
|
784
784
|
"Use the Terminal: Focus Accessible Buffer command to manually review output"
|
|
785
785
|
));
|
|
786
786
|
resolve(Terminal);
|
|
@@ -842,7 +842,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
842
842
|
id: TerminalStatus.Bell,
|
|
843
843
|
severity: Severity.Warning,
|
|
844
844
|
icon: Codicon.bell,
|
|
845
|
-
tooltip: ( localize(
|
|
845
|
+
tooltip: ( localize(14191, "Bell"))
|
|
846
846
|
}, this._terminalConfigurationService.config.bellDuration);
|
|
847
847
|
}
|
|
848
848
|
this._accessibilitySignalService.playSignal(AccessibilitySignal.terminalBell);
|
|
@@ -920,7 +920,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
920
920
|
if (!instance.xterm) {
|
|
921
921
|
return;
|
|
922
922
|
}
|
|
923
|
-
const cmdDetectionType = (instance.capabilities.get(TerminalCapability.CommandDetection)?.hasRichCommandDetection ? ( localize(
|
|
923
|
+
const cmdDetectionType = (instance.capabilities.get(TerminalCapability.CommandDetection)?.hasRichCommandDetection ? ( localize(14192, "Rich")) : ( instance.capabilities.has(TerminalCapability.CommandDetection)) ? ( localize(14193, "Basic")) : instance.usedShellIntegrationInjection ? ( localize(14194, "Injection failed to activate")) : ( localize(14195, "No")));
|
|
924
924
|
const detailedAdditions = [];
|
|
925
925
|
if (instance.shellType) {
|
|
926
926
|
detailedAdditions.push(`Shell type: \`${instance.shellType}\``);
|
|
@@ -945,8 +945,8 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
945
945
|
instance.statusList.add({
|
|
946
946
|
id: TerminalStatus.ShellIntegrationInfo,
|
|
947
947
|
severity: Severity.Info,
|
|
948
|
-
tooltip: `${( localize(
|
|
949
|
-
detailedTooltip: `${( localize(
|
|
948
|
+
tooltip: `${( localize(14196, "Shell integration"))}: ${cmdDetectionType}`,
|
|
949
|
+
detailedTooltip: `${( localize(14196, "Shell integration"))}: ${cmdDetectionType}${detailedAdditionsString}`
|
|
950
950
|
});
|
|
951
951
|
}
|
|
952
952
|
async runCommand(
|
|
@@ -1185,16 +1185,6 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1185
1185
|
this._horizontalScrollbar.dispose();
|
|
1186
1186
|
this._horizontalScrollbar = undefined;
|
|
1187
1187
|
}
|
|
1188
|
-
try {
|
|
1189
|
-
this.xterm?.dispose();
|
|
1190
|
-
} catch (err) {
|
|
1191
|
-
this._logService.error("Exception occurred during xterm disposal", err);
|
|
1192
|
-
}
|
|
1193
|
-
if (isFirefox) {
|
|
1194
|
-
this.resetFocusContextKey();
|
|
1195
|
-
this._terminalHasTextContextKey.reset();
|
|
1196
|
-
this._onDidBlur.fire(this);
|
|
1197
|
-
}
|
|
1198
1188
|
if (this._pressAnyKeyToCloseListener) {
|
|
1199
1189
|
this._pressAnyKeyToCloseListener.dispose();
|
|
1200
1190
|
this._pressAnyKeyToCloseListener = undefined;
|
|
@@ -1202,9 +1192,21 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1202
1192
|
if (this._exitReason === undefined) {
|
|
1203
1193
|
this._exitReason = reason ?? TerminalExitReason.Unknown;
|
|
1204
1194
|
}
|
|
1195
|
+
this._resizeDebouncer?.dispose();
|
|
1196
|
+
this._resizeDebouncer = undefined;
|
|
1205
1197
|
this._processManager.dispose();
|
|
1206
1198
|
this._onProcessExit(undefined);
|
|
1207
1199
|
this._onDisposed.fire(this);
|
|
1200
|
+
try {
|
|
1201
|
+
this.xterm?.dispose();
|
|
1202
|
+
} catch (err) {
|
|
1203
|
+
this._logService.error("Exception occurred during xterm disposal", err);
|
|
1204
|
+
}
|
|
1205
|
+
if (isFirefox) {
|
|
1206
|
+
this.resetFocusContextKey();
|
|
1207
|
+
this._terminalHasTextContextKey.reset();
|
|
1208
|
+
this._onDidBlur.fire(this);
|
|
1209
|
+
}
|
|
1208
1210
|
super.dispose();
|
|
1209
1211
|
}
|
|
1210
1212
|
async detachProcessAndDispose(reason) {
|
|
@@ -1415,7 +1417,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1415
1417
|
id: TerminalStatus.Disconnected,
|
|
1416
1418
|
severity: Severity.Error,
|
|
1417
1419
|
icon: Codicon.debugDisconnect,
|
|
1418
|
-
tooltip: ( localize(
|
|
1420
|
+
tooltip: ( localize(14197, "Lost connection to process"))
|
|
1419
1421
|
});
|
|
1420
1422
|
}));
|
|
1421
1423
|
this._register(processManager.onPtyReconnect(() => {
|
|
@@ -1431,14 +1433,15 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1431
1433
|
return;
|
|
1432
1434
|
}
|
|
1433
1435
|
const trusted = await this._trust();
|
|
1434
|
-
|
|
1436
|
+
const isRemoteTerminal = !!this.remoteAuthority;
|
|
1437
|
+
if (!trusted && !(isRemoteTerminal && this._workbenchEnvironmentService.remoteAuthority)) {
|
|
1435
1438
|
this._onProcessExit({
|
|
1436
|
-
message: ( localize(
|
|
1439
|
+
message: ( localize(14198, "Cannot launch a terminal process in an untrusted workspace"))
|
|
1437
1440
|
});
|
|
1438
1441
|
} else if (this._workspaceContextService.getWorkspace().folders.length === 0 && this._cwd && this._userHome && normalizeDriveLetter(this._cwd) !== normalizeDriveLetter(this._userHome)) {
|
|
1439
1442
|
this._onProcessExit({
|
|
1440
1443
|
message: ( localize(
|
|
1441
|
-
|
|
1444
|
+
14199,
|
|
1442
1445
|
"Cannot launch a terminal process in an empty workspace with cwd {0} different from userHome {1}",
|
|
1443
1446
|
this._cwd,
|
|
1444
1447
|
this._userHome
|
|
@@ -1524,7 +1527,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1524
1527
|
});
|
|
1525
1528
|
}
|
|
1526
1529
|
async _onProcessExit(exitCodeOrError) {
|
|
1527
|
-
if (this._isExiting) {
|
|
1530
|
+
if (this._isExiting || this.isDisposed) {
|
|
1528
1531
|
return;
|
|
1529
1532
|
}
|
|
1530
1533
|
const parsedExitResult = parseExitResult(
|
|
@@ -1552,6 +1555,9 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1552
1555
|
this._processManager.processState
|
|
1553
1556
|
);
|
|
1554
1557
|
this._onExit.fire(exitCodeOrError);
|
|
1558
|
+
if (this.isDisposed) {
|
|
1559
|
+
return;
|
|
1560
|
+
}
|
|
1555
1561
|
const waitOnExit = this.waitOnExit;
|
|
1556
1562
|
if (waitOnExit && this._processManager.processState !== ProcessState.KilledByUser) {
|
|
1557
1563
|
this._xtermReadyPromise.then(xterm => {
|
|
@@ -1608,10 +1614,10 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1608
1614
|
id: TerminalStatus.ShellIntegrationAttentionNeeded,
|
|
1609
1615
|
severity: Severity.Warning,
|
|
1610
1616
|
icon: Codicon.warning,
|
|
1611
|
-
tooltip: `${exitMessage} ` + ( localize(
|
|
1617
|
+
tooltip: `${exitMessage} ` + ( localize(14200, "Disabling shell integration in user settings might help.")),
|
|
1612
1618
|
hoverActions: [{
|
|
1613
1619
|
commandId: TerminalCommandId.ShellIntegrationLearnMore,
|
|
1614
|
-
label: ( localize(
|
|
1620
|
+
label: ( localize(14201, "Learn more about shell integration")),
|
|
1615
1621
|
run: () => {
|
|
1616
1622
|
this._openerService.open(
|
|
1617
1623
|
"https://code.visualstudio.com/docs/editor/integrated-terminal#_shell-integration"
|
|
@@ -1619,7 +1625,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1619
1625
|
}
|
|
1620
1626
|
}, {
|
|
1621
1627
|
commandId: "workbench.action.openSettings",
|
|
1622
|
-
label: ( localize(
|
|
1628
|
+
label: ( localize(14202, "Open user settings")),
|
|
1623
1629
|
run: () => {
|
|
1624
1630
|
this._commandService.executeCommand(
|
|
1625
1631
|
"workbench.action.openSettings",
|
|
@@ -1753,7 +1759,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1753
1759
|
return true;
|
|
1754
1760
|
}
|
|
1755
1761
|
const trustRequest = await this._workspaceTrustRequestService.requestWorkspaceTrust({
|
|
1756
|
-
message: ( localize(
|
|
1762
|
+
message: ( localize(14203, "Creating a terminal process requires executing code"))
|
|
1757
1763
|
});
|
|
1758
1764
|
return trustRequest === true;
|
|
1759
1765
|
}
|
|
@@ -1811,7 +1817,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1811
1817
|
}
|
|
1812
1818
|
}
|
|
1813
1819
|
async _resize(immediate) {
|
|
1814
|
-
if (!this.xterm) {
|
|
1820
|
+
if (!this.xterm || !this._resizeDebouncer) {
|
|
1815
1821
|
return;
|
|
1816
1822
|
}
|
|
1817
1823
|
let cols = this.cols;
|
|
@@ -1846,7 +1852,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1846
1852
|
cols,
|
|
1847
1853
|
rows
|
|
1848
1854
|
};
|
|
1849
|
-
this._resizeDebouncer
|
|
1855
|
+
this._resizeDebouncer?.resize(cols, rows, immediate ?? false);
|
|
1850
1856
|
}
|
|
1851
1857
|
async _updatePtyDimensions(rawXterm) {
|
|
1852
1858
|
if (this.isDisposed) {
|
|
@@ -1881,21 +1887,21 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1881
1887
|
const labelParts = [];
|
|
1882
1888
|
if (xterm && xterm.textarea) {
|
|
1883
1889
|
if (title && title.length > 0) {
|
|
1884
|
-
labelParts.push(( localize(
|
|
1890
|
+
labelParts.push(( localize(14204, "Terminal {0}, {1}", terminalId, title)));
|
|
1885
1891
|
} else {
|
|
1886
|
-
labelParts.push(( localize(
|
|
1892
|
+
labelParts.push(( localize(14205, "Terminal {0}", terminalId)));
|
|
1887
1893
|
}
|
|
1888
1894
|
const screenReaderOptimized = this._accessibilityService.isScreenReaderOptimized();
|
|
1889
1895
|
if (!screenReaderOptimized) {
|
|
1890
1896
|
labelParts.push(( localize(
|
|
1891
|
-
|
|
1897
|
+
14206,
|
|
1892
1898
|
"Run the command: Toggle Screen Reader Accessibility Mode for an optimized screen reader experience"
|
|
1893
1899
|
)));
|
|
1894
1900
|
}
|
|
1895
1901
|
const accessibilityHelpKeybinding = this._keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibilityHelp)?.getLabel();
|
|
1896
1902
|
if (this._configurationService.getValue(AccessibilityVerbositySettingId.Terminal) && accessibilityHelpKeybinding) {
|
|
1897
1903
|
labelParts.push(( localize(
|
|
1898
|
-
|
|
1904
|
+
14207,
|
|
1899
1905
|
"Use {0} for terminal accessibility help",
|
|
1900
1906
|
accessibilityHelpKeybinding
|
|
1901
1907
|
)));
|
|
@@ -1904,7 +1910,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1904
1910
|
}
|
|
1905
1911
|
}
|
|
1906
1912
|
_updateTitleProperties(title, eventSource) {
|
|
1907
|
-
if (
|
|
1913
|
+
if (title === undefined) {
|
|
1908
1914
|
return this._processName;
|
|
1909
1915
|
}
|
|
1910
1916
|
switch (eventSource) {
|
|
@@ -1949,7 +1955,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1949
1955
|
}
|
|
1950
1956
|
async setFixedDimensions() {
|
|
1951
1957
|
const cols = await this._quickInputService.input({
|
|
1952
|
-
title: ( localize(
|
|
1958
|
+
title: ( localize(14208, "Set Fixed Dimensions: Column")),
|
|
1953
1959
|
placeHolder: "Enter a number of columns or leave empty for automatic width",
|
|
1954
1960
|
validateInput: async text => text.length > 0 && !text.match(/^\d+$/) ? {
|
|
1955
1961
|
content: "Enter a number or leave empty size automatically",
|
|
@@ -1963,7 +1969,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1963
1969
|
this._labelComputer?.refreshLabel(this);
|
|
1964
1970
|
this._terminalHasFixedWidth.set(!!this._fixedCols);
|
|
1965
1971
|
const rows = await this._quickInputService.input({
|
|
1966
|
-
title: ( localize(
|
|
1972
|
+
title: ( localize(14209, "Set Fixed Dimensions: Row")),
|
|
1967
1973
|
placeHolder: "Enter a number of rows or leave empty for automatic height",
|
|
1968
1974
|
validateInput: async text => text.length > 0 && !text.match(/^\d+$/) ? {
|
|
1969
1975
|
content: "Enter a number or leave empty size automatically",
|
|
@@ -2073,7 +2079,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
2073
2079
|
_onEnvironmentVariableInfoChanged(info) {
|
|
2074
2080
|
if (info.requiresAction) {
|
|
2075
2081
|
this.xterm?.raw.textarea?.setAttribute("aria-label", ( localize(
|
|
2076
|
-
|
|
2082
|
+
14210,
|
|
2077
2083
|
"Terminal {0} environment is stale, run the 'Show Environment Information' command for more information",
|
|
2078
2084
|
this._instanceId
|
|
2079
2085
|
)));
|
|
@@ -2131,6 +2137,9 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
2131
2137
|
} else {
|
|
2132
2138
|
resource = URI.file(cwd);
|
|
2133
2139
|
}
|
|
2140
|
+
if (!(await this._fileService.canHandleResource(resource))) {
|
|
2141
|
+
return undefined;
|
|
2142
|
+
}
|
|
2134
2143
|
if (await this._fileService.exists(resource)) {
|
|
2135
2144
|
return resource;
|
|
2136
2145
|
}
|
|
@@ -2144,6 +2153,9 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
2144
2153
|
return this._processManager.updateProperty(type, value);
|
|
2145
2154
|
}
|
|
2146
2155
|
async rename(title, source) {
|
|
2156
|
+
if (title !== undefined && !title) {
|
|
2157
|
+
title = undefined;
|
|
2158
|
+
}
|
|
2147
2159
|
this._setTitle(title, source ?? TitleEventSource.Api);
|
|
2148
2160
|
}
|
|
2149
2161
|
_setTitle(title, eventSource) {
|
|
@@ -2229,7 +2241,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
2229
2241
|
disposables.push(quickPick);
|
|
2230
2242
|
quickPick.items = items;
|
|
2231
2243
|
quickPick.matchOnDescription = true;
|
|
2232
|
-
quickPick.placeholder = ( localize(
|
|
2244
|
+
quickPick.placeholder = ( localize(14211, "Select a color for the terminal"));
|
|
2233
2245
|
quickPick.show();
|
|
2234
2246
|
const result = await ( new Promise(r => {
|
|
2235
2247
|
disposables.push(quickPick.onDidHide(() => r(undefined)));
|
|
@@ -2566,24 +2578,24 @@ function parseExitResult(exitCodeOrError, shellLaunchConfig, processState, initi
|
|
|
2566
2578
|
if (processState === ProcessState.KilledDuringLaunch) {
|
|
2567
2579
|
if (commandLine) {
|
|
2568
2580
|
message = ( localize(
|
|
2569
|
-
|
|
2581
|
+
14212,
|
|
2570
2582
|
"The terminal process \"{0}\" failed to launch (exit code: {1}).",
|
|
2571
2583
|
commandLine,
|
|
2572
2584
|
code
|
|
2573
2585
|
));
|
|
2574
2586
|
} else {
|
|
2575
|
-
message = ( localize(
|
|
2587
|
+
message = ( localize(14213, "The terminal process failed to launch (exit code: {0}).", code));
|
|
2576
2588
|
}
|
|
2577
2589
|
} else {
|
|
2578
2590
|
if (commandLine) {
|
|
2579
2591
|
message = ( localize(
|
|
2580
|
-
|
|
2592
|
+
14214,
|
|
2581
2593
|
"The terminal process \"{0}\" terminated with exit code: {1}.",
|
|
2582
2594
|
commandLine,
|
|
2583
2595
|
code
|
|
2584
2596
|
));
|
|
2585
2597
|
} else {
|
|
2586
|
-
message = ( localize(
|
|
2598
|
+
message = ( localize(14215, "The terminal process terminated with exit code: {0}.", code));
|
|
2587
2599
|
}
|
|
2588
2600
|
}
|
|
2589
2601
|
break;
|
|
@@ -2609,7 +2621,7 @@ function parseExitResult(exitCodeOrError, shellLaunchConfig, processState, initi
|
|
|
2609
2621
|
break;
|
|
2610
2622
|
}
|
|
2611
2623
|
}
|
|
2612
|
-
message = ( localize(
|
|
2624
|
+
message = ( localize(14216, "The terminal process failed to launch: {0}.", innerMessage));
|
|
2613
2625
|
break;
|
|
2614
2626
|
}
|
|
2615
2627
|
}
|
|
@@ -25,7 +25,7 @@ import { MergedEnvironmentVariableCollection } from '../../../../platform/termin
|
|
|
25
25
|
import { serializeEnvironmentVariableCollections } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/environmentVariableShared';
|
|
26
26
|
import { ProcessState } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal';
|
|
27
27
|
import { ITerminalProfileResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal.service';
|
|
28
|
-
import { getWorkspaceForTerminal, mergeEnvironments, createVariableResolver, createTerminalEnvironment, getCwd } from '
|
|
28
|
+
import { getWorkspaceForTerminal, mergeEnvironments, createVariableResolver, createTerminalEnvironment, getCwd } from '../common/terminalEnvironment.js';
|
|
29
29
|
import { IConfigurationResolverService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service';
|
|
30
30
|
import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
|
|
31
31
|
import { IHistoryService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/history/common/history.service';
|
|
@@ -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
|
+
14247,
|
|
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
|
+
14248,
|
|
542
542
|
"Restarting the terminal because the connection to the shell process was lost..."
|
|
543
543
|
));
|
|
544
544
|
let postRestartMessage = "";
|
|
@@ -582,6 +582,12 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
|
|
|
582
582
|
this._resize(cols, rows, pixelWidth, pixelHeight);
|
|
583
583
|
return;
|
|
584
584
|
}
|
|
585
|
+
if (this._store.isDisposed) {
|
|
586
|
+
return Promise.resolve();
|
|
587
|
+
}
|
|
588
|
+
if (!this.ptyProcessReady) {
|
|
589
|
+
throw ( new Error("TerminalProcessManager.setDimensions called before initialization"));
|
|
590
|
+
}
|
|
585
591
|
return this.ptyProcessReady.then(() => this._resize(cols, rows, pixelWidth, pixelHeight));
|
|
586
592
|
}
|
|
587
593
|
async setUnicodeVersion(version) {
|
|
@@ -10,8 +10,8 @@ export declare class TerminalResizeDebouncer extends Disposable {
|
|
|
10
10
|
private _latestY;
|
|
11
11
|
private readonly _resizeXJob;
|
|
12
12
|
private readonly _resizeYJob;
|
|
13
|
+
private readonly _debounceResizeXScheduler;
|
|
13
14
|
constructor(_isVisible: () => boolean, _getXterm: () => XtermTerminal | undefined, _resizeBothCallback: (cols: number, rows: number) => void, _resizeXCallback: (cols: number) => void, _resizeYCallback: (rows: number) => void);
|
|
14
15
|
resize(cols: number, rows: number, immediate: boolean): Promise<void>;
|
|
15
16
|
flush(): void;
|
|
16
|
-
private _debounceResizeX;
|
|
17
17
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
|
|
2
|
-
import { __decorate } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
2
|
import { getWindow, runWhenWindowIdle } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
|
-
import {
|
|
3
|
+
import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
5
4
|
import { Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
5
|
|
|
7
6
|
var Constants;
|
|
8
7
|
(function(Constants) {
|
|
9
8
|
Constants[Constants["StartDebouncingThreshold"] = 200] = "StartDebouncingThreshold";
|
|
9
|
+
Constants[Constants["DebounceResizeXDelay"] = 100] = "DebounceResizeXDelay";
|
|
10
10
|
})(Constants || (Constants = {}));
|
|
11
11
|
class TerminalResizeDebouncer extends Disposable {
|
|
12
12
|
constructor(
|
|
@@ -26,6 +26,7 @@ class TerminalResizeDebouncer extends Disposable {
|
|
|
26
26
|
this._latestY = 0;
|
|
27
27
|
this._resizeXJob = this._register(( new MutableDisposable()));
|
|
28
28
|
this._resizeYJob = this._register(( new MutableDisposable()));
|
|
29
|
+
this._debounceResizeXScheduler = this._register(( new RunOnceScheduler(() => this._resizeXCallback(this._latestX), Constants.DebounceResizeXDelay)));
|
|
29
30
|
}
|
|
30
31
|
async resize(cols, rows, immediate) {
|
|
31
32
|
if (this._store.isDisposed) {
|
|
@@ -36,6 +37,7 @@ class TerminalResizeDebouncer extends Disposable {
|
|
|
36
37
|
if (immediate || this._getXterm().raw.buffer.normal.length < Constants.StartDebouncingThreshold) {
|
|
37
38
|
this._resizeXJob.clear();
|
|
38
39
|
this._resizeYJob.clear();
|
|
40
|
+
this._debounceResizeXScheduler.cancel();
|
|
39
41
|
this._resizeBothCallback(cols, rows);
|
|
40
42
|
return;
|
|
41
43
|
}
|
|
@@ -63,30 +65,19 @@ class TerminalResizeDebouncer extends Disposable {
|
|
|
63
65
|
}
|
|
64
66
|
this._resizeYCallback(rows);
|
|
65
67
|
this._latestX = cols;
|
|
66
|
-
this.
|
|
68
|
+
this._debounceResizeXScheduler.schedule();
|
|
67
69
|
}
|
|
68
70
|
flush() {
|
|
69
71
|
if (this._store.isDisposed) {
|
|
70
72
|
return;
|
|
71
73
|
}
|
|
72
|
-
if (this._resizeXJob.value || this._resizeYJob.value) {
|
|
74
|
+
if (this._resizeXJob.value || this._resizeYJob.value || this._debounceResizeXScheduler.isScheduled()) {
|
|
73
75
|
this._resizeXJob.clear();
|
|
74
76
|
this._resizeYJob.clear();
|
|
77
|
+
this._debounceResizeXScheduler.cancel();
|
|
75
78
|
this._resizeBothCallback(this._latestX, this._latestY);
|
|
76
79
|
}
|
|
77
80
|
}
|
|
78
|
-
_debounceResizeX(cols) {
|
|
79
|
-
if (this._store.isDisposed) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
this._resizeXCallback(cols);
|
|
83
|
-
}
|
|
84
81
|
}
|
|
85
|
-
TerminalResizeDebouncer.__decorator = ( __decorate(
|
|
86
|
-
[debounce(100)],
|
|
87
|
-
TerminalResizeDebouncer.prototype,
|
|
88
|
-
"_debounceResizeX",
|
|
89
|
-
null
|
|
90
|
-
));
|
|
91
82
|
|
|
92
83
|
export { TerminalResizeDebouncer };
|
|
@@ -435,7 +435,7 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
},
|
|
438
|
-
ariaLabel: ( localize(
|
|
438
|
+
ariaLabel: ( localize(14275, "Type terminal name. Press Enter to confirm or Escape to cancel.")),
|
|
439
439
|
inputBoxStyles: defaultInputBoxStyles
|
|
440
440
|
}));
|
|
441
441
|
inputBox.element.style.height = "22px";
|
|
@@ -566,7 +566,7 @@ let TerminalTabsAccessibilityProvider = class TerminalTabsAccessibilityProvider
|
|
|
566
566
|
this._terminalGroupService = _terminalGroupService;
|
|
567
567
|
}
|
|
568
568
|
getWidgetAriaLabel() {
|
|
569
|
-
return localize(
|
|
569
|
+
return localize(14276, "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
|
+
14277,
|
|
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(14278, "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(14279, "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(14280, "Hide Details")) : ( localize(14281, "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(14282, "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(14283, "Command line: {0}", commandLine)));
|
|
71
71
|
}
|
|
72
72
|
return lines.length ? `\n\n---\n\n${lines.join("\n")}` : "";
|
|
73
73
|
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
|
+
import { IWorkspaceFolder } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace";
|
|
3
|
+
import { IWorkspaceContextService } from "@codingame/monaco-vscode-api/vscode/vs/platform/workspace/common/workspace.service";
|
|
4
|
+
import { IConfigurationResolverService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/configurationResolver/common/configurationResolver.service";
|
|
5
|
+
import { IShellLaunchConfig, ITerminalBackend, ITerminalEnvironment, TerminalShellType } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal";
|
|
6
|
+
import { IProcessEnvironment, OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
|
|
7
|
+
import { IHistoryService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/history/common/history.service";
|
|
8
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
9
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
10
|
+
export declare function mergeEnvironments(parent: IProcessEnvironment, other: ITerminalEnvironment | undefined): void;
|
|
11
|
+
export declare function addTerminalEnvironmentKeys(env: IProcessEnvironment, version: string | undefined, locale: string | undefined, detectLocale: "auto" | "off" | "on"): void;
|
|
12
|
+
export declare function shouldSetLangEnvVariable(env: IProcessEnvironment, detectLocale: "auto" | "off" | "on"): boolean;
|
|
13
|
+
export declare function getLangEnvVariable(locale?: string): string;
|
|
14
|
+
export declare function getCwd(shell: IShellLaunchConfig, userHome: string | undefined, variableResolver: VariableResolver | undefined, root: URI | undefined, customCwd: string | undefined, logService?: ILogService): Promise<string>;
|
|
15
|
+
export type VariableResolver = (str: string) => Promise<string>;
|
|
16
|
+
export declare function createVariableResolver(lastActiveWorkspace: IWorkspaceFolder | undefined, env: IProcessEnvironment, configurationResolverService: IConfigurationResolverService | undefined): VariableResolver | undefined;
|
|
17
|
+
export declare function createTerminalEnvironment(shellLaunchConfig: IShellLaunchConfig, envFromConfig: ITerminalEnvironment | undefined, variableResolver: VariableResolver | undefined, version: string | undefined, detectLocale: "auto" | "off" | "on", baseEnv: IProcessEnvironment): Promise<IProcessEnvironment>;
|
|
18
|
+
/**
|
|
19
|
+
* Takes a path and returns the properly escaped path to send to a given shell. On Windows, this
|
|
20
|
+
* included trying to prepare the path for WSL if needed.
|
|
21
|
+
*
|
|
22
|
+
* @param originalPath The path to be escaped and formatted.
|
|
23
|
+
* @param executable The executable off the shellLaunchConfig.
|
|
24
|
+
* @param title The terminal's title.
|
|
25
|
+
* @param shellType The type of shell the path is being sent to.
|
|
26
|
+
* @param backend The backend for the terminal.
|
|
27
|
+
* @param isWindowsFrontend Whether the frontend is Windows, this is only exposed for injection via
|
|
28
|
+
* tests.
|
|
29
|
+
* @returns An escaped version of the path to be executed in the terminal.
|
|
30
|
+
*/
|
|
31
|
+
export declare function preparePathForShell(resource: string | URI, executable: string | undefined, title: string, shellType: TerminalShellType | undefined, backend: Pick<ITerminalBackend, "getWslPath"> | undefined, os: OperatingSystem | undefined, isWindowsFrontend?: boolean): Promise<string>;
|
|
32
|
+
export declare function getWorkspaceForTerminal(cwd: URI | string | undefined, workspaceContextService: IWorkspaceContextService, historyService: IHistoryService): IWorkspaceFolder | undefined;
|
|
33
|
+
export declare function getUriLabelForShell(uri: URI | string, backend: Pick<ITerminalBackend, "getWslPath">, shellType?: TerminalShellType, os?: OperatingSystem, isWindowsFrontend?: boolean): Promise<string>;
|
|
34
|
+
/**
|
|
35
|
+
* Gets the unified duration to wait for shell integration after the terminal launches before
|
|
36
|
+
* declaring the terminal lacks shell integration.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getShellIntegrationTimeout(configurationService: IConfigurationService, siInjectionEnabled: boolean, isRemote: boolean, processReadyTimestamp?: number): number;
|