@codingame/monaco-vscode-xterm-common 25.1.1 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +4 -4
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +2 -2
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +20 -16
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +20 -11
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +15 -21
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +386 -301
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +11 -2
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.js +4 -8
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.d.ts +0 -4
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +793 -549
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +225 -128
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +14 -5
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +23 -19
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +174 -126
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +29 -22
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +3 -1
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +112 -114
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +16 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.js +33 -23
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +115 -84
|
@@ -7,19 +7,20 @@ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode
|
|
|
7
7
|
import { TerminalStorageKeys } from '../common/terminalStorageKeys.js';
|
|
8
8
|
|
|
9
9
|
function getInstanceHoverInfo(instance, storageService) {
|
|
10
|
-
const showDetailed = parseInt(
|
|
11
|
-
|
|
10
|
+
const showDetailed = parseInt(
|
|
11
|
+
storageService.get(TerminalStorageKeys.TabsShowDetailed, StorageScope.APPLICATION) ?? "0"
|
|
12
|
+
);
|
|
13
|
+
let statusString = "";
|
|
12
14
|
const statuses = instance.statusList.statuses;
|
|
13
15
|
const actions = [];
|
|
14
16
|
for (const status of statuses) {
|
|
15
17
|
if (showDetailed) {
|
|
16
18
|
if (status.detailedTooltip ?? status.tooltip) {
|
|
17
|
-
statusString += `\n\n---\n\n${status.icon ? `$(${status.icon?.id}) ` :
|
|
19
|
+
statusString += `\n\n---\n\n${status.icon ? `$(${status.icon?.id}) ` : ""}` + (status.detailedTooltip ?? status.tooltip ?? "");
|
|
18
20
|
}
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
+
} else {
|
|
21
22
|
if (status.tooltip) {
|
|
22
|
-
statusString += `\n\n---\n\n${status.icon ? `$(${status.icon?.id}) ` :
|
|
23
|
+
statusString += `\n\n---\n\n${status.icon ? `$(${status.icon?.id}) ` : ""}` + (status.tooltip ?? "");
|
|
23
24
|
}
|
|
24
25
|
}
|
|
25
26
|
if (status.hoverActions) {
|
|
@@ -27,42 +28,48 @@ function getInstanceHoverInfo(instance, storageService) {
|
|
|
27
28
|
}
|
|
28
29
|
}
|
|
29
30
|
actions.push({
|
|
30
|
-
commandId:
|
|
31
|
-
label: showDetailed ? ( localize(
|
|
31
|
+
commandId: "toggleDetailedInfo",
|
|
32
|
+
label: showDetailed ? ( localize(11995, "Hide Details")) : ( localize(11996, "Show Details")),
|
|
32
33
|
run() {
|
|
33
|
-
storageService.store(
|
|
34
|
-
|
|
34
|
+
storageService.store(
|
|
35
|
+
TerminalStorageKeys.TabsShowDetailed,
|
|
36
|
+
(showDetailed + 1) % 2,
|
|
37
|
+
StorageScope.APPLICATION,
|
|
38
|
+
StorageTarget.USER
|
|
39
|
+
);
|
|
40
|
+
}
|
|
35
41
|
});
|
|
36
42
|
const shellProcessString = getShellProcessTooltip(instance, !!showDetailed);
|
|
37
|
-
const content = ( new MarkdownString(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
43
|
+
const content = ( new MarkdownString(instance.title + shellProcessString + statusString, {
|
|
44
|
+
supportThemeIcons: true
|
|
45
|
+
}));
|
|
46
|
+
return {
|
|
47
|
+
content,
|
|
48
|
+
actions
|
|
49
|
+
};
|
|
42
50
|
}
|
|
43
51
|
function getShellProcessTooltip(instance, showDetailed) {
|
|
44
52
|
const lines = [];
|
|
45
53
|
if (instance.processId && instance.processId > 0) {
|
|
46
|
-
lines.push(( localize(
|
|
54
|
+
lines.push(( localize(11997, "Process ID ({0}): {1}", "PID", instance.processId)) + "\n");
|
|
47
55
|
}
|
|
48
56
|
if (instance.shellLaunchConfig.executable) {
|
|
49
|
-
let commandLine =
|
|
57
|
+
let commandLine = "";
|
|
50
58
|
if (!showDetailed && instance.shellLaunchConfig.executable.length > 32) {
|
|
51
59
|
const base = basename(instance.shellLaunchConfig.executable);
|
|
52
60
|
const sepIndex = instance.shellLaunchConfig.executable.length - base.length - 1;
|
|
53
61
|
const sep = instance.shellLaunchConfig.executable.substring(sepIndex, sepIndex + 1);
|
|
54
62
|
commandLine += `…${sep}${base}`;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
63
|
+
} else {
|
|
57
64
|
commandLine += instance.shellLaunchConfig.executable;
|
|
58
65
|
}
|
|
59
|
-
const args = ( asArray(instance.injectedArgs || instance.shellLaunchConfig.args || []).map(x => x.match(/\s/) ? `'${x}'` : x)).join(
|
|
66
|
+
const args = ( asArray(instance.injectedArgs || instance.shellLaunchConfig.args || []).map(x => x.match(/\s/) ? `'${x}'` : x)).join(" ");
|
|
60
67
|
if (args) {
|
|
61
68
|
commandLine += ` ${args}`;
|
|
62
69
|
}
|
|
63
|
-
lines.push(( localize(
|
|
70
|
+
lines.push(( localize(11998, "Command line: {0}", commandLine)));
|
|
64
71
|
}
|
|
65
|
-
return lines.length ? `\n\n---\n\n${lines.join(
|
|
72
|
+
return lines.length ? `\n\n---\n\n${lines.join("\n")}` : "";
|
|
66
73
|
}
|
|
67
74
|
|
|
68
75
|
export { getInstanceHoverInfo, getShellProcessTooltip };
|
|
@@ -32,7 +32,9 @@ class LineDataEventAddon extends Disposable {
|
|
|
32
32
|
this._isOsSet = true;
|
|
33
33
|
if (os === OperatingSystem.Windows) {
|
|
34
34
|
const xterm = this._xterm;
|
|
35
|
-
this._register(xterm.parser.registerCsiHandler({
|
|
35
|
+
this._register(xterm.parser.registerCsiHandler({
|
|
36
|
+
final: "H"
|
|
37
|
+
}, () => {
|
|
36
38
|
const buffer = xterm.buffer;
|
|
37
39
|
this._sendLineData(buffer.active, buffer.active.baseY + buffer.active.cursorY);
|
|
38
40
|
return false;
|
|
@@ -25,9 +25,8 @@ function mergeEnvironments(parent, other) {
|
|
|
25
25
|
_mergeEnvironmentValue(parent, actualKey, value);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
( Object.keys(other)).forEach((key) => {
|
|
28
|
+
} else {
|
|
29
|
+
( Object.keys(other)).forEach(key => {
|
|
31
30
|
const value = other[key];
|
|
32
31
|
if (value !== undefined) {
|
|
33
32
|
_mergeEnvironmentValue(parent, key, value);
|
|
@@ -38,20 +37,19 @@ function mergeEnvironments(parent, other) {
|
|
|
38
37
|
function _mergeEnvironmentValue(env, key, value) {
|
|
39
38
|
if (isString(value)) {
|
|
40
39
|
env[key] = value;
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
40
|
+
} else {
|
|
43
41
|
delete env[key];
|
|
44
42
|
}
|
|
45
43
|
}
|
|
46
44
|
function addTerminalEnvironmentKeys(env, version, locale, detectLocale) {
|
|
47
|
-
env[
|
|
45
|
+
env["TERM_PROGRAM"] = "vscode";
|
|
48
46
|
if (version) {
|
|
49
|
-
env[
|
|
47
|
+
env["TERM_PROGRAM_VERSION"] = version;
|
|
50
48
|
}
|
|
51
49
|
if (shouldSetLangEnvVariable(env, detectLocale)) {
|
|
52
|
-
env[
|
|
50
|
+
env["LANG"] = getLangEnvVariable(locale);
|
|
53
51
|
}
|
|
54
|
-
env[
|
|
52
|
+
env["COLORTERM"] = "truecolor";
|
|
55
53
|
}
|
|
56
54
|
function mergeNonNullKeys(env, other) {
|
|
57
55
|
if (!other) {
|
|
@@ -69,8 +67,7 @@ async function resolveConfigurationVariables(variableResolver, env) {
|
|
|
69
67
|
if (isString(value)) {
|
|
70
68
|
try {
|
|
71
69
|
env[key] = await variableResolver(value);
|
|
72
|
-
}
|
|
73
|
-
catch (e) {
|
|
70
|
+
} catch (e) {
|
|
74
71
|
env[key] = value;
|
|
75
72
|
}
|
|
76
73
|
}
|
|
@@ -78,74 +75,73 @@ async function resolveConfigurationVariables(variableResolver, env) {
|
|
|
78
75
|
return env;
|
|
79
76
|
}
|
|
80
77
|
function shouldSetLangEnvVariable(env, detectLocale) {
|
|
81
|
-
if (detectLocale ===
|
|
78
|
+
if (detectLocale === "on") {
|
|
82
79
|
return true;
|
|
83
80
|
}
|
|
84
|
-
if (detectLocale ===
|
|
85
|
-
const lang = env[
|
|
81
|
+
if (detectLocale === "auto") {
|
|
82
|
+
const lang = env["LANG"];
|
|
86
83
|
return !lang || (lang.search(/\.UTF\-8$/) === -1 && lang.search(/\.utf8$/) === -1 && lang.search(/\.euc.+/) === -1);
|
|
87
84
|
}
|
|
88
85
|
return false;
|
|
89
86
|
}
|
|
90
87
|
function getLangEnvVariable(locale) {
|
|
91
|
-
const parts = locale ? locale.split(
|
|
88
|
+
const parts = locale ? locale.split("-") : [];
|
|
92
89
|
const n = parts.length;
|
|
93
90
|
if (n === 0) {
|
|
94
|
-
return
|
|
91
|
+
return "en_US.UTF-8";
|
|
95
92
|
}
|
|
96
93
|
if (n === 1) {
|
|
97
94
|
const languageVariants = {
|
|
98
|
-
af:
|
|
99
|
-
am:
|
|
100
|
-
be:
|
|
101
|
-
bg:
|
|
102
|
-
ca:
|
|
103
|
-
cs:
|
|
104
|
-
da:
|
|
105
|
-
de:
|
|
106
|
-
el:
|
|
107
|
-
en:
|
|
108
|
-
es:
|
|
109
|
-
et:
|
|
110
|
-
eu:
|
|
111
|
-
fi:
|
|
112
|
-
fr:
|
|
113
|
-
he:
|
|
114
|
-
hr:
|
|
115
|
-
hu:
|
|
116
|
-
hy:
|
|
117
|
-
is:
|
|
118
|
-
it:
|
|
119
|
-
ja:
|
|
120
|
-
kk:
|
|
121
|
-
ko:
|
|
122
|
-
lt:
|
|
123
|
-
nl:
|
|
124
|
-
no:
|
|
125
|
-
pl:
|
|
126
|
-
pt:
|
|
127
|
-
ro:
|
|
128
|
-
ru:
|
|
129
|
-
sk:
|
|
130
|
-
sl:
|
|
131
|
-
sr:
|
|
132
|
-
sv:
|
|
133
|
-
tr:
|
|
134
|
-
uk:
|
|
135
|
-
zh:
|
|
95
|
+
af: "ZA",
|
|
96
|
+
am: "ET",
|
|
97
|
+
be: "BY",
|
|
98
|
+
bg: "BG",
|
|
99
|
+
ca: "ES",
|
|
100
|
+
cs: "CZ",
|
|
101
|
+
da: "DK",
|
|
102
|
+
de: "DE",
|
|
103
|
+
el: "GR",
|
|
104
|
+
en: "US",
|
|
105
|
+
es: "ES",
|
|
106
|
+
et: "EE",
|
|
107
|
+
eu: "ES",
|
|
108
|
+
fi: "FI",
|
|
109
|
+
fr: "FR",
|
|
110
|
+
he: "IL",
|
|
111
|
+
hr: "HR",
|
|
112
|
+
hu: "HU",
|
|
113
|
+
hy: "AM",
|
|
114
|
+
is: "IS",
|
|
115
|
+
it: "IT",
|
|
116
|
+
ja: "JP",
|
|
117
|
+
kk: "KZ",
|
|
118
|
+
ko: "KR",
|
|
119
|
+
lt: "LT",
|
|
120
|
+
nl: "NL",
|
|
121
|
+
no: "NO",
|
|
122
|
+
pl: "PL",
|
|
123
|
+
pt: "BR",
|
|
124
|
+
ro: "RO",
|
|
125
|
+
ru: "RU",
|
|
126
|
+
sk: "SK",
|
|
127
|
+
sl: "SI",
|
|
128
|
+
sr: "YU",
|
|
129
|
+
sv: "SE",
|
|
130
|
+
tr: "TR",
|
|
131
|
+
uk: "UA",
|
|
132
|
+
zh: "CN"
|
|
136
133
|
};
|
|
137
134
|
if (Object.prototype.hasOwnProperty.call(languageVariants, parts[0])) {
|
|
138
135
|
parts.push(languageVariants[parts[0]]);
|
|
139
136
|
}
|
|
140
|
-
}
|
|
141
|
-
else {
|
|
137
|
+
} else {
|
|
142
138
|
parts[1] = parts[1].toUpperCase();
|
|
143
139
|
}
|
|
144
|
-
return parts.join(
|
|
140
|
+
return parts.join("_") + ".UTF-8";
|
|
145
141
|
}
|
|
146
142
|
async function getCwd(shell, userHome, variableResolver, root, customCwd, logService) {
|
|
147
143
|
if (shell.cwd) {
|
|
148
|
-
const unresolved = (typeof shell.cwd ===
|
|
144
|
+
const unresolved = (typeof shell.cwd === "object") ? shell.cwd.fsPath : shell.cwd;
|
|
149
145
|
const resolved = await _resolveCwd(unresolved, variableResolver);
|
|
150
146
|
return sanitizeCwd(resolved || unresolved);
|
|
151
147
|
}
|
|
@@ -157,14 +153,13 @@ async function getCwd(shell, userHome, variableResolver, root, customCwd, logSer
|
|
|
157
153
|
if (customCwd) {
|
|
158
154
|
if (isAbsolute(customCwd)) {
|
|
159
155
|
cwd = customCwd;
|
|
160
|
-
}
|
|
161
|
-
else if (root) {
|
|
156
|
+
} else if (root) {
|
|
162
157
|
cwd = join(root.fsPath, customCwd);
|
|
163
158
|
}
|
|
164
159
|
}
|
|
165
160
|
}
|
|
166
161
|
if (!cwd) {
|
|
167
|
-
cwd = root ? root.fsPath : userHome ||
|
|
162
|
+
cwd = root ? root.fsPath : userHome || "";
|
|
168
163
|
}
|
|
169
164
|
return sanitizeCwd(cwd);
|
|
170
165
|
}
|
|
@@ -172,9 +167,8 @@ async function _resolveCwd(cwd, variableResolver, logService) {
|
|
|
172
167
|
if (variableResolver) {
|
|
173
168
|
try {
|
|
174
169
|
return await variableResolver(cwd);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
logService?.error('Could not resolve terminal cwd', e);
|
|
170
|
+
} catch (e) {
|
|
171
|
+
logService?.error("Could not resolve terminal cwd", e);
|
|
178
172
|
return undefined;
|
|
179
173
|
}
|
|
180
174
|
}
|
|
@@ -184,16 +178,24 @@ function createVariableResolver(lastActiveWorkspace, env, configurationResolverS
|
|
|
184
178
|
if (!configurationResolverService) {
|
|
185
179
|
return undefined;
|
|
186
180
|
}
|
|
187
|
-
return
|
|
181
|
+
return str => configurationResolverService.resolveWithEnvironment(env, lastActiveWorkspace, str);
|
|
188
182
|
}
|
|
189
|
-
async function createTerminalEnvironment(
|
|
183
|
+
async function createTerminalEnvironment(
|
|
184
|
+
shellLaunchConfig,
|
|
185
|
+
envFromConfig,
|
|
186
|
+
variableResolver,
|
|
187
|
+
version,
|
|
188
|
+
detectLocale,
|
|
189
|
+
baseEnv
|
|
190
|
+
) {
|
|
190
191
|
const env = {};
|
|
191
192
|
if (shellLaunchConfig.strictEnv) {
|
|
192
193
|
mergeNonNullKeys(env, shellLaunchConfig.env);
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
194
|
+
} else {
|
|
195
195
|
mergeNonNullKeys(env, baseEnv);
|
|
196
|
-
const allowedEnvFromConfig = {
|
|
196
|
+
const allowedEnvFromConfig = {
|
|
197
|
+
...envFromConfig
|
|
198
|
+
};
|
|
197
199
|
if (variableResolver) {
|
|
198
200
|
if (allowedEnvFromConfig) {
|
|
199
201
|
await resolveConfigurationVariables(variableResolver, allowedEnvFromConfig);
|
|
@@ -203,48 +205,51 @@ async function createTerminalEnvironment(shellLaunchConfig, envFromConfig, varia
|
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
207
|
if (isMacintosh) {
|
|
206
|
-
if (env[
|
|
207
|
-
env[
|
|
208
|
-
delete env[
|
|
208
|
+
if (env["VSCODE_NODE_OPTIONS"]) {
|
|
209
|
+
env["NODE_OPTIONS"] = env["VSCODE_NODE_OPTIONS"];
|
|
210
|
+
delete env["VSCODE_NODE_OPTIONS"];
|
|
209
211
|
}
|
|
210
|
-
if (env[
|
|
211
|
-
env[
|
|
212
|
-
delete env[
|
|
212
|
+
if (env["VSCODE_NODE_REPL_EXTERNAL_MODULE"]) {
|
|
213
|
+
env["NODE_REPL_EXTERNAL_MODULE"] = env["VSCODE_NODE_REPL_EXTERNAL_MODULE"];
|
|
214
|
+
delete env["VSCODE_NODE_REPL_EXTERNAL_MODULE"];
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
|
-
sanitizeProcessEnvironment(env,
|
|
217
|
+
sanitizeProcessEnvironment(env, "VSCODE_IPC_HOOK_CLI");
|
|
216
218
|
mergeEnvironments(env, allowedEnvFromConfig);
|
|
217
219
|
mergeEnvironments(env, shellLaunchConfig.env);
|
|
218
220
|
addTerminalEnvironmentKeys(env, version, language, detectLocale);
|
|
219
221
|
}
|
|
220
222
|
return env;
|
|
221
223
|
}
|
|
222
|
-
async function preparePathForShell(
|
|
224
|
+
async function preparePathForShell(
|
|
225
|
+
resource,
|
|
226
|
+
executable,
|
|
227
|
+
title,
|
|
228
|
+
shellType,
|
|
229
|
+
backend,
|
|
230
|
+
os,
|
|
231
|
+
isWindowsFrontend = isWindows
|
|
232
|
+
) {
|
|
223
233
|
let originalPath;
|
|
224
234
|
if (isString(resource)) {
|
|
225
235
|
originalPath = resource;
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
236
|
+
} else {
|
|
228
237
|
originalPath = resource.fsPath;
|
|
229
238
|
if (isWindowsFrontend && os !== OperatingSystem.Windows) {
|
|
230
|
-
originalPath = originalPath.replace(/\\/g,
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
originalPath = originalPath.replace(/\//g, '\\');
|
|
239
|
+
originalPath = originalPath.replace(/\\/g, "/");
|
|
240
|
+
} else if (!isWindowsFrontend && os === OperatingSystem.Windows) {
|
|
241
|
+
originalPath = originalPath.replace(/\//g, "\\");
|
|
234
242
|
}
|
|
235
243
|
}
|
|
236
244
|
if (!executable) {
|
|
237
245
|
return originalPath;
|
|
238
246
|
}
|
|
239
|
-
const hasSpace = originalPath.includes(
|
|
240
|
-
const hasParens = originalPath.includes(
|
|
241
|
-
const pathBasename = basename(executable,
|
|
242
|
-
const isPowerShell = pathBasename ===
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
title === 'powershell';
|
|
246
|
-
if (isPowerShell && (hasSpace || originalPath.includes('\''))) {
|
|
247
|
-
return `& '${originalPath.replace(/'/g, '\'\'')}'`;
|
|
247
|
+
const hasSpace = originalPath.includes(" ");
|
|
248
|
+
const hasParens = originalPath.includes("(") || originalPath.includes(")");
|
|
249
|
+
const pathBasename = basename(executable, ".exe");
|
|
250
|
+
const isPowerShell = pathBasename === "pwsh" || title === "pwsh" || pathBasename === "powershell" || title === "powershell";
|
|
251
|
+
if (isPowerShell && (hasSpace || originalPath.includes("'"))) {
|
|
252
|
+
return `& '${originalPath.replace(/'/g, "''")}'`;
|
|
248
253
|
}
|
|
249
254
|
if (hasParens && isPowerShell) {
|
|
250
255
|
return `& '${originalPath}'`;
|
|
@@ -252,21 +257,18 @@ async function preparePathForShell(resource, executable, title, shellType, backe
|
|
|
252
257
|
if (os === OperatingSystem.Windows) {
|
|
253
258
|
if (shellType !== undefined) {
|
|
254
259
|
if (shellType === WindowsShellType.GitBash) {
|
|
255
|
-
return escapeNonWindowsPath(originalPath.replace(/\\/g,
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
else if (hasSpace) {
|
|
260
|
+
return escapeNonWindowsPath(originalPath.replace(/\\/g, "/"), shellType);
|
|
261
|
+
} else if (shellType === WindowsShellType.Wsl) {
|
|
262
|
+
return backend?.getWslPath(originalPath, "win-to-unix") || originalPath;
|
|
263
|
+
} else if (hasSpace) {
|
|
261
264
|
return `"${originalPath}"`;
|
|
262
265
|
}
|
|
263
266
|
return originalPath;
|
|
264
267
|
}
|
|
265
268
|
const lowerExecutable = executable.toLowerCase();
|
|
266
|
-
if (lowerExecutable.includes(
|
|
267
|
-
return backend?.getWslPath(originalPath,
|
|
268
|
-
}
|
|
269
|
-
else if (hasSpace) {
|
|
269
|
+
if (lowerExecutable.includes("wsl") || (lowerExecutable.includes("bash.exe") && !lowerExecutable.toLowerCase().includes("git"))) {
|
|
270
|
+
return backend?.getWslPath(originalPath, "win-to-unix") || originalPath;
|
|
271
|
+
} else if (hasSpace) {
|
|
270
272
|
return `"${originalPath}"`;
|
|
271
273
|
}
|
|
272
274
|
return originalPath;
|
|
@@ -286,18 +288,15 @@ async function getUriLabelForShell(uri, backend, shellType, os, isWindowsFronten
|
|
|
286
288
|
let path = isString(uri) ? uri : uri.fsPath;
|
|
287
289
|
if (os === OperatingSystem.Windows) {
|
|
288
290
|
if (shellType === WindowsShellType.Wsl) {
|
|
289
|
-
return backend.getWslPath(path.replaceAll(
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
}
|
|
294
|
-
else {
|
|
291
|
+
return backend.getWslPath(path.replaceAll("/", "\\"), "win-to-unix");
|
|
292
|
+
} else if (shellType === WindowsShellType.GitBash) {
|
|
293
|
+
return path.replaceAll("\\", "/").replace(/^([a-zA-Z]):\//, "/$1/");
|
|
294
|
+
} else {
|
|
295
295
|
path = isString(uri) ? path : uriToFsPath(uri, true);
|
|
296
|
-
return !isWindowsFrontend ? path.replaceAll(
|
|
296
|
+
return !isWindowsFrontend ? path.replaceAll("/", "\\") : path;
|
|
297
297
|
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
return isWindowsFrontend ? path.replaceAll('\\', '/') : path;
|
|
298
|
+
} else {
|
|
299
|
+
return isWindowsFrontend ? path.replaceAll("\\", "/") : path;
|
|
301
300
|
}
|
|
302
301
|
}
|
|
303
302
|
function getShellIntegrationTimeout(configurationService, siInjectionEnabled, isRemote, processReadyTimestamp) {
|
|
@@ -305,8 +304,7 @@ function getShellIntegrationTimeout(configurationService, siInjectionEnabled, is
|
|
|
305
304
|
let timeoutMs;
|
|
306
305
|
if (!isNumber(timeoutValue) || timeoutValue < 0) {
|
|
307
306
|
timeoutMs = siInjectionEnabled ? 5000 : (isRemote ? 3000 : 2000);
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
307
|
+
} else {
|
|
310
308
|
timeoutMs = Math.max(timeoutValue, 500);
|
|
311
309
|
}
|
|
312
310
|
if (processReadyTimestamp !== undefined) {
|
|
@@ -17,7 +17,8 @@ export declare enum TerminalChatCommandId {
|
|
|
17
17
|
FocusMostRecentChatTerminalOutput = "workbench.action.terminal.chat.focusMostRecentChatTerminalOutput",
|
|
18
18
|
FocusMostRecentChatTerminal = "workbench.action.terminal.chat.focusMostRecentChatTerminal",
|
|
19
19
|
ToggleChatTerminalOutput = "workbench.action.terminal.chat.toggleChatTerminalOutput",
|
|
20
|
-
FocusChatInstanceAction = "workbench.action.terminal.chat.focusChatInstance"
|
|
20
|
+
FocusChatInstanceAction = "workbench.action.terminal.chat.focusChatInstance",
|
|
21
|
+
ContinueInBackground = "workbench.action.terminal.chat.continueInBackground"
|
|
21
22
|
}
|
|
22
23
|
export declare const MENU_TERMINAL_CHAT_WIDGET_INPUT_SIDE_TOOLBAR: MenuId;
|
|
23
24
|
export declare const MENU_TERMINAL_CHAT_WIDGET_STATUS: MenuId;
|
|
@@ -4,7 +4,7 @@ import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/
|
|
|
4
4
|
import { RawContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
5
5
|
|
|
6
6
|
var TerminalChatCommandId;
|
|
7
|
-
(function
|
|
7
|
+
(function(TerminalChatCommandId) {
|
|
8
8
|
TerminalChatCommandId["Start"] = "workbench.action.terminal.chat.start";
|
|
9
9
|
TerminalChatCommandId["Close"] = "workbench.action.terminal.chat.close";
|
|
10
10
|
TerminalChatCommandId["MakeRequest"] = "workbench.action.terminal.chat.makeRequest";
|
|
@@ -22,12 +22,13 @@ var TerminalChatCommandId;
|
|
|
22
22
|
TerminalChatCommandId["FocusMostRecentChatTerminal"] = "workbench.action.terminal.chat.focusMostRecentChatTerminal";
|
|
23
23
|
TerminalChatCommandId["ToggleChatTerminalOutput"] = "workbench.action.terminal.chat.toggleChatTerminalOutput";
|
|
24
24
|
TerminalChatCommandId["FocusChatInstanceAction"] = "workbench.action.terminal.chat.focusChatInstance";
|
|
25
|
+
TerminalChatCommandId["ContinueInBackground"] = "workbench.action.terminal.chat.continueInBackground";
|
|
25
26
|
})(TerminalChatCommandId || (TerminalChatCommandId = {}));
|
|
26
|
-
const MENU_TERMINAL_CHAT_WIDGET_INPUT_SIDE_TOOLBAR = MenuId.for(
|
|
27
|
-
const MENU_TERMINAL_CHAT_WIDGET_STATUS = MenuId.for(
|
|
28
|
-
MenuId.for(
|
|
27
|
+
const MENU_TERMINAL_CHAT_WIDGET_INPUT_SIDE_TOOLBAR = MenuId.for("terminalChatWidget");
|
|
28
|
+
const MENU_TERMINAL_CHAT_WIDGET_STATUS = MenuId.for("terminalChatWidget.status");
|
|
29
|
+
MenuId.for("terminalChatWidget.toolbar");
|
|
29
30
|
var TerminalChatContextKeyStrings;
|
|
30
|
-
(function
|
|
31
|
+
(function(TerminalChatContextKeyStrings) {
|
|
31
32
|
TerminalChatContextKeyStrings["ChatFocus"] = "terminalChatFocus";
|
|
32
33
|
TerminalChatContextKeyStrings["ChatVisible"] = "terminalChatVisible";
|
|
33
34
|
TerminalChatContextKeyStrings["ChatActiveRequest"] = "terminalChatActiveRequest";
|
|
@@ -42,27 +43,27 @@ var TerminalChatContextKeyStrings;
|
|
|
42
43
|
TerminalChatContextKeyStrings["ChatHasHiddenTerminals"] = "hasHiddenChatTerminals";
|
|
43
44
|
})(TerminalChatContextKeyStrings || (TerminalChatContextKeyStrings = {}));
|
|
44
45
|
var TerminalChatContextKeys;
|
|
45
|
-
(function
|
|
46
|
-
TerminalChatContextKeys.focused = ( new RawContextKey(TerminalChatContextKeyStrings.ChatFocus, false, ( localize(
|
|
47
|
-
TerminalChatContextKeys.visible = ( new RawContextKey(TerminalChatContextKeyStrings.ChatVisible, false, ( localize(
|
|
48
|
-
TerminalChatContextKeys.requestActive = ( new RawContextKey(TerminalChatContextKeyStrings.ChatActiveRequest, false, ( localize(
|
|
49
|
-
TerminalChatContextKeys.inputHasText = ( new RawContextKey(TerminalChatContextKeyStrings.ChatInputHasText, false, ( localize(
|
|
46
|
+
(function(TerminalChatContextKeys) {
|
|
47
|
+
TerminalChatContextKeys.focused = ( new RawContextKey(TerminalChatContextKeyStrings.ChatFocus, false, ( localize(12296, "Whether the chat view is focused."))));
|
|
48
|
+
TerminalChatContextKeys.visible = ( new RawContextKey(TerminalChatContextKeyStrings.ChatVisible, false, ( localize(12297, "Whether the chat view is visible."))));
|
|
49
|
+
TerminalChatContextKeys.requestActive = ( new RawContextKey(TerminalChatContextKeyStrings.ChatActiveRequest, false, ( localize(12298, "Whether there is an active chat request."))));
|
|
50
|
+
TerminalChatContextKeys.inputHasText = ( new RawContextKey(TerminalChatContextKeyStrings.ChatInputHasText, false, ( localize(12299, "Whether the chat input has text."))));
|
|
50
51
|
TerminalChatContextKeys.responseContainsCodeBlock = ( new RawContextKey(
|
|
51
52
|
TerminalChatContextKeyStrings.ChatResponseContainsCodeBlock,
|
|
52
53
|
false,
|
|
53
|
-
( localize(
|
|
54
|
+
( localize(12300, "Whether the chat response contains a code block."))
|
|
54
55
|
));
|
|
55
56
|
TerminalChatContextKeys.responseContainsMultipleCodeBlocks = ( new RawContextKey(
|
|
56
57
|
TerminalChatContextKeyStrings.ChatResponseContainsMultipleCodeBlocks,
|
|
57
58
|
false,
|
|
58
|
-
( localize(
|
|
59
|
+
( localize(12301, "Whether the chat response contains multiple code blocks."))
|
|
59
60
|
));
|
|
60
|
-
TerminalChatContextKeys.hasChatAgent = ( new RawContextKey(TerminalChatContextKeyStrings.ChatAgentRegistered, false, ( localize(
|
|
61
|
-
TerminalChatContextKeys.hasChatTerminals = ( new RawContextKey(TerminalChatContextKeyStrings.ChatHasTerminals, false, ( localize(
|
|
61
|
+
TerminalChatContextKeys.hasChatAgent = ( new RawContextKey(TerminalChatContextKeyStrings.ChatAgentRegistered, false, ( localize(12302, "Whether a chat agent is registered for the terminal location."))));
|
|
62
|
+
TerminalChatContextKeys.hasChatTerminals = ( new RawContextKey(TerminalChatContextKeyStrings.ChatHasTerminals, false, ( localize(12303, "Whether there are any chat terminals."))));
|
|
62
63
|
TerminalChatContextKeys.hasHiddenChatTerminals = ( new RawContextKey(
|
|
63
64
|
TerminalChatContextKeyStrings.ChatHasHiddenTerminals,
|
|
64
65
|
false,
|
|
65
|
-
( localize(
|
|
66
|
+
( localize(12304, "Whether there are any hidden chat terminals."))
|
|
66
67
|
));
|
|
67
68
|
})(TerminalChatContextKeys || (TerminalChatContextKeys = {}));
|
|
68
69
|
|
|
@@ -2,24 +2,24 @@
|
|
|
2
2
|
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
|
-
const terminalStickyScrollBackground = registerColor(
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
const terminalStickyScrollBackground = registerColor("terminalStickyScroll.background", null, ( localize(
|
|
6
|
+
12616,
|
|
7
|
+
"The background color of the sticky scroll overlay in the terminal."
|
|
8
8
|
)));
|
|
9
|
-
const terminalStickyScrollHoverBackground = registerColor(
|
|
10
|
-
dark:
|
|
11
|
-
light:
|
|
12
|
-
hcDark:
|
|
13
|
-
hcLight:
|
|
9
|
+
const terminalStickyScrollHoverBackground = registerColor("terminalStickyScrollHover.background", {
|
|
10
|
+
dark: "#2A2D2E",
|
|
11
|
+
light: "#F0F0F0",
|
|
12
|
+
hcDark: "#E48B39",
|
|
13
|
+
hcLight: "#0f4a85"
|
|
14
14
|
}, ( localize(
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
12617,
|
|
16
|
+
"The background color of the sticky scroll overlay in the terminal when hovered."
|
|
17
17
|
)));
|
|
18
|
-
registerColor(
|
|
18
|
+
registerColor("terminalStickyScroll.border", {
|
|
19
19
|
dark: null,
|
|
20
20
|
light: null,
|
|
21
|
-
hcDark:
|
|
22
|
-
hcLight:
|
|
23
|
-
}, ( localize(
|
|
21
|
+
hcDark: "#6fc3df",
|
|
22
|
+
hcLight: "#0f4a85"
|
|
23
|
+
}, ( localize(12618, "The border of the sticky scroll overlay in the terminal.")));
|
|
24
24
|
|
|
25
25
|
export { terminalStickyScrollBackground, terminalStickyScrollHoverBackground };
|