@codingame/monaco-vscode-xterm-common 36.2.7 → 37.2.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/workbench/contrib/terminal/browser/agentHostOutputChannel.d.ts +22 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostOutputChannel.js +48 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.d.ts +17 -5
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.js +173 -63
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.d.ts +13 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.js +119 -56
- 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 +6 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +71 -49
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +9 -7
- 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/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/common/notifications.d.ts +0 -51
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/notifications.js +0 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +0 -78
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +0 -83
|
@@ -13,7 +13,7 @@ import { debounce } from '@codingame/monaco-vscode-api/vscode/vs/base/common/dec
|
|
|
13
13
|
import { onUnexpectedError, BugIndicatingError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
14
14
|
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
15
15
|
import { KeyCode } from '@codingame/monaco-vscode-api/vscode/vs/base/common/keyCodes';
|
|
16
|
-
import { normalizeDriveLetter, template } from '@codingame/monaco-vscode-api/vscode/vs/base/common/labels';
|
|
16
|
+
import { normalizeDriveLetter, tildify, template } from '@codingame/monaco-vscode-api/vscode/vs/base/common/labels';
|
|
17
17
|
import { Disposable, MutableDisposable, ImmortalReference, DisposableMap, DisposableStore, toDisposable, dispose } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
18
18
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
19
19
|
import { win32, basename, resolve } from '@codingame/monaco-vscode-api/vscode/vs/base/common/path';
|
|
@@ -45,7 +45,7 @@ import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platfo
|
|
|
45
45
|
import { TerminalCapability } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities';
|
|
46
46
|
import { TerminalCapabilityStoreMultiplexer } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/terminalCapabilityStore';
|
|
47
47
|
import { deserializeEnvironmentVariableCollections } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/environmentVariableShared';
|
|
48
|
-
import { PosixShellType, GeneralShellType, TitleEventSource, TerminalSettingId, ShellIntegrationStatus, TerminalExitReason, ProcessPropertyType, TerminalLocation, WindowsShellType } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal';
|
|
48
|
+
import { PosixShellType, GeneralShellType, TitleEventSource, remoteResolverTerminal, TerminalSettingId, ShellIntegrationStatus, TerminalExitReason, ProcessPropertyType, TerminalLocation, WindowsShellType } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal';
|
|
49
49
|
import { ITerminalLogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service';
|
|
50
50
|
import { formatMessageForTerminal } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminalStrings';
|
|
51
51
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
@@ -121,6 +121,7 @@ const shellIntegrationSupportedShellTypes = [
|
|
|
121
121
|
];
|
|
122
122
|
const agentCliTitlePatterns = ( new Map([
|
|
123
123
|
[GeneralShellType.Claude, /claude\s*code/i],
|
|
124
|
+
[GeneralShellType.CommandCode, /command\s*code/i],
|
|
124
125
|
[GeneralShellType.Copilot, /\bcopilot\b/i],
|
|
125
126
|
[GeneralShellType.Gemini, /\bgemini\b/i]
|
|
126
127
|
]));
|
|
@@ -399,6 +400,8 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
399
400
|
this._targetRef = ( new ImmortalReference(undefined));
|
|
400
401
|
this._onExit = ( new Emitter());
|
|
401
402
|
this.onExit = this._onExit.event;
|
|
403
|
+
this._onWillDispose = this._register(( new Emitter()));
|
|
404
|
+
this.onWillDispose = this._onWillDispose.event;
|
|
402
405
|
this._onDisposed = this._register(( new Emitter()));
|
|
403
406
|
this.onDisposed = this._onDisposed.event;
|
|
404
407
|
this._onProcessIdReady = this._register(( new Emitter()));
|
|
@@ -450,10 +453,13 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
450
453
|
})));
|
|
451
454
|
this.onLineData = this._onLineData.event;
|
|
452
455
|
this.sessionId = generateUuid();
|
|
456
|
+
this._isRemoteResolverTerminal = this._shellLaunchConfig[remoteResolverTerminal] === true;
|
|
457
|
+
delete this._shellLaunchConfig[remoteResolverTerminal];
|
|
453
458
|
this._wrapperElement = createElement("div");
|
|
454
459
|
this._wrapperElement.classList.add("terminal-wrapper");
|
|
455
460
|
this._widgetManager = this._register(instantiationService.createInstance(TerminalWidgetManager));
|
|
456
461
|
this._isExiting = false;
|
|
462
|
+
this._isDisposing = false;
|
|
457
463
|
this._hadFocusOnExit = false;
|
|
458
464
|
this._isVisible = false;
|
|
459
465
|
this._instanceId = TerminalInstance_1._instanceIdCounter++;
|
|
@@ -670,7 +676,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
670
676
|
contribution.xtermReady?.(xterm);
|
|
671
677
|
}
|
|
672
678
|
});
|
|
673
|
-
this._register(this.
|
|
679
|
+
this._register(this.onWillDispose(() => {
|
|
674
680
|
contribution.dispose();
|
|
675
681
|
this._contributions.delete(desc.id);
|
|
676
682
|
}));
|
|
@@ -753,7 +759,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
753
759
|
return undefined;
|
|
754
760
|
}
|
|
755
761
|
const computedStyle = getWindow(this.xterm.raw.element).getComputedStyle(this.xterm.raw.element);
|
|
756
|
-
const horizontalPadding = parseInt(computedStyle.paddingLeft) + parseInt(computedStyle.paddingRight) +
|
|
762
|
+
const horizontalPadding = parseInt(computedStyle.paddingLeft) + parseInt(computedStyle.paddingRight) + this.xterm.scrollbarWidth ;
|
|
757
763
|
const verticalPadding = parseInt(computedStyle.paddingTop) + parseInt(computedStyle.paddingBottom);
|
|
758
764
|
TerminalInstance_1._lastKnownCanvasDimensions = new Dimension(
|
|
759
765
|
Math.min(Constants.MaxCanvasWidth, width - horizontalPadding),
|
|
@@ -774,13 +780,13 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
774
780
|
}
|
|
775
781
|
xtermConstructor = Promises.withAsyncBody(async resolve => {
|
|
776
782
|
const Terminal = (await import('@xterm/xterm')).Terminal;
|
|
777
|
-
Terminal.strings.promptLabel = ( localize(
|
|
783
|
+
Terminal.strings.promptLabel = ( localize(16896, "Terminal input"));
|
|
778
784
|
Terminal.strings.tooMuchOutput = keybinding ? ( localize(
|
|
779
|
-
|
|
785
|
+
16897,
|
|
780
786
|
"Use the accessible buffer {0} to manually review output",
|
|
781
787
|
keybinding.getLabel()
|
|
782
788
|
)) : ( localize(
|
|
783
|
-
|
|
789
|
+
16898,
|
|
784
790
|
"Use the Terminal: Focus Accessible Buffer command to manually review output"
|
|
785
791
|
));
|
|
786
792
|
resolve(Terminal);
|
|
@@ -842,7 +848,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
842
848
|
id: TerminalStatus.Bell,
|
|
843
849
|
severity: Severity.Warning,
|
|
844
850
|
icon: Codicon.bell,
|
|
845
|
-
tooltip: ( localize(
|
|
851
|
+
tooltip: ( localize(16899, "Bell"))
|
|
846
852
|
}, this._terminalConfigurationService.config.bellDuration);
|
|
847
853
|
}
|
|
848
854
|
this._accessibilitySignalService.playSignal(AccessibilitySignal.terminalBell);
|
|
@@ -920,7 +926,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
920
926
|
if (!instance.xterm) {
|
|
921
927
|
return;
|
|
922
928
|
}
|
|
923
|
-
const cmdDetectionType = (instance.capabilities.get(TerminalCapability.CommandDetection)?.hasRichCommandDetection ? ( localize(
|
|
929
|
+
const cmdDetectionType = (instance.capabilities.get(TerminalCapability.CommandDetection)?.hasRichCommandDetection ? ( localize(16900, "Rich")) : ( instance.capabilities.has(TerminalCapability.CommandDetection)) ? ( localize(16901, "Basic")) : instance.usedShellIntegrationInjection ? ( localize(16902, "Injection failed to activate")) : ( localize(16903, "No")));
|
|
924
930
|
const detailedAdditions = [];
|
|
925
931
|
if (instance.shellType) {
|
|
926
932
|
detailedAdditions.push(`Shell type: \`${instance.shellType}\``);
|
|
@@ -945,8 +951,8 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
945
951
|
instance.statusList.add({
|
|
946
952
|
id: TerminalStatus.ShellIntegrationInfo,
|
|
947
953
|
severity: Severity.Info,
|
|
948
|
-
tooltip: `${( localize(
|
|
949
|
-
detailedTooltip: `${( localize(
|
|
954
|
+
tooltip: `${( localize(16904, "Shell integration"))}: ${cmdDetectionType}`,
|
|
955
|
+
detailedTooltip: `${( localize(16904, "Shell integration"))}: ${cmdDetectionType}${detailedAdditionsString}`
|
|
950
956
|
});
|
|
951
957
|
}
|
|
952
958
|
async runCommand(
|
|
@@ -967,16 +973,21 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
967
973
|
if (!commandDetection || commandDetection.promptInputModel.state !== PromptInputState.Input) {
|
|
968
974
|
const store = ( new DisposableStore());
|
|
969
975
|
await Promise.race([( new Promise(r => {
|
|
970
|
-
|
|
971
|
-
commandDetection =
|
|
972
|
-
if (
|
|
976
|
+
const waitForPromptInput = capability => {
|
|
977
|
+
commandDetection = capability;
|
|
978
|
+
if (capability.promptInputModel.state === PromptInputState.Input) {
|
|
973
979
|
r();
|
|
974
980
|
} else {
|
|
975
|
-
store.add(
|
|
981
|
+
store.add(capability.promptInputModel.onDidStartInput(() => {
|
|
976
982
|
r();
|
|
977
983
|
}));
|
|
978
984
|
}
|
|
979
|
-
}
|
|
985
|
+
};
|
|
986
|
+
if (commandDetection) {
|
|
987
|
+
waitForPromptInput(commandDetection);
|
|
988
|
+
} else {
|
|
989
|
+
store.add(this.capabilities.onDidAddCommandDetectionCapability(waitForPromptInput));
|
|
990
|
+
}
|
|
980
991
|
})), timeout(timeoutMs)]);
|
|
981
992
|
store.dispose();
|
|
982
993
|
}
|
|
@@ -1174,6 +1185,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1174
1185
|
return;
|
|
1175
1186
|
}
|
|
1176
1187
|
this._logService.trace(`terminalInstance#dispose (instanceId: ${this.instanceId})`);
|
|
1188
|
+
this._isDisposing = true;
|
|
1177
1189
|
dispose(this._widgetManager);
|
|
1178
1190
|
if (this.xterm?.raw.element) {
|
|
1179
1191
|
this._hadFocusOnExit = this.hasFocus;
|
|
@@ -1185,6 +1197,17 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1185
1197
|
this._horizontalScrollbar.dispose();
|
|
1186
1198
|
this._horizontalScrollbar = undefined;
|
|
1187
1199
|
}
|
|
1200
|
+
this._onWillDispose.fire(this);
|
|
1201
|
+
try {
|
|
1202
|
+
this.xterm?.dispose();
|
|
1203
|
+
} catch (err) {
|
|
1204
|
+
this._logService.error("Exception occurred during xterm disposal", err);
|
|
1205
|
+
}
|
|
1206
|
+
if (isFirefox) {
|
|
1207
|
+
this.resetFocusContextKey();
|
|
1208
|
+
this._terminalHasTextContextKey.reset();
|
|
1209
|
+
this._onDidBlur.fire(this);
|
|
1210
|
+
}
|
|
1188
1211
|
if (this._pressAnyKeyToCloseListener) {
|
|
1189
1212
|
this._pressAnyKeyToCloseListener.dispose();
|
|
1190
1213
|
this._pressAnyKeyToCloseListener = undefined;
|
|
@@ -1197,16 +1220,6 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1197
1220
|
this._processManager.dispose();
|
|
1198
1221
|
this._onProcessExit(undefined);
|
|
1199
1222
|
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
|
-
}
|
|
1210
1223
|
super.dispose();
|
|
1211
1224
|
}
|
|
1212
1225
|
async detachProcessAndDispose(reason) {
|
|
@@ -1417,7 +1430,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1417
1430
|
id: TerminalStatus.Disconnected,
|
|
1418
1431
|
severity: Severity.Error,
|
|
1419
1432
|
icon: Codicon.debugDisconnect,
|
|
1420
|
-
tooltip: ( localize(
|
|
1433
|
+
tooltip: ( localize(16905, "Lost connection to process"))
|
|
1421
1434
|
});
|
|
1422
1435
|
}));
|
|
1423
1436
|
this._register(processManager.onPtyReconnect(() => {
|
|
@@ -1432,21 +1445,23 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1432
1445
|
if (this.isDisposed) {
|
|
1433
1446
|
return;
|
|
1434
1447
|
}
|
|
1435
|
-
const trusted = await this._trust();
|
|
1448
|
+
const trusted = this._isRemoteResolverTerminal || (await this._trust());
|
|
1436
1449
|
const isRemoteTerminal = !!this.remoteAuthority;
|
|
1437
1450
|
if (!trusted && !(isRemoteTerminal && this._workbenchEnvironmentService.remoteAuthority)) {
|
|
1438
1451
|
this._onProcessExit({
|
|
1439
|
-
message: ( localize(
|
|
1452
|
+
message: ( localize(16906, "Cannot launch a terminal process in an untrusted workspace"))
|
|
1440
1453
|
});
|
|
1454
|
+
return;
|
|
1441
1455
|
} else if (this._workspaceContextService.getWorkspace().folders.length === 0 && this._cwd && this._userHome && normalizeDriveLetter(this._cwd) !== normalizeDriveLetter(this._userHome)) {
|
|
1442
1456
|
this._onProcessExit({
|
|
1443
1457
|
message: ( localize(
|
|
1444
|
-
|
|
1458
|
+
16907,
|
|
1445
1459
|
"Cannot launch a terminal process in an empty workspace with cwd {0} different from userHome {1}",
|
|
1446
1460
|
this._cwd,
|
|
1447
1461
|
this._userHome
|
|
1448
1462
|
))
|
|
1449
1463
|
});
|
|
1464
|
+
return;
|
|
1450
1465
|
}
|
|
1451
1466
|
if (this._container && this._cols === 0 && this._rows === 0) {
|
|
1452
1467
|
this._initDimensions();
|
|
@@ -1614,10 +1629,10 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1614
1629
|
id: TerminalStatus.ShellIntegrationAttentionNeeded,
|
|
1615
1630
|
severity: Severity.Warning,
|
|
1616
1631
|
icon: Codicon.warning,
|
|
1617
|
-
tooltip: `${exitMessage} ` + ( localize(
|
|
1632
|
+
tooltip: `${exitMessage} ` + ( localize(16908, "Disabling shell integration in user settings might help.")),
|
|
1618
1633
|
hoverActions: [{
|
|
1619
1634
|
commandId: TerminalCommandId.ShellIntegrationLearnMore,
|
|
1620
|
-
label: ( localize(
|
|
1635
|
+
label: ( localize(16909, "Learn more about shell integration")),
|
|
1621
1636
|
run: () => {
|
|
1622
1637
|
this._openerService.open(
|
|
1623
1638
|
"https://code.visualstudio.com/docs/terminal/shell-integration?referrer=in-product"
|
|
@@ -1625,7 +1640,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1625
1640
|
}
|
|
1626
1641
|
}, {
|
|
1627
1642
|
commandId: "workbench.action.openSettings",
|
|
1628
|
-
label: ( localize(
|
|
1643
|
+
label: ( localize(16910, "Open user settings")),
|
|
1629
1644
|
run: () => {
|
|
1630
1645
|
this._commandService.executeCommand(
|
|
1631
1646
|
"workbench.action.openSettings",
|
|
@@ -1759,7 +1774,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1759
1774
|
return true;
|
|
1760
1775
|
}
|
|
1761
1776
|
const trustRequest = await this._workspaceTrustRequestService.requestWorkspaceTrust({
|
|
1762
|
-
message: ( localize(
|
|
1777
|
+
message: ( localize(16911, "Creating a terminal process requires executing code"))
|
|
1763
1778
|
});
|
|
1764
1779
|
return trustRequest === true;
|
|
1765
1780
|
}
|
|
@@ -1817,7 +1832,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1817
1832
|
}
|
|
1818
1833
|
}
|
|
1819
1834
|
async _resize(immediate) {
|
|
1820
|
-
if (!this.xterm || !this._resizeDebouncer) {
|
|
1835
|
+
if (!this.xterm || !this._resizeDebouncer || this.isDisposed || this._isDisposing) {
|
|
1821
1836
|
return;
|
|
1822
1837
|
}
|
|
1823
1838
|
let cols = this.cols;
|
|
@@ -1887,21 +1902,21 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1887
1902
|
const labelParts = [];
|
|
1888
1903
|
if (xterm && xterm.textarea) {
|
|
1889
1904
|
if (title && title.length > 0) {
|
|
1890
|
-
labelParts.push(( localize(
|
|
1905
|
+
labelParts.push(( localize(16912, "Terminal {0}, {1}", terminalId, title)));
|
|
1891
1906
|
} else {
|
|
1892
|
-
labelParts.push(( localize(
|
|
1907
|
+
labelParts.push(( localize(16913, "Terminal {0}", terminalId)));
|
|
1893
1908
|
}
|
|
1894
1909
|
const screenReaderOptimized = this._accessibilityService.isScreenReaderOptimized();
|
|
1895
1910
|
if (!screenReaderOptimized) {
|
|
1896
1911
|
labelParts.push(( localize(
|
|
1897
|
-
|
|
1912
|
+
16914,
|
|
1898
1913
|
"Run the command: Toggle Screen Reader Accessibility Mode for an optimized screen reader experience"
|
|
1899
1914
|
)));
|
|
1900
1915
|
}
|
|
1901
1916
|
const accessibilityHelpKeybinding = this._keybindingService.lookupKeybinding(AccessibilityCommandId.OpenAccessibilityHelp)?.getLabel();
|
|
1902
1917
|
if (this._configurationService.getValue(AccessibilityVerbositySettingId.Terminal) && accessibilityHelpKeybinding) {
|
|
1903
1918
|
labelParts.push(( localize(
|
|
1904
|
-
|
|
1919
|
+
16915,
|
|
1905
1920
|
"Use {0} for terminal accessibility help",
|
|
1906
1921
|
accessibilityHelpKeybinding
|
|
1907
1922
|
)));
|
|
@@ -1955,7 +1970,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1955
1970
|
}
|
|
1956
1971
|
async setFixedDimensions() {
|
|
1957
1972
|
const cols = await this._quickInputService.input({
|
|
1958
|
-
title: ( localize(
|
|
1973
|
+
title: ( localize(16916, "Set Fixed Dimensions: Column")),
|
|
1959
1974
|
placeHolder: "Enter a number of columns or leave empty for automatic width",
|
|
1960
1975
|
validateInput: async text => text.length > 0 && !text.match(/^\d+$/) ? {
|
|
1961
1976
|
content: "Enter a number or leave empty size automatically",
|
|
@@ -1969,7 +1984,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
1969
1984
|
this._labelComputer?.refreshLabel(this);
|
|
1970
1985
|
this._terminalHasFixedWidth.set(!!this._fixedCols);
|
|
1971
1986
|
const rows = await this._quickInputService.input({
|
|
1972
|
-
title: ( localize(
|
|
1987
|
+
title: ( localize(16917, "Set Fixed Dimensions: Row")),
|
|
1973
1988
|
placeHolder: "Enter a number of rows or leave empty for automatic height",
|
|
1974
1989
|
validateInput: async text => text.length > 0 && !text.match(/^\d+$/) ? {
|
|
1975
1990
|
content: "Enter a number or leave empty size automatically",
|
|
@@ -2079,7 +2094,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
2079
2094
|
_onEnvironmentVariableInfoChanged(info) {
|
|
2080
2095
|
if (info.requiresAction) {
|
|
2081
2096
|
this.xterm?.raw.textarea?.setAttribute("aria-label", ( localize(
|
|
2082
|
-
|
|
2097
|
+
16918,
|
|
2083
2098
|
"Terminal {0} environment is stale, run the 'Show Environment Information' command for more information",
|
|
2084
2099
|
this._instanceId
|
|
2085
2100
|
)));
|
|
@@ -2241,7 +2256,7 @@ let TerminalInstance = class TerminalInstance extends Disposable {
|
|
|
2241
2256
|
disposables.push(quickPick);
|
|
2242
2257
|
quickPick.items = items;
|
|
2243
2258
|
quickPick.matchOnDescription = true;
|
|
2244
|
-
quickPick.placeholder = ( localize(
|
|
2259
|
+
quickPick.placeholder = ( localize(16919, "Select a color for the terminal"));
|
|
2245
2260
|
quickPick.show();
|
|
2246
2261
|
const result = await ( new Promise(r => {
|
|
2247
2262
|
disposables.push(quickPick.onDidHide(() => r(undefined)));
|
|
@@ -2450,6 +2465,7 @@ let TerminalLabelComputer = class TerminalLabelComputer extends Disposable {
|
|
|
2450
2465
|
this.agentCliShellTypes = ( new Set([
|
|
2451
2466
|
GeneralShellType.Claude,
|
|
2452
2467
|
GeneralShellType.Codex,
|
|
2468
|
+
GeneralShellType.CommandCode,
|
|
2453
2469
|
GeneralShellType.Copilot,
|
|
2454
2470
|
GeneralShellType.Gemini
|
|
2455
2471
|
]));
|
|
@@ -2482,8 +2498,14 @@ let TerminalLabelComputer = class TerminalLabelComputer extends Disposable {
|
|
|
2482
2498
|
const commandDetection = instance.capabilities.get(TerminalCapability.CommandDetection);
|
|
2483
2499
|
const promptInputModel = commandDetection?.promptInputModel;
|
|
2484
2500
|
const nonTaskSpinner = type === "Task" ? "" : " $(loading~spin)";
|
|
2501
|
+
let cwd = instance.cwd || instance.initialCwd || "";
|
|
2502
|
+
const os = instance.os ?? OS;
|
|
2503
|
+
cwd = tildify(cwd, instance.userHome || "", os);
|
|
2504
|
+
if (os !== OperatingSystem.Windows && cwd && instance.userHome && cwd === instance.userHome) {
|
|
2505
|
+
cwd = "~";
|
|
2506
|
+
}
|
|
2485
2507
|
const templateProperties = {
|
|
2486
|
-
cwd
|
|
2508
|
+
cwd,
|
|
2487
2509
|
cwdFolder: "",
|
|
2488
2510
|
workspaceFolderName: instance.workspaceFolder?.name,
|
|
2489
2511
|
workspaceFolder: instance.workspaceFolder ? basename(instance.workspaceFolder.uri.fsPath) : undefined,
|
|
@@ -2578,24 +2600,24 @@ function parseExitResult(exitCodeOrError, shellLaunchConfig, processState, initi
|
|
|
2578
2600
|
if (processState === ProcessState.KilledDuringLaunch) {
|
|
2579
2601
|
if (commandLine) {
|
|
2580
2602
|
message = ( localize(
|
|
2581
|
-
|
|
2603
|
+
16920,
|
|
2582
2604
|
"The terminal process \"{0}\" failed to launch (exit code: {1}).",
|
|
2583
2605
|
commandLine,
|
|
2584
2606
|
code
|
|
2585
2607
|
));
|
|
2586
2608
|
} else {
|
|
2587
|
-
message = ( localize(
|
|
2609
|
+
message = ( localize(16921, "The terminal process failed to launch (exit code: {0}).", code));
|
|
2588
2610
|
}
|
|
2589
2611
|
} else {
|
|
2590
2612
|
if (commandLine) {
|
|
2591
2613
|
message = ( localize(
|
|
2592
|
-
|
|
2614
|
+
16922,
|
|
2593
2615
|
"The terminal process \"{0}\" terminated with exit code: {1}.",
|
|
2594
2616
|
commandLine,
|
|
2595
2617
|
code
|
|
2596
2618
|
));
|
|
2597
2619
|
} else {
|
|
2598
|
-
message = ( localize(
|
|
2620
|
+
message = ( localize(16923, "The terminal process terminated with exit code: {0}.", code));
|
|
2599
2621
|
}
|
|
2600
2622
|
}
|
|
2601
2623
|
break;
|
|
@@ -2621,7 +2643,7 @@ function parseExitResult(exitCodeOrError, shellLaunchConfig, processState, initi
|
|
|
2621
2643
|
break;
|
|
2622
2644
|
}
|
|
2623
2645
|
}
|
|
2624
|
-
message = ( localize(
|
|
2646
|
+
message = ( localize(16924, "The terminal process failed to launch: {0}.", innerMessage));
|
|
2625
2647
|
break;
|
|
2626
2648
|
}
|
|
2627
2649
|
}
|
|
@@ -71,6 +71,7 @@ export declare class TerminalProcessManager extends Disposable implements ITermi
|
|
|
71
71
|
private _preLaunchInputQueue;
|
|
72
72
|
private _initialCwd;
|
|
73
73
|
private _extEnvironmentVariableCollection;
|
|
74
|
+
private readonly _environmentVariableCollectionListener;
|
|
74
75
|
private _ackDataBufferer;
|
|
75
76
|
private _hasWrittenData;
|
|
76
77
|
private _hasChildProcesses;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Emitter, Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
|
-
import { Disposable, dispose, toDisposable
|
|
4
|
+
import { Disposable, MutableDisposable, dispose, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
5
|
import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
|
|
6
6
|
import { OS, OperatingSystem, isWindows, isMacintosh } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
7
7
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
@@ -126,6 +126,7 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
|
|
|
126
126
|
this._process = null;
|
|
127
127
|
this._processType = ProcessType.Process;
|
|
128
128
|
this._preLaunchInputQueue = [];
|
|
129
|
+
this._environmentVariableCollectionListener = this._register(( new MutableDisposable()));
|
|
129
130
|
this._hasWrittenData = false;
|
|
130
131
|
this._hasChildProcesses = false;
|
|
131
132
|
this._ptyListenersAttached = false;
|
|
@@ -183,9 +184,9 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
|
|
|
183
184
|
}
|
|
184
185
|
if (environmentVariableCollections) {
|
|
185
186
|
this._extEnvironmentVariableCollection = ( new MergedEnvironmentVariableCollection(environmentVariableCollections));
|
|
186
|
-
this.
|
|
187
|
+
this._environmentVariableCollectionListener.value = this._environmentVariableService.onDidChangeCollections(
|
|
187
188
|
newCollection => this._onEnvironmentVariableCollectionChange(newCollection)
|
|
188
|
-
)
|
|
189
|
+
);
|
|
189
190
|
this.environmentVariableInfo = this._instantiationService.createInstance(
|
|
190
191
|
EnvironmentVariableInfoChangesActive,
|
|
191
192
|
this._extEnvironmentVariableCollection
|
|
@@ -202,7 +203,7 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
|
|
|
202
203
|
} catch (e) {
|
|
203
204
|
this._notificationService.notify({
|
|
204
205
|
message: ( localize(
|
|
205
|
-
|
|
206
|
+
16956,
|
|
206
207
|
"Could not kill process listening on port {0}, command exited with error {1}",
|
|
207
208
|
port,
|
|
208
209
|
e
|
|
@@ -454,11 +455,12 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
|
|
|
454
455
|
baseEnv
|
|
455
456
|
);
|
|
456
457
|
this._logService.debug(`Terminal environment created with ${( Object.keys(env)).length} variables: ${( Object.keys(env)).sort().join(", ")}`);
|
|
458
|
+
this._environmentVariableCollectionListener.clear();
|
|
457
459
|
if (!this._isDisposed && shouldUseEnvironmentVariableCollection(shellLaunchConfig)) {
|
|
458
460
|
this._extEnvironmentVariableCollection = this._environmentVariableService.mergedCollection;
|
|
459
|
-
this.
|
|
461
|
+
this._environmentVariableCollectionListener.value = this._environmentVariableService.onDidChangeCollections(
|
|
460
462
|
newCollection => this._onEnvironmentVariableCollectionChange(newCollection)
|
|
461
|
-
)
|
|
463
|
+
);
|
|
462
464
|
await this._extEnvironmentVariableCollection.applyToProcessEnvironment(env, {
|
|
463
465
|
workspaceFolder
|
|
464
466
|
}, variableResolver);
|
|
@@ -538,7 +540,7 @@ let TerminalProcessManager = class TerminalProcessManager extends Disposable {
|
|
|
538
540
|
this._onExit(-1);
|
|
539
541
|
} else {
|
|
540
542
|
const message = ( localize(
|
|
541
|
-
|
|
543
|
+
16957,
|
|
542
544
|
"Restarting the terminal because the connection to the shell process was lost..."
|
|
543
545
|
));
|
|
544
546
|
let postRestartMessage = "";
|
|
@@ -435,7 +435,7 @@ let TerminalTabsRenderer = class TerminalTabsRenderer {
|
|
|
435
435
|
};
|
|
436
436
|
}
|
|
437
437
|
},
|
|
438
|
-
ariaLabel: ( localize(
|
|
438
|
+
ariaLabel: ( localize(16984, "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(16985, "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
|
+
16986,
|
|
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(16987, "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(16988, "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(16989, "Hide Details")) : ( localize(16990, "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(16991, "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(16992, "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
|
+
17739,
|
|
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
|
+
17740,
|
|
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(17741, "The border of the sticky scroll overlay in the terminal.")));
|
|
24
24
|
|
|
25
25
|
export { terminalStickyScrollBackground, terminalStickyScrollHoverBackground };
|
|
@@ -305,19 +305,19 @@ let TerminalStickyScrollOverlay = class TerminalStickyScrollOverlay extends Disp
|
|
|
305
305
|
this._element = $(".terminal-sticky-scroll", undefined, hoverOverlay);
|
|
306
306
|
this._xterm.raw.element.parentElement.append(this._element);
|
|
307
307
|
this._register(toDisposable(() => this._element?.remove()));
|
|
308
|
-
let hoverTitle = ( localize(
|
|
308
|
+
let hoverTitle = ( localize(17742, "Navigate to Command"));
|
|
309
309
|
const scrollToPreviousCommandKeybinding = this._keybindingService.lookupKeybinding(TerminalCommandId.ScrollToPreviousCommand);
|
|
310
310
|
if (scrollToPreviousCommandKeybinding) {
|
|
311
311
|
const label = scrollToPreviousCommandKeybinding.getLabel();
|
|
312
312
|
if (label) {
|
|
313
|
-
hoverTitle += "\n" + ( localize(
|
|
313
|
+
hoverTitle += "\n" + ( localize(17743, "{0} ({1})", terminalStrings.scrollToPreviousCommand.value, label));
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
316
|
const scrollToNextCommandKeybinding = this._keybindingService.lookupKeybinding(TerminalCommandId.ScrollToNextCommand);
|
|
317
317
|
if (scrollToNextCommandKeybinding) {
|
|
318
318
|
const label = scrollToNextCommandKeybinding.getLabel();
|
|
319
319
|
if (label) {
|
|
320
|
-
hoverTitle += "\n" + ( localize(
|
|
320
|
+
hoverTitle += "\n" + ( localize(17743, "{0} ({1})", terminalStrings.scrollToNextCommand.value, label));
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
hoverOverlay.title = hoverTitle;
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { URI } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/common/state";
|
|
2
|
-
/**
|
|
3
|
-
* Reason why authentication is required.
|
|
4
|
-
*
|
|
5
|
-
* @category Protocol Notifications
|
|
6
|
-
*/
|
|
7
|
-
export declare enum AuthRequiredReason {
|
|
8
|
-
/** The client has not yet authenticated for the resource */
|
|
9
|
-
Required = "required",
|
|
10
|
-
/** A previously valid token has expired or been revoked */
|
|
11
|
-
Expired = "expired"
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Sent by the server when a protected resource requires (re-)authentication.
|
|
15
|
-
*
|
|
16
|
-
* This notification MAY be associated with any channel — for example, an
|
|
17
|
-
* agent advertised on the root channel, or a per-session resource. The
|
|
18
|
-
* `channel` field identifies the subscription the auth requirement belongs
|
|
19
|
-
* to; the `resource` field carries the OAuth-protected resource identifier
|
|
20
|
-
* (per RFC 9728).
|
|
21
|
-
*
|
|
22
|
-
* Clients should obtain a fresh token and push it via the `authenticate`
|
|
23
|
-
* command.
|
|
24
|
-
*
|
|
25
|
-
* @category Protocol Notifications
|
|
26
|
-
* @method auth/required
|
|
27
|
-
* @direction Server → Client
|
|
28
|
-
* @messageType Notification
|
|
29
|
-
* @version 1
|
|
30
|
-
* @see {@link /specification/authentication | Authentication}
|
|
31
|
-
* @example
|
|
32
|
-
* ```json
|
|
33
|
-
* {
|
|
34
|
-
* "jsonrpc": "2.0",
|
|
35
|
-
* "method": "auth/required",
|
|
36
|
-
* "params": {
|
|
37
|
-
* "channel": "ahp-root://",
|
|
38
|
-
* "resource": "https://api.github.com",
|
|
39
|
-
* "reason": "expired"
|
|
40
|
-
* }
|
|
41
|
-
* }
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export interface AuthRequiredParams {
|
|
45
|
-
/** Channel URI this notification belongs to */
|
|
46
|
-
channel: URI;
|
|
47
|
-
/** The protected resource identifier that requires authentication */
|
|
48
|
-
resource: string;
|
|
49
|
-
/** Why authentication is required */
|
|
50
|
-
reason?: AuthRequiredReason;
|
|
51
|
-
}
|