@codingame/monaco-vscode-xterm-common 30.0.0 → 31.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.
Files changed (30) hide show
  1. package/package.json +4 -4
  2. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +990 -0
  3. package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.js +56 -0
  4. package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.d.ts +179 -0
  5. package/vscode/src/vs/platform/agentHost/common/state/protocol/notifications.js +16 -0
  6. package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +1418 -0
  7. package/vscode/src/vs/platform/agentHost/common/state/protocol/state.js +118 -0
  8. package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +76 -0
  9. package/vscode/src/vs/platform/agentHost/common/state/sessionState.js +20 -0
  10. package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.d.ts +106 -0
  11. package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.js +276 -0
  12. package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.d.ts +56 -0
  13. package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.js +237 -0
  14. package/vscode/src/vs/workbench/contrib/terminal/browser/ahpTerminalCommandSource.d.ts +111 -0
  15. package/vscode/src/vs/workbench/contrib/terminal/browser/ahpTerminalCommandSource.js +138 -0
  16. package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +5 -5
  17. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +61 -61
  18. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.d.ts +9 -2
  19. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +79 -40
  20. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +8 -4
  21. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +5 -5
  22. package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +3 -3
  23. package/vscode/src/vs/workbench/contrib/terminal/common/basePty.d.ts +38 -0
  24. package/vscode/src/vs/workbench/contrib/terminal/common/basePty.js +127 -0
  25. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +3 -3
  26. package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +3 -3
  27. package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.d.ts +0 -38
  28. package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +0 -321
  29. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +0 -59
  30. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +0 -70
@@ -0,0 +1,237 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { Disposable, DisposableMap, toDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
5
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
6
+ import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
7
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
8
+ import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
9
+ import { AgentHostPty } from './agentHostPty.js';
10
+ import { AhpTerminalCommandSource } from './ahpTerminalCommandSource.js';
11
+ import { ITerminalService, ITerminalChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
12
+ import { ITerminalProfileService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/common/terminal.service';
13
+ import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
14
+ import { transaction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/transaction';
15
+
16
+ const AGENT_HOST_PROFILE_EXT_ID = "vscode.agent-host-terminal";
17
+ let AgentHostTerminalService = class AgentHostTerminalService extends Disposable {
18
+ constructor(
19
+ _terminalService,
20
+ _terminalChatService,
21
+ _terminalProfileService,
22
+ _quickInputService
23
+ ) {
24
+ super();
25
+ this._terminalService = _terminalService;
26
+ this._terminalChatService = _terminalChatService;
27
+ this._terminalProfileService = _terminalProfileService;
28
+ this._quickInputService = _quickInputService;
29
+ this._entries = [];
30
+ this._usedHosts = ( new Set());
31
+ this._profileRegistrations = this._register(( new DisposableMap()));
32
+ this._profiles = observableValue("agentHostTerminalProfiles", []);
33
+ this.profiles = this._profiles;
34
+ this._revivedInstances = ( new Map());
35
+ }
36
+ registerEntry(entry) {
37
+ this._entries.push(entry);
38
+ this._reconcile();
39
+ return toDisposable(() => {
40
+ const idx = this._entries.indexOf(entry);
41
+ if (idx >= 0) {
42
+ this._entries.splice(idx, 1);
43
+ this._reconcile();
44
+ }
45
+ });
46
+ }
47
+ getProfileForConnection(address) {
48
+ const entry = this._entries.find(e => e.address === address);
49
+ if (!entry) {
50
+ return undefined;
51
+ }
52
+ if (!( this._profileRegistrations.has(address))) {
53
+ this._usedHosts.add(address);
54
+ this._reconcile();
55
+ }
56
+ return this._profiles.get().find(p => p.address === address);
57
+ }
58
+ setDefaultCwd(cwd) {
59
+ this._defaultCwd = cwd;
60
+ }
61
+ _reconcile() {
62
+ const entries = this._entries;
63
+ const desiredProfiles = ( new Map());
64
+ if (entries.length === 0)
65
+ ; else if (entries.length === 1) {
66
+ desiredProfiles.set(entries[0].address, entries[0]);
67
+ } else {
68
+ let displaying = 0;
69
+ for (const address of this._usedHosts) {
70
+ const entry = entries.find(e => e.address === address);
71
+ if (entry) {
72
+ displaying++;
73
+ desiredProfiles.set(entry.address, entry);
74
+ }
75
+ }
76
+ if (displaying === entries.length - 1) {
77
+ const missing = entries.find(e => !( this._usedHosts.has(e.address)));
78
+ if (missing) {
79
+ desiredProfiles.set(missing.address, missing);
80
+ }
81
+ } else if (displaying < entries.length) {
82
+ desiredProfiles.set("__quickpick__", {
83
+ name: ( localize(13463, "Agent Host…")),
84
+ address: "__quickpick__",
85
+ getConnection: () => undefined
86
+ });
87
+ }
88
+ }
89
+ for (const [key, entry] of desiredProfiles) {
90
+ if (!( this._profileRegistrations.has(key))) {
91
+ this._registerProfile(key, entry, entries);
92
+ }
93
+ }
94
+ for (const key of ( this._profileRegistrations.keys())) {
95
+ if (!( desiredProfiles.has(key))) {
96
+ this._profileRegistrations.deleteAndDispose(key);
97
+ }
98
+ }
99
+ const infos = [];
100
+ for (const [key] of desiredProfiles) {
101
+ infos.push({
102
+ extensionIdentifier: AGENT_HOST_PROFILE_EXT_ID,
103
+ profileId: key,
104
+ title: key === "__quickpick__" ? ( localize(13463, "Agent Host…")) : ( localize(13464, "Agent Host ({0})", desiredProfiles.get(key).name)),
105
+ address: key
106
+ });
107
+ }
108
+ transaction(tx => {
109
+ this._profiles.set(infos, tx);
110
+ });
111
+ }
112
+ _registerProfile(key, entry, allEntries) {
113
+ const provider = {
114
+ createContributedTerminalProfile: async options => {
115
+ let connection;
116
+ let displayName = entry.name;
117
+ if (key === "__quickpick__") {
118
+ const picks = ( allEntries.map(e => ({
119
+ label: ( localize(13464, "Agent Host ({0})", e.name)),
120
+ address: e.address,
121
+ hostName: e.name
122
+ })));
123
+ const pick = await this._quickInputService.pick(picks, {
124
+ placeHolder: ( localize(13465, "Select an agent host to open a terminal on"))
125
+ });
126
+ if (!pick) {
127
+ return;
128
+ }
129
+ this._usedHosts.add(pick.address);
130
+ this._reconcile();
131
+ displayName = pick.hostName;
132
+ connection = allEntries.find(e => e.address === pick.address)?.getConnection();
133
+ } else {
134
+ connection = entry.getConnection();
135
+ }
136
+ if (!connection) {
137
+ return;
138
+ }
139
+ await this.createTerminal(connection, {
140
+ name: ( localize(13464, "Agent Host ({0})", displayName)),
141
+ cwd: options.cwd ? (typeof options.cwd === "string" ? URI.file(options.cwd) : options.cwd) : this._defaultCwd,
142
+ location: options.location
143
+ });
144
+ }
145
+ };
146
+ const title = key === "__quickpick__" ? ( localize(13463, "Agent Host…")) : ( localize(13464, "Agent Host ({0})", entry.name));
147
+ const store = ( new DisposableStore());
148
+ store.add(
149
+ this._terminalProfileService.registerTerminalProfileProvider(AGENT_HOST_PROFILE_EXT_ID, key, provider)
150
+ );
151
+ store.add(this._terminalProfileService.registerInternalContributedProfile({
152
+ extensionIdentifier: AGENT_HOST_PROFILE_EXT_ID,
153
+ id: key,
154
+ title,
155
+ icon: "remote"
156
+ }));
157
+ this._profileRegistrations.set(key, store);
158
+ }
159
+ async createTerminalForEntry(address, options) {
160
+ const entry = this._entries.find(e => e.address === address);
161
+ if (!entry) {
162
+ return undefined;
163
+ }
164
+ const connection = entry.getConnection();
165
+ if (!connection) {
166
+ return undefined;
167
+ }
168
+ return this.createTerminal(connection, options);
169
+ }
170
+ async createTerminal(connection, options) {
171
+ const terminalUri = ( URI.from({
172
+ scheme: "agenthost-terminal",
173
+ path: `/${generateUuid()}`
174
+ }));
175
+ const name = options?.name ?? ( localize(13466, "Agent Host Terminal"));
176
+ return this._terminalService.createTerminal({
177
+ config: {
178
+ customPtyImplementation: (id, cols, rows) => {
179
+ const pty = ( new AgentHostPty(id, connection, terminalUri, {
180
+ name,
181
+ cwd: options?.cwd
182
+ }));
183
+ if (cols > 0 && rows > 0) {
184
+ pty.resize(cols, rows);
185
+ }
186
+ return pty;
187
+ },
188
+ name,
189
+ icon: {
190
+ id: "remote"
191
+ },
192
+ isFeatureTerminal: false
193
+ },
194
+ location: options?.location
195
+ });
196
+ }
197
+ async reviveTerminal(connection, terminalUri, terminalToolSessionId) {
198
+ const key = ( terminalUri.toString());
199
+ const existing = this._revivedInstances.get(key);
200
+ if (existing) {
201
+ return existing;
202
+ }
203
+ const store = ( new DisposableStore());
204
+ const commandSource = store.add(( new AhpTerminalCommandSource()));
205
+ store.add(
206
+ this._terminalChatService.registerAhpCommandSource(terminalToolSessionId, commandSource)
207
+ );
208
+ const instance = await this._terminalService.createTerminal({
209
+ config: {
210
+ customPtyImplementation: (id, cols, rows) => {
211
+ const pty = ( new AgentHostPty(id, connection, terminalUri, {
212
+ attachOnly: true
213
+ }));
214
+ if (cols > 0 && rows > 0) {
215
+ pty.resize(cols, rows);
216
+ }
217
+ if (!store.isDisposed) {
218
+ commandSource.connect(instance, pty);
219
+ }
220
+ return pty;
221
+ },
222
+ name: ( localize(13467, "Agent Host Terminal")),
223
+ isFeatureTerminal: true
224
+ }
225
+ });
226
+ this._terminalChatService.registerTerminalInstanceWithToolSession(terminalToolSessionId, instance);
227
+ this._revivedInstances.set(key, instance);
228
+ instance.store.add(store);
229
+ this._register(instance.onDisposed(() => {
230
+ this._revivedInstances.delete(key);
231
+ }));
232
+ return instance;
233
+ }
234
+ };
235
+ AgentHostTerminalService = ( __decorate([( __param(0, ITerminalService)), ( __param(1, ITerminalChatService)), ( __param(2, ITerminalProfileService)), ( __param(3, IQuickInputService))], AgentHostTerminalService));
236
+
237
+ export { AgentHostTerminalService };
@@ -0,0 +1,111 @@
1
+ import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
2
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
3
+ import type { IMarker } from "@xterm/xterm";
4
+ import { type ITerminalCommand, type IMarkProperties } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities";
5
+ import type { ITerminalOutputMatch, ITerminalOutputMatcher } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal";
6
+ import type { IAhpTerminalCommandSource, ITerminalInstance } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
7
+ import { AhpCommandMarkKind, type AgentHostPty } from "./agentHostPty.js";
8
+ /**
9
+ * An implementation of {@link ITerminalCommand} backed by AHP protocol data
10
+ * rather than local shell integration markers. For streaming commands (arriving
11
+ * after initial subscription), real xterm markers are registered via
12
+ * {@link ITerminalInstance.registerMarker}. For replayed commands (from state
13
+ * snapshot), stored VT output is used as a fallback since marker positions are
14
+ * unreliable during bulk replay.
15
+ */
16
+ export declare class AhpTerminalCommand implements ITerminalCommand {
17
+ command: string;
18
+ readonly commandLineConfidence: "low" | "medium" | "high";
19
+ readonly isTrusted: boolean;
20
+ timestamp: number;
21
+ duration: number;
22
+ readonly id: string;
23
+ readonly cwd: string | undefined;
24
+ exitCode: number | undefined;
25
+ readonly commandStartLineContent: string | undefined;
26
+ readonly markProperties: IMarkProperties | undefined;
27
+ readonly executedX: number | undefined;
28
+ readonly startX: number | undefined;
29
+ readonly promptStartMarker?: IMarker;
30
+ readonly marker?: IMarker;
31
+ readonly aliases?: string[][];
32
+ readonly wasReplayed?: boolean;
33
+ /**
34
+ * Lazily resolved executed marker. Uses a getter so that the marker is
35
+ * resolved on first access rather than at construction time, giving xterm
36
+ * a chance to flush the SetMark sequence through its async write queue.
37
+ */
38
+ get executedMarker(): IMarker | undefined;
39
+ private _executedMarker;
40
+ /**
41
+ * Lazily resolved end marker, same rationale as {@link executedMarker}.
42
+ */
43
+ get endMarker(): IMarker | undefined;
44
+ set endMarker(value: IMarker | undefined);
45
+ private _endMarker;
46
+ private _isComplete;
47
+ /**
48
+ * Stored VT output from the AHP content part. Used as a fallback when
49
+ * xterm markers are not available (e.g. during content replay).
50
+ */
51
+ private _storedOutput;
52
+ /**
53
+ * Optional function to lazily resolve markers from the terminal's
54
+ * {@link IBufferMarkCapability}. Set during construction.
55
+ */
56
+ private readonly _resolveMarker?;
57
+ constructor(commandId: string, commandLine: string, timestamp: number, options?: {
58
+ resolveMarker?: (kind: AhpCommandMarkKind) => IMarker | undefined;
59
+ storedOutput?: string;
60
+ wasReplayed?: boolean;
61
+ });
62
+ extractCommandLine(): string;
63
+ getOutput(): string | undefined;
64
+ /**
65
+ * Get the raw VT output (with ANSI escape codes preserved).
66
+ * Used by the terminal mirror for rendering.
67
+ */
68
+ getRawOutput(): string | undefined;
69
+ hasOutput(): boolean;
70
+ getOutputMatch(_outputMatcher: ITerminalOutputMatcher): ITerminalOutputMatch | undefined;
71
+ getPromptRowCount(): number;
72
+ getCommandRowCount(): number;
73
+ /**
74
+ * Append VT output to the stored output buffer. Called during streaming
75
+ * as `terminal/data` actions arrive.
76
+ */
77
+ appendOutput(data: string): void;
78
+ /**
79
+ * Mark this command as finished with the given exit code and duration.
80
+ */
81
+ finish(exitCode: number | undefined, durationMs: number | undefined): void;
82
+ }
83
+ /**
84
+ * A command detection source for AHP terminals. Listens to
85
+ * {@link AgentHostPty} command lifecycle events and maintains a list of
86
+ * {@link AhpTerminalCommand} objects, exposing an interface compatible with
87
+ * {@link IAhpTerminalCommandSource}.
88
+ */
89
+ export declare class AhpTerminalCommandSource extends Disposable implements IAhpTerminalCommandSource {
90
+ private readonly _commands;
91
+ private _executingCommand;
92
+ private readonly _onCommandExecuted;
93
+ readonly onCommandExecuted: Event<ITerminalCommand>;
94
+ private readonly _onCommandFinished;
95
+ readonly onCommandFinished: Event<ITerminalCommand>;
96
+ private _terminalInstance;
97
+ get commands(): readonly ITerminalCommand[];
98
+ get executingCommandObject(): ITerminalCommand | undefined;
99
+ connect(terminalInstance: ITerminalInstance, pty: AgentHostPty): void;
100
+ getCommandById(id: string): ITerminalCommand | undefined;
101
+ /**
102
+ * Resolves an xterm marker by its AHP command mark ID from the
103
+ * {@link IBufferMarkCapability}. The marker is placed by xterm's OSC 633
104
+ * parser when it processes the SetMark sequence injected by
105
+ * {@link AgentHostPty}, so it is always at the correct cursor position
106
+ * regardless of whether the data was replayed or streamed.
107
+ */
108
+ private _resolveMarkById;
109
+ private _handleCommandExecuted;
110
+ private _handleCommandFinished;
111
+ }
@@ -0,0 +1,138 @@
1
+
2
+ import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
3
+ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
+ import { removeAnsiEscapeCodes } from '@codingame/monaco-vscode-api/vscode/vs/base/common/strings';
5
+ import { TerminalCapability } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities';
6
+ import { AhpCommandMarkKind, getAhpCommandMarkId } from './agentHostPty.js';
7
+
8
+ class AhpTerminalCommand {
9
+ get executedMarker() {
10
+ if (this._executedMarker === undefined && this._resolveMarker) {
11
+ this._executedMarker = this._resolveMarker(AhpCommandMarkKind.Executed);
12
+ }
13
+ return this._executedMarker;
14
+ }
15
+ get endMarker() {
16
+ if (this._endMarker === undefined && this._isComplete && this._resolveMarker) {
17
+ this._endMarker = this._resolveMarker(AhpCommandMarkKind.End);
18
+ }
19
+ return this._endMarker;
20
+ }
21
+ set endMarker(value) {
22
+ this._endMarker = value;
23
+ }
24
+ constructor(commandId, commandLine, timestamp, options) {
25
+ this.commandLineConfidence = "high";
26
+ this.isTrusted = false;
27
+ this.duration = 0;
28
+ this.cwd = undefined;
29
+ this.exitCode = undefined;
30
+ this.commandStartLineContent = undefined;
31
+ this.markProperties = undefined;
32
+ this.executedX = undefined;
33
+ this.startX = undefined;
34
+ this._isComplete = false;
35
+ this.id = commandId;
36
+ this.command = commandLine;
37
+ this.timestamp = timestamp;
38
+ this._resolveMarker = options?.resolveMarker;
39
+ this._storedOutput = options?.storedOutput;
40
+ this.wasReplayed = options?.wasReplayed;
41
+ }
42
+ extractCommandLine() {
43
+ return this.command;
44
+ }
45
+ getOutput() {
46
+ return this._storedOutput !== undefined ? removeAnsiEscapeCodes(this._storedOutput) : undefined;
47
+ }
48
+ getRawOutput() {
49
+ return this._storedOutput;
50
+ }
51
+ hasOutput() {
52
+ if (this._storedOutput !== undefined) {
53
+ return this._storedOutput.length > 0;
54
+ }
55
+ return false;
56
+ }
57
+ getOutputMatch(_outputMatcher) {
58
+ return undefined;
59
+ }
60
+ getPromptRowCount() {
61
+ return 1;
62
+ }
63
+ getCommandRowCount() {
64
+ return 1;
65
+ }
66
+ appendOutput(data) {
67
+ if (this._storedOutput === undefined) {
68
+ this._storedOutput = data;
69
+ } else {
70
+ this._storedOutput += data;
71
+ }
72
+ }
73
+ finish(exitCode, durationMs) {
74
+ this.exitCode = exitCode;
75
+ this.duration = durationMs ?? 0;
76
+ this._isComplete = true;
77
+ }
78
+ }
79
+ class AhpTerminalCommandSource extends Disposable {
80
+ constructor() {
81
+ super(...arguments);
82
+ this._commands = [];
83
+ this._onCommandExecuted = this._register(( new Emitter()));
84
+ this.onCommandExecuted = this._onCommandExecuted.event;
85
+ this._onCommandFinished = this._register(( new Emitter()));
86
+ this.onCommandFinished = this._onCommandFinished.event;
87
+ }
88
+ get commands() {
89
+ return this._commands;
90
+ }
91
+ get executingCommandObject() {
92
+ return this._executingCommand;
93
+ }
94
+ connect(terminalInstance, pty) {
95
+ this._terminalInstance = terminalInstance;
96
+ this._register(pty.onCommandExecuted(e => this._handleCommandExecuted(e)));
97
+ this._register(pty.onCommandFinished(e => this._handleCommandFinished(e)));
98
+ this._register(terminalInstance.onWillData(data => {
99
+ if (this._executingCommand && !this._executingCommand.wasReplayed) {
100
+ this._executingCommand.appendOutput(data);
101
+ }
102
+ }));
103
+ }
104
+ getCommandById(id) {
105
+ if (this._executingCommand?.id === id) {
106
+ return this._executingCommand;
107
+ }
108
+ return this._commands.find(c => c.id === id);
109
+ }
110
+ _resolveMarkById(commandId, kind) {
111
+ const markId = getAhpCommandMarkId(commandId, kind);
112
+ const bufferMarkCapability = this._terminalInstance?.capabilities.get(TerminalCapability.BufferMarkDetection);
113
+ return bufferMarkCapability?.getMark(markId);
114
+ }
115
+ _handleCommandExecuted(event) {
116
+ const command = ( new AhpTerminalCommand(event.commandId, event.commandLine, event.timestamp, {
117
+ resolveMarker: kind => this._resolveMarkById(event.commandId, kind),
118
+ storedOutput: event.storedOutput,
119
+ wasReplayed: event.storedOutput !== undefined
120
+ }));
121
+ this._executingCommand = command;
122
+ this._onCommandExecuted.fire(command);
123
+ }
124
+ _handleCommandFinished(event) {
125
+ const command = this._executingCommand?.id === event.commandId ? this._executingCommand : this._commands.find(c => c.id === event.commandId);
126
+ if (!command) {
127
+ return;
128
+ }
129
+ command.finish(event.exitCode, event.durationMs);
130
+ if (this._executingCommand === command) {
131
+ this._executingCommand = undefined;
132
+ this._commands.push(command);
133
+ }
134
+ this._onCommandFinished.fire(command);
135
+ }
136
+ }
137
+
138
+ export { AhpTerminalCommand, AhpTerminalCommandSource };
@@ -24,7 +24,7 @@ let EnvironmentVariableInfoStale = class EnvironmentVariableInfoStale {
24
24
  addExtensionIdentifiers(extSet, ( this._diff.removed.values()));
25
25
  addExtensionIdentifiers(extSet, ( this._diff.changed.values()));
26
26
  let message = ( localize(
27
- 13332,
27
+ 13472,
28
28
  "The following extensions want to relaunch the terminal to contribute to its environment:"
29
29
  ));
30
30
  message += getMergedDescription(this._collection, scope, this._extensionService, extSet);
@@ -32,7 +32,7 @@ let EnvironmentVariableInfoStale = class EnvironmentVariableInfoStale {
32
32
  }
33
33
  _getActions() {
34
34
  return [{
35
- label: ( localize(13333, "Relaunch Terminal")),
35
+ label: ( localize(13473, "Relaunch Terminal")),
36
36
  run: () => this._terminalService.getInstanceFromId(this._terminalId)?.relaunch(),
37
37
  commandId: TerminalCommandId.Relaunch
38
38
  }];
@@ -59,7 +59,7 @@ let EnvironmentVariableInfoChangesActive = class EnvironmentVariableInfoChangesA
59
59
  const extSet = ( new Set());
60
60
  addExtensionIdentifiers(extSet, ( this._collection.getVariableMap(scope).values()));
61
61
  let message = ( localize(
62
- 13334,
62
+ 13474,
63
63
  "The following extensions have contributed to this terminal's environment:"
64
64
  ));
65
65
  message += getMergedDescription(this._collection, scope, this._extensionService, extSet);
@@ -67,7 +67,7 @@ let EnvironmentVariableInfoChangesActive = class EnvironmentVariableInfoChangesA
67
67
  }
68
68
  _getActions(scope) {
69
69
  return [{
70
- label: ( localize(13335, "Show Environment Contributions")),
70
+ label: ( localize(13475, "Show Environment Contributions")),
71
71
  run: () => this._commandService.executeCommand(TerminalCommandId.ShowEnvironmentContributions, scope),
72
72
  commandId: TerminalCommandId.ShowEnvironmentContributions
73
73
  }];
@@ -95,7 +95,7 @@ function getMergedDescription(collection, scope, extensionService, extSet) {
95
95
  }
96
96
  const workspaceDescription = workspaceDescriptions.get(ext);
97
97
  if (workspaceDescription) {
98
- const workspaceSuffix = globalDescription ? ` (${( localize(13336, "workspace"))})` : "";
98
+ const workspaceSuffix = globalDescription ? ` (${( localize(13476, "workspace"))})` : "";
99
99
  message.push(`\n- \`${getExtensionName(ext, extensionService)}${workspaceSuffix}\``);
100
100
  message.push(`: ${workspaceDescription}`);
101
101
  }