@codingame/monaco-vscode-xterm-common 37.2.0 → 37.3.1
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 +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +39 -39
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.js +3 -3
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.d.ts +0 -11
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +0 -26
- package/vscode/src/vs/platform/terminal/common/environmentVariable.d.ts +0 -86
- package/vscode/src/vs/platform/terminal/common/environmentVariable.js +0 -10
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.d.ts +0 -17
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +0 -218
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.d.ts +0 -14
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +0 -84
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostOutputChannel.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostOutputChannel.js +0 -48
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.d.ts +0 -129
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostPty.js +0 -439
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.d.ts +0 -77
- package/vscode/src/vs/workbench/contrib/terminal/browser/agentHostTerminalService.js +0 -345
- package/vscode/src/vs/workbench/contrib/terminal/browser/ahpTerminalCommandSource.d.ts +0 -111
- package/vscode/src/vs/workbench/contrib/terminal/browser/ahpTerminalCommandSource.js +0 -138
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +0 -119
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.d.ts +0 -104
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +0 -1643
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.d.ts +0 -19
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +0 -54
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.js +0 -78
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.d.ts +0 -144
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +0 -806
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +0 -83
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +0 -139
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.d.ts +0 -45
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +0 -804
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +0 -75
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +0 -61
- package/vscode/src/vs/workbench/contrib/terminal/common/basePty.d.ts +0 -38
- package/vscode/src/vs/workbench/contrib/terminal/common/basePty.js +0 -127
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.d.ts +0 -38
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +0 -321
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStorageKeys.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStorageKeys.js +0 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css +0 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +0 -25
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.d.ts +0 -58
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +0 -462
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { isWindows } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
3
|
-
import { EnvironmentVariableMutatorType } from './environmentVariable.js';
|
|
4
|
-
|
|
5
|
-
const mutatorTypeToLabelMap = ( new Map([
|
|
6
|
-
[EnvironmentVariableMutatorType.Append, "APPEND"],
|
|
7
|
-
[EnvironmentVariableMutatorType.Prepend, "PREPEND"],
|
|
8
|
-
[EnvironmentVariableMutatorType.Replace, "REPLACE"]
|
|
9
|
-
]));
|
|
10
|
-
const PYTHON_ACTIVATION_VARS_PATTERN = /^VSCODE_PYTHON_(PWSH|ZSH|BASH|FISH)_ACTIVATE/;
|
|
11
|
-
const PYTHON_ENV_EXTENSION_ID = "ms-python.vscode-python-envs";
|
|
12
|
-
class MergedEnvironmentVariableCollection {
|
|
13
|
-
constructor(collections) {
|
|
14
|
-
this.collections = collections;
|
|
15
|
-
this.map = ( new Map());
|
|
16
|
-
this.descriptionMap = ( new Map());
|
|
17
|
-
collections.forEach((collection, extensionIdentifier) => {
|
|
18
|
-
this.populateDescriptionMap(collection, extensionIdentifier);
|
|
19
|
-
const it = collection.map.entries();
|
|
20
|
-
let next = it.next();
|
|
21
|
-
while (!next.done) {
|
|
22
|
-
const mutator = next.value[1];
|
|
23
|
-
const key = next.value[0];
|
|
24
|
-
if (this.blockPythonActivationVar(key, extensionIdentifier)) {
|
|
25
|
-
next = it.next();
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
let entry = this.map.get(key);
|
|
29
|
-
if (!entry) {
|
|
30
|
-
entry = [];
|
|
31
|
-
this.map.set(key, entry);
|
|
32
|
-
}
|
|
33
|
-
if (entry.length > 0 && entry[0].type === EnvironmentVariableMutatorType.Replace) {
|
|
34
|
-
next = it.next();
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
const extensionMutator = {
|
|
38
|
-
extensionIdentifier,
|
|
39
|
-
value: mutator.value,
|
|
40
|
-
type: mutator.type,
|
|
41
|
-
scope: mutator.scope,
|
|
42
|
-
variable: mutator.variable,
|
|
43
|
-
options: mutator.options
|
|
44
|
-
};
|
|
45
|
-
if (!extensionMutator.scope) {
|
|
46
|
-
delete extensionMutator.scope;
|
|
47
|
-
}
|
|
48
|
-
entry.unshift(extensionMutator);
|
|
49
|
-
next = it.next();
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
async applyToProcessEnvironment(env, scope, variableResolver) {
|
|
54
|
-
let lowerToActualVariableNames;
|
|
55
|
-
if (isWindows) {
|
|
56
|
-
lowerToActualVariableNames = {};
|
|
57
|
-
( Object.keys(env)).forEach(e => lowerToActualVariableNames[e.toLowerCase()] = e);
|
|
58
|
-
}
|
|
59
|
-
for (const [variable, mutators] of this.getVariableMap(scope)) {
|
|
60
|
-
const actualVariable = isWindows ? lowerToActualVariableNames[variable.toLowerCase()] || variable : variable;
|
|
61
|
-
for (const mutator of mutators) {
|
|
62
|
-
const value = variableResolver ? await variableResolver(mutator.value) : mutator.value;
|
|
63
|
-
if (this.blockPythonActivationVar(mutator.variable, mutator.extensionIdentifier)) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
if (mutator.options?.applyAtProcessCreation ?? true) {
|
|
67
|
-
switch (mutator.type) {
|
|
68
|
-
case EnvironmentVariableMutatorType.Append:
|
|
69
|
-
env[actualVariable] = (env[actualVariable] || "") + value;
|
|
70
|
-
break;
|
|
71
|
-
case EnvironmentVariableMutatorType.Prepend:
|
|
72
|
-
env[actualVariable] = value + (env[actualVariable] || "");
|
|
73
|
-
break;
|
|
74
|
-
case EnvironmentVariableMutatorType.Replace:
|
|
75
|
-
env[actualVariable] = value;
|
|
76
|
-
break;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (mutator.options?.applyAtShellIntegration ?? false) {
|
|
80
|
-
const key = `VSCODE_ENV_${mutatorTypeToLabelMap.get(mutator.type)}`;
|
|
81
|
-
env[key] = (env[key] ? env[key] + ":" : "") + variable + "=" + this._encodeColons(value);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
_encodeColons(value) {
|
|
87
|
-
return value.replaceAll(":", "\\x3a");
|
|
88
|
-
}
|
|
89
|
-
blockPythonActivationVar(variable, extensionIdentifier) {
|
|
90
|
-
if (PYTHON_ACTIVATION_VARS_PATTERN.test(variable) && PYTHON_ENV_EXTENSION_ID !== extensionIdentifier) {
|
|
91
|
-
return true;
|
|
92
|
-
}
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
diff(other, scope) {
|
|
96
|
-
const added = ( new Map());
|
|
97
|
-
const changed = ( new Map());
|
|
98
|
-
const removed = ( new Map());
|
|
99
|
-
other.getVariableMap(scope).forEach((otherMutators, variable) => {
|
|
100
|
-
const currentMutators = this.getVariableMap(scope).get(variable);
|
|
101
|
-
const result = getMissingMutatorsFromArray(otherMutators, currentMutators);
|
|
102
|
-
if (result) {
|
|
103
|
-
added.set(variable, result);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
this.getVariableMap(scope).forEach((currentMutators, variable) => {
|
|
107
|
-
const otherMutators = other.getVariableMap(scope).get(variable);
|
|
108
|
-
const result = getMissingMutatorsFromArray(currentMutators, otherMutators);
|
|
109
|
-
if (result) {
|
|
110
|
-
removed.set(variable, result);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
this.getVariableMap(scope).forEach((currentMutators, variable) => {
|
|
114
|
-
const otherMutators = other.getVariableMap(scope).get(variable);
|
|
115
|
-
const result = getChangedMutatorsFromArray(currentMutators, otherMutators);
|
|
116
|
-
if (result) {
|
|
117
|
-
changed.set(variable, result);
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
if (added.size === 0 && changed.size === 0 && removed.size === 0) {
|
|
121
|
-
return undefined;
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
added,
|
|
125
|
-
changed,
|
|
126
|
-
removed
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
getVariableMap(scope) {
|
|
130
|
-
const result = ( new Map());
|
|
131
|
-
for (const mutators of ( this.map.values())) {
|
|
132
|
-
const filteredMutators = mutators.filter(m => filterScope(m, scope));
|
|
133
|
-
if (filteredMutators.length > 0) {
|
|
134
|
-
result.set(filteredMutators[0].variable, filteredMutators);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return result;
|
|
138
|
-
}
|
|
139
|
-
getDescriptionMap(scope) {
|
|
140
|
-
const result = ( new Map());
|
|
141
|
-
for (const mutators of ( this.descriptionMap.values())) {
|
|
142
|
-
const filteredMutators = mutators.filter(m => filterScope(m, scope, true));
|
|
143
|
-
for (const mutator of filteredMutators) {
|
|
144
|
-
result.set(mutator.extensionIdentifier, mutator.description);
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return result;
|
|
148
|
-
}
|
|
149
|
-
populateDescriptionMap(collection, extensionIdentifier) {
|
|
150
|
-
if (!collection.descriptionMap) {
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
const it = collection.descriptionMap.entries();
|
|
154
|
-
let next = it.next();
|
|
155
|
-
while (!next.done) {
|
|
156
|
-
const mutator = next.value[1];
|
|
157
|
-
const key = next.value[0];
|
|
158
|
-
let entry = this.descriptionMap.get(key);
|
|
159
|
-
if (!entry) {
|
|
160
|
-
entry = [];
|
|
161
|
-
this.descriptionMap.set(key, entry);
|
|
162
|
-
}
|
|
163
|
-
const extensionMutator = {
|
|
164
|
-
extensionIdentifier,
|
|
165
|
-
scope: mutator.scope,
|
|
166
|
-
description: mutator.description
|
|
167
|
-
};
|
|
168
|
-
if (!extensionMutator.scope) {
|
|
169
|
-
delete extensionMutator.scope;
|
|
170
|
-
}
|
|
171
|
-
entry.push(extensionMutator);
|
|
172
|
-
next = it.next();
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
function filterScope(mutator, scope, strictFilter = false) {
|
|
177
|
-
if (!mutator.scope) {
|
|
178
|
-
if (strictFilter) {
|
|
179
|
-
return scope === mutator.scope;
|
|
180
|
-
}
|
|
181
|
-
return true;
|
|
182
|
-
}
|
|
183
|
-
if (mutator.scope.workspaceFolder && scope?.workspaceFolder && mutator.scope.workspaceFolder.index === scope.workspaceFolder.index) {
|
|
184
|
-
return true;
|
|
185
|
-
}
|
|
186
|
-
return false;
|
|
187
|
-
}
|
|
188
|
-
function getMissingMutatorsFromArray(current, other) {
|
|
189
|
-
if (!other) {
|
|
190
|
-
return current;
|
|
191
|
-
}
|
|
192
|
-
const otherMutatorExtensions = ( new Set());
|
|
193
|
-
other.forEach(m => otherMutatorExtensions.add(m.extensionIdentifier));
|
|
194
|
-
const result = [];
|
|
195
|
-
current.forEach(mutator => {
|
|
196
|
-
if (!( otherMutatorExtensions.has(mutator.extensionIdentifier))) {
|
|
197
|
-
result.push(mutator);
|
|
198
|
-
}
|
|
199
|
-
});
|
|
200
|
-
return result.length === 0 ? undefined : result;
|
|
201
|
-
}
|
|
202
|
-
function getChangedMutatorsFromArray(current, other) {
|
|
203
|
-
if (!other) {
|
|
204
|
-
return undefined;
|
|
205
|
-
}
|
|
206
|
-
const otherMutatorExtensions = ( new Map());
|
|
207
|
-
other.forEach(m => otherMutatorExtensions.set(m.extensionIdentifier, m));
|
|
208
|
-
const result = [];
|
|
209
|
-
current.forEach(mutator => {
|
|
210
|
-
const otherMutator = otherMutatorExtensions.get(mutator.extensionIdentifier);
|
|
211
|
-
if (otherMutator && (mutator.type !== otherMutator.type || mutator.value !== otherMutator.value || mutator.scope?.workspaceFolder?.index !== otherMutator.scope?.workspaceFolder?.index)) {
|
|
212
|
-
result.push(otherMutator);
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
return result.length === 0 ? undefined : result;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export { MergedEnvironmentVariableCollection };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { IPtyHostProcessReplayEvent } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities";
|
|
2
|
-
import { ReplayEntry } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminalProcess";
|
|
3
|
-
export interface IRemoteTerminalProcessReplayEvent {
|
|
4
|
-
events: ReplayEntry[];
|
|
5
|
-
}
|
|
6
|
-
export declare class TerminalRecorder {
|
|
7
|
-
private _entries;
|
|
8
|
-
private _totalDataLength;
|
|
9
|
-
constructor(cols: number, rows: number);
|
|
10
|
-
handleResize(cols: number, rows: number): void;
|
|
11
|
-
handleData(data: string): void;
|
|
12
|
-
generateReplayEventSync(): IPtyHostProcessReplayEvent;
|
|
13
|
-
generateReplayEvent(): Promise<IPtyHostProcessReplayEvent>;
|
|
14
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var Constants;
|
|
4
|
-
(function(Constants) {
|
|
5
|
-
Constants[Constants["MaxRecorderDataSize"] = 10485760] = "MaxRecorderDataSize";
|
|
6
|
-
})(Constants || (Constants = {}));
|
|
7
|
-
class TerminalRecorder {
|
|
8
|
-
constructor(cols, rows) {
|
|
9
|
-
this._totalDataLength = 0;
|
|
10
|
-
this._entries = [{
|
|
11
|
-
cols,
|
|
12
|
-
rows,
|
|
13
|
-
data: []
|
|
14
|
-
}];
|
|
15
|
-
}
|
|
16
|
-
handleResize(cols, rows) {
|
|
17
|
-
if (this._entries.length > 0) {
|
|
18
|
-
const lastEntry = this._entries[this._entries.length - 1];
|
|
19
|
-
if (lastEntry.data.length === 0) {
|
|
20
|
-
this._entries.pop();
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (this._entries.length > 0) {
|
|
24
|
-
const lastEntry = this._entries[this._entries.length - 1];
|
|
25
|
-
if (lastEntry.cols === cols && lastEntry.rows === rows) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (lastEntry.cols === 0 && lastEntry.rows === 0) {
|
|
29
|
-
lastEntry.cols = cols;
|
|
30
|
-
lastEntry.rows = rows;
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
this._entries.push({
|
|
35
|
-
cols,
|
|
36
|
-
rows,
|
|
37
|
-
data: []
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
handleData(data) {
|
|
41
|
-
const lastEntry = this._entries[this._entries.length - 1];
|
|
42
|
-
lastEntry.data.push(data);
|
|
43
|
-
this._totalDataLength += data.length;
|
|
44
|
-
while (this._totalDataLength > Constants.MaxRecorderDataSize) {
|
|
45
|
-
const firstEntry = this._entries[0];
|
|
46
|
-
const remainingToDelete = this._totalDataLength - Constants.MaxRecorderDataSize;
|
|
47
|
-
if (remainingToDelete >= firstEntry.data[0].length) {
|
|
48
|
-
this._totalDataLength -= firstEntry.data[0].length;
|
|
49
|
-
firstEntry.data.shift();
|
|
50
|
-
if (firstEntry.data.length === 0) {
|
|
51
|
-
this._entries.shift();
|
|
52
|
-
}
|
|
53
|
-
} else {
|
|
54
|
-
firstEntry.data[0] = firstEntry.data[0].substr(remainingToDelete);
|
|
55
|
-
this._totalDataLength -= remainingToDelete;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
generateReplayEventSync() {
|
|
60
|
-
this._entries.forEach(entry => {
|
|
61
|
-
if (entry.data.length > 0) {
|
|
62
|
-
entry.data = [entry.data.join("")];
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return {
|
|
66
|
-
events: ( this._entries.map(entry => ({
|
|
67
|
-
cols: entry.cols,
|
|
68
|
-
rows: entry.rows,
|
|
69
|
-
data: entry.data[0] ?? ""
|
|
70
|
-
}))),
|
|
71
|
-
commands: {
|
|
72
|
-
isWindowsPty: false,
|
|
73
|
-
hasRichCommandDetection: false,
|
|
74
|
-
commands: [],
|
|
75
|
-
promptInputModel: undefined
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
async generateReplayEvent() {
|
|
80
|
-
return this.generateReplayEventSync();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export { TerminalRecorder };
|
|
@@ -1,22 +0,0 @@
|
|
|
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 { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
-
import { IAgentConnection } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService";
|
|
5
|
-
import type { IChatTerminalOutputSource } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
6
|
-
/**
|
|
7
|
-
* Read-only view of an AHP output channel. Unlike {@link AgentHostPty}, this
|
|
8
|
-
* does not create a terminal process or an {@code ITerminalInstance}; chat
|
|
9
|
-
* renders the accumulated plain-text state in its own detached xterm.
|
|
10
|
-
*/
|
|
11
|
-
export declare class AgentHostOutputChannel extends Disposable implements IChatTerminalOutputSource {
|
|
12
|
-
private readonly _onDidChange;
|
|
13
|
-
readonly onDidChange: Event<void>;
|
|
14
|
-
private _output;
|
|
15
|
-
get output(): string;
|
|
16
|
-
private _hasExited;
|
|
17
|
-
get hasExited(): boolean;
|
|
18
|
-
private _exitCode;
|
|
19
|
-
get exitCode(): number | undefined;
|
|
20
|
-
constructor(connection: IAgentConnection, terminalUri: URI);
|
|
21
|
-
private _acceptState;
|
|
22
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
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 '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-root/state';
|
|
5
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-session/state';
|
|
6
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-chat/state';
|
|
7
|
-
import { TerminalLifecycleStatus } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-terminal/state';
|
|
8
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-changeset/state';
|
|
9
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-resource-watch/state';
|
|
10
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-automation/state';
|
|
11
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/channels-automation-run/state';
|
|
12
|
-
import { StateComponents } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
|
|
13
|
-
|
|
14
|
-
class AgentHostOutputChannel extends Disposable {
|
|
15
|
-
get output() {
|
|
16
|
-
return this._output;
|
|
17
|
-
}
|
|
18
|
-
get hasExited() {
|
|
19
|
-
return this._hasExited;
|
|
20
|
-
}
|
|
21
|
-
get exitCode() {
|
|
22
|
-
return this._exitCode;
|
|
23
|
-
}
|
|
24
|
-
constructor(connection, terminalUri) {
|
|
25
|
-
super();
|
|
26
|
-
this._onDidChange = this._register(( new Emitter()));
|
|
27
|
-
this.onDidChange = this._onDidChange.event;
|
|
28
|
-
this._output = "";
|
|
29
|
-
this._hasExited = false;
|
|
30
|
-
const subscriptionRef = this._register(
|
|
31
|
-
connection.getSubscription(StateComponents.Terminal, terminalUri, "AgentHostOutputChannel")
|
|
32
|
-
);
|
|
33
|
-
const subscription = subscriptionRef.object;
|
|
34
|
-
if (subscription.value && !(subscription.value instanceof Error)) {
|
|
35
|
-
this._acceptState(subscription.value);
|
|
36
|
-
}
|
|
37
|
-
this._register(subscription.onDidChange(state => this._acceptState(state)));
|
|
38
|
-
}
|
|
39
|
-
_acceptState(state) {
|
|
40
|
-
this._output = ( state.content.map(part => part.type === "command" ? part.output : part.value)).join("").replace(/\r?\n/g, "\r\n");
|
|
41
|
-
const lifecycle = state.lifecycle;
|
|
42
|
-
this._hasExited = lifecycle.status === TerminalLifecycleStatus.Exited;
|
|
43
|
-
this._exitCode = lifecycle.status === TerminalLifecycleStatus.Exited ? lifecycle.exitCode : undefined;
|
|
44
|
-
this._onDidChange.fire();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export { AgentHostOutputChannel };
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
-
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
3
|
-
import { IProcessPropertyMap, ITerminalChildProcess, ITerminalLaunchError, ITerminalLaunchResult, ProcessPropertyType } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal";
|
|
4
|
-
import { ITerminalLogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/terminal.service";
|
|
5
|
-
import { IAgentConnection } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService";
|
|
6
|
-
import { BasePty } from "../common/basePty.js";
|
|
7
|
-
/**
|
|
8
|
-
* Options for creating a new terminal on an agent host.
|
|
9
|
-
*/
|
|
10
|
-
export interface IAgentHostPtyOptions {
|
|
11
|
-
/** Human-readable terminal name. */
|
|
12
|
-
readonly name?: string;
|
|
13
|
-
/** Initial working directory URI. */
|
|
14
|
-
readonly cwd?: URI;
|
|
15
|
-
/**
|
|
16
|
-
* When true, attach to an existing terminal on the agent host instead of
|
|
17
|
-
* creating a new one. The terminal must already exist server-side (e.g.
|
|
18
|
-
* created by a tool). The pty will subscribe to its state and replay
|
|
19
|
-
* content without calling `createTerminal`.
|
|
20
|
-
*/
|
|
21
|
-
readonly attachOnly?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export interface IAgentHostPtyCommandExecutedEvent {
|
|
24
|
-
readonly commandId: string;
|
|
25
|
-
readonly commandLine: string;
|
|
26
|
-
readonly timestamp: number;
|
|
27
|
-
/** The stored VT output for this command (present during content replay). */
|
|
28
|
-
readonly storedOutput?: string;
|
|
29
|
-
}
|
|
30
|
-
export interface IAgentHostPtyCommandFinishedEvent {
|
|
31
|
-
readonly commandId: string;
|
|
32
|
-
readonly exitCode?: number;
|
|
33
|
-
readonly durationMs?: number;
|
|
34
|
-
}
|
|
35
|
-
export declare enum AhpCommandMarkKind {
|
|
36
|
-
Executed = "s",
|
|
37
|
-
End = "e"
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Generates the mark ID used to correlate SetMark VT codes with xterm markers
|
|
41
|
-
* via {@link IBufferMarkCapability.getMark}.
|
|
42
|
-
*/
|
|
43
|
-
export declare function getAhpCommandMarkId(commandId: string, kind: AhpCommandMarkKind): string;
|
|
44
|
-
/**
|
|
45
|
-
* A pseudo-terminal backed by an Agent Host Protocol terminal subscription.
|
|
46
|
-
*
|
|
47
|
-
* Uses `customPtyImplementation` on `IShellLaunchConfig` so the
|
|
48
|
-
* `TerminalProcessManager` bypasses the pty host backend entirely.
|
|
49
|
-
*
|
|
50
|
-
* Data flow:
|
|
51
|
-
* terminal/data → onProcessData
|
|
52
|
-
* terminal/exited → onProcessExit
|
|
53
|
-
* input(data) → dispatch terminal/input
|
|
54
|
-
* resize(c,r) → dispatch terminal/resized
|
|
55
|
-
* shutdown() → disposeTerminal command
|
|
56
|
-
*/
|
|
57
|
-
export declare class AgentHostPty extends BasePty implements ITerminalChildProcess {
|
|
58
|
-
private _connection;
|
|
59
|
-
private readonly _terminalUri;
|
|
60
|
-
private readonly _options;
|
|
61
|
-
private readonly _logService;
|
|
62
|
-
private readonly _startBarrier;
|
|
63
|
-
private readonly _lifetime;
|
|
64
|
-
private readonly _subscription;
|
|
65
|
-
private _terminalCreation;
|
|
66
|
-
private _initialCwd;
|
|
67
|
-
private _didSignalReady;
|
|
68
|
-
private readonly _onCommandExecuted;
|
|
69
|
-
readonly onCommandExecuted: Event<IAgentHostPtyCommandExecutedEvent>;
|
|
70
|
-
private readonly _onCommandFinished;
|
|
71
|
-
readonly onCommandFinished: Event<IAgentHostPtyCommandFinishedEvent>;
|
|
72
|
-
private readonly _onSupportsCommandDetection;
|
|
73
|
-
readonly onSupportsCommandDetection: Event<void>;
|
|
74
|
-
private _supportsCommandDetection;
|
|
75
|
-
get supportsCommandDetection(): boolean;
|
|
76
|
-
/**
|
|
77
|
-
* Command IDs for sentinel commands that should be suppressed from shell
|
|
78
|
-
* integration events. When the copilot shell tools fall back to sentinel-
|
|
79
|
-
* based exit code detection, shell integration may also detect the sentinel
|
|
80
|
-
* echo as a real command — we filter those out here.
|
|
81
|
-
*/
|
|
82
|
-
private readonly _suppressedCommandIds;
|
|
83
|
-
constructor(id: number, _connection: IAgentConnection, _terminalUri: URI, _options: IAgentHostPtyOptions | undefined, _logService: ITerminalLogService);
|
|
84
|
-
start(): Promise<ITerminalLaunchError | ITerminalLaunchResult | undefined>;
|
|
85
|
-
private _clearTerminalCreation;
|
|
86
|
-
private _signalReady;
|
|
87
|
-
private _handleAction;
|
|
88
|
-
/**
|
|
89
|
-
* Replays structured terminal content parts from the initial state snapshot.
|
|
90
|
-
* Emits command lifecycle events for command parts so that consumers
|
|
91
|
-
* (e.g. {@link AhpTerminalCommandSource}) can reconstruct command history.
|
|
92
|
-
*/
|
|
93
|
-
private _replayContent;
|
|
94
|
-
/**
|
|
95
|
-
* Resolves a cwd URI for sending over the protocol. Agent-host URIs
|
|
96
|
-
* are unwrapped to their original URI via {@link fromAgentHostUri}.
|
|
97
|
-
*/
|
|
98
|
-
private _resolveCwdForProtocol;
|
|
99
|
-
private _createSubscription;
|
|
100
|
-
private _waitForHydration;
|
|
101
|
-
input(data: string): void;
|
|
102
|
-
resize(cols: number, rows: number): void;
|
|
103
|
-
shutdown(_immediate: boolean): void;
|
|
104
|
-
private _requestHostTerminalDisposal;
|
|
105
|
-
private _disposeHostTerminal;
|
|
106
|
-
private _logHostDisposalError;
|
|
107
|
-
private _exitAndDispose;
|
|
108
|
-
getInitialCwd(): Promise<string>;
|
|
109
|
-
getCwd(): Promise<string>;
|
|
110
|
-
clearBuffer(): Promise<void>;
|
|
111
|
-
acknowledgeDataEvent(_charCount: number): void;
|
|
112
|
-
setUnicodeVersion(_version: "6" | "11"): Promise<void>;
|
|
113
|
-
processBinary(_data: string): Promise<void>;
|
|
114
|
-
sendSignal(_signal: string): void;
|
|
115
|
-
refreshProperty<T extends ProcessPropertyType>(type: T): Promise<IProcessPropertyMap[T]>;
|
|
116
|
-
updateProperty<T extends ProcessPropertyType>(_type: T, _value: IProcessPropertyMap[T]): Promise<void>;
|
|
117
|
-
/**
|
|
118
|
-
* Reconnect this pty to a new agent host connection. Tears down the
|
|
119
|
-
* old subscription and re-subscribes with the new connection, replaying
|
|
120
|
-
* content from the server-side snapshot. Terminal output during the
|
|
121
|
-
* disconnect gap is a stream (not state), so some loss is expected.
|
|
122
|
-
*
|
|
123
|
-
* @returns `true` if reconnection succeeded, `false` otherwise.
|
|
124
|
-
*/
|
|
125
|
-
reconnect(newConnection: IAgentConnection): Promise<boolean>;
|
|
126
|
-
/** The terminal URI this pty is subscribed to. */
|
|
127
|
-
get terminalUri(): URI;
|
|
128
|
-
dispose(): void;
|
|
129
|
-
}
|