@theia/terminal 1.45.1 → 1.46.0-next.72
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/README.md +30 -30
- package/lib/browser/base/terminal-service.d.ts +34 -34
- package/lib/browser/base/terminal-service.js +7 -7
- package/lib/browser/base/terminal-widget.d.ts +192 -192
- package/lib/browser/base/terminal-widget.js +34 -34
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/index.js +28 -28
- package/lib/browser/search/terminal-search-container.d.ts +3 -3
- package/lib/browser/search/terminal-search-container.js +28 -28
- package/lib/browser/search/terminal-search-widget.d.ts +30 -30
- package/lib/browser/search/terminal-search-widget.js +147 -147
- package/lib/browser/shell-terminal-profile.d.ts +20 -20
- package/lib/browser/shell-terminal-profile.js +42 -42
- package/lib/browser/terminal-contribution.d.ts +3 -3
- package/lib/browser/terminal-contribution.js +20 -20
- package/lib/browser/terminal-copy-on-selection-handler.d.ts +10 -10
- package/lib/browser/terminal-copy-on-selection-handler.js +103 -103
- package/lib/browser/terminal-file-link-provider.d.ts +24 -24
- package/lib/browser/terminal-file-link-provider.js +200 -200
- package/lib/browser/terminal-frontend-contribution.d.ts +115 -115
- package/lib/browser/terminal-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/terminal-frontend-contribution.js +1078 -1056
- package/lib/browser/terminal-frontend-contribution.js.map +1 -1
- package/lib/browser/terminal-frontend-module.d.ts +5 -5
- package/lib/browser/terminal-frontend-module.js +117 -117
- package/lib/browser/terminal-link-helpers.d.ts +27 -27
- package/lib/browser/terminal-link-helpers.js +155 -155
- package/lib/browser/terminal-link-provider.d.ts +51 -51
- package/lib/browser/terminal-link-provider.js +197 -197
- package/lib/browser/terminal-preferences.d.ts +61 -61
- package/lib/browser/terminal-preferences.d.ts.map +1 -1
- package/lib/browser/terminal-preferences.js +357 -356
- package/lib/browser/terminal-preferences.js.map +1 -1
- package/lib/browser/terminal-profile-service.d.ts +58 -58
- package/lib/browser/terminal-profile-service.js +158 -158
- package/lib/browser/terminal-quick-open-service.d.ts +36 -36
- package/lib/browser/terminal-quick-open-service.js +137 -137
- package/lib/browser/terminal-theme-service.d.ts +21 -21
- package/lib/browser/terminal-theme-service.d.ts.map +1 -1
- package/lib/browser/terminal-theme-service.js +222 -218
- package/lib/browser/terminal-theme-service.js.map +1 -1
- package/lib/browser/terminal-url-link-provider.d.ts +11 -11
- package/lib/browser/terminal-url-link-provider.js +76 -76
- package/lib/browser/terminal-widget-impl.d.ts +180 -187
- package/lib/browser/terminal-widget-impl.d.ts.map +1 -1
- package/lib/browser/terminal-widget-impl.js +857 -867
- package/lib/browser/terminal-widget-impl.js.map +1 -1
- package/lib/common/base-terminal-protocol.d.ts +55 -55
- package/lib/common/base-terminal-protocol.js +84 -84
- package/lib/common/shell-terminal-protocol.d.ts +66 -66
- package/lib/common/shell-terminal-protocol.js +35 -35
- package/lib/common/terminal-common-module.d.ts +7 -7
- package/lib/common/terminal-common-module.js +31 -31
- package/lib/common/terminal-protocol.d.ts +12 -12
- package/lib/common/terminal-protocol.js +21 -21
- package/lib/common/terminal-watcher.d.ts +13 -13
- package/lib/common/terminal-watcher.js +70 -70
- package/lib/node/base-terminal-server.d.ts +24 -24
- package/lib/node/base-terminal-server.js +168 -168
- package/lib/node/buffering-stream.d.ts +39 -39
- package/lib/node/buffering-stream.js +75 -75
- package/lib/node/buffering-stream.spec.d.ts +1 -1
- package/lib/node/buffering-stream.spec.js +43 -43
- package/lib/node/index.d.ts +1 -1
- package/lib/node/index.js +28 -28
- package/lib/node/shell-process.d.ts +27 -27
- package/lib/node/shell-process.js +107 -107
- package/lib/node/shell-process.js.map +1 -1
- package/lib/node/shell-terminal-server.d.ts +30 -30
- package/lib/node/shell-terminal-server.js +212 -212
- package/lib/node/shell-terminal-server.spec.d.ts +1 -1
- package/lib/node/shell-terminal-server.spec.js +35 -35
- package/lib/node/terminal-backend-contribution.d.ts +9 -9
- package/lib/node/terminal-backend-contribution.js +75 -75
- package/lib/node/terminal-backend-contribution.slow-spec.d.ts +1 -1
- package/lib/node/terminal-backend-contribution.slow-spec.js +54 -54
- package/lib/node/terminal-backend-module.d.ts +11 -11
- package/lib/node/terminal-backend-module.js +69 -69
- package/lib/node/terminal-server.d.ts +9 -9
- package/lib/node/terminal-server.js +64 -64
- package/lib/node/terminal-server.spec.d.ts +1 -1
- package/lib/node/terminal-server.spec.js +41 -41
- package/lib/node/test/terminal-test-container.d.ts +2 -2
- package/lib/node/test/terminal-test-container.js +40 -40
- package/lib/package.spec.js +25 -25
- package/package.json +12 -12
- package/src/browser/base/terminal-service.ts +60 -60
- package/src/browser/base/terminal-widget.ts +254 -254
- package/src/browser/index.ts +17 -17
- package/src/browser/search/terminal-search-container.ts +28 -28
- package/src/browser/search/terminal-search-widget.tsx +161 -161
- package/src/browser/shell-terminal-profile.ts +45 -45
- package/src/browser/style/terminal-search.css +99 -99
- package/src/browser/style/terminal.css +32 -32
- package/src/browser/terminal-contribution.ts +19 -19
- package/src/browser/terminal-copy-on-selection-handler.ts +92 -92
- package/src/browser/terminal-file-link-provider.ts +200 -200
- package/src/browser/terminal-frontend-contribution.ts +1120 -1098
- package/src/browser/terminal-frontend-module.ts +136 -136
- package/src/browser/terminal-link-helpers.ts +187 -187
- package/src/browser/terminal-link-provider.ts +203 -203
- package/src/browser/terminal-preferences.ts +428 -427
- package/src/browser/terminal-profile-service.ts +180 -180
- package/src/browser/terminal-quick-open-service.ts +132 -132
- package/src/browser/terminal-theme-service.ts +213 -209
- package/src/browser/terminal-url-link-provider.ts +66 -66
- package/src/browser/terminal-widget-impl.ts +939 -936
- package/src/common/base-terminal-protocol.ts +125 -125
- package/src/common/shell-terminal-protocol.ts +103 -103
- package/src/common/terminal-common-module.ts +30 -30
- package/src/common/terminal-protocol.ts +32 -32
- package/src/common/terminal-watcher.ts +69 -69
- package/src/node/base-terminal-server.ts +173 -173
- package/src/node/buffering-stream.spec.ts +46 -46
- package/src/node/buffering-stream.ts +95 -95
- package/src/node/index.ts +17 -17
- package/src/node/shell-process.ts +101 -101
- package/src/node/shell-terminal-server.spec.ts +40 -40
- package/src/node/shell-terminal-server.ts +221 -221
- package/src/node/terminal-backend-contribution.slow-spec.ts +63 -63
- package/src/node/terminal-backend-contribution.ts +60 -60
- package/src/node/terminal-backend-module.ts +82 -82
- package/src/node/terminal-server.spec.ts +47 -47
- package/src/node/terminal-server.ts +52 -52
- package/src/node/test/terminal-test-container.ts +39 -39
- package/src/package.spec.ts +28 -28
|
@@ -1,427 +1,428 @@
|
|
|
1
|
-
// *****************************************************************************
|
|
2
|
-
// Copyright (C) 2018 Bitsler and others.
|
|
3
|
-
//
|
|
4
|
-
// This program and the accompanying materials are made available under the
|
|
5
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
//
|
|
8
|
-
// This Source Code may also be made available under the following Secondary
|
|
9
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
-
// with the GNU Classpath Exception which is available at
|
|
12
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
-
//
|
|
14
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
-
// *****************************************************************************
|
|
16
|
-
|
|
17
|
-
/* eslint-disable max-len */
|
|
18
|
-
|
|
19
|
-
import { interfaces } from '@theia/core/shared/inversify';
|
|
20
|
-
import { IJSONSchema } from '@theia/core/lib/common/json-schema';
|
|
21
|
-
import { createPreferenceProxy, PreferenceProxy, PreferenceService, PreferenceContribution, PreferenceSchema, PreferenceSchemaProperties } from '@theia/core/lib/browser';
|
|
22
|
-
import { nls } from '@theia/core/lib/common/nls';
|
|
23
|
-
import { editorGeneratedPreferenceProperties } from '@theia/editor/lib/browser/editor-generated-preference-schema';
|
|
24
|
-
import { OS } from '@theia/core';
|
|
25
|
-
import { terminalAnsiColorMap } from './terminal-theme-service';
|
|
26
|
-
|
|
27
|
-
const commonProfileProperties: PreferenceSchemaProperties = {
|
|
28
|
-
env: {
|
|
29
|
-
type: 'object',
|
|
30
|
-
additionalProperties: {
|
|
31
|
-
type: 'string'
|
|
32
|
-
},
|
|
33
|
-
markdownDescription: nls.localizeByDefault('An object with environment variables that will be added to the terminal profile process. Set to `null` to delete environment variables from the base environment.'),
|
|
34
|
-
},
|
|
35
|
-
overrideName: {
|
|
36
|
-
type: 'boolean',
|
|
37
|
-
description: nls.localizeByDefault('Controls whether or not the profile name overrides the auto detected one.')
|
|
38
|
-
},
|
|
39
|
-
icon: {
|
|
40
|
-
type: 'string',
|
|
41
|
-
markdownDescription: nls.localize('theia/terminal/profileIcon', 'A codicon ID to associate with the terminal icon.\nterminal-tmux:"$(terminal-tmux)"')
|
|
42
|
-
},
|
|
43
|
-
color: {
|
|
44
|
-
type: 'string',
|
|
45
|
-
enum: Object.getOwnPropertyNames(terminalAnsiColorMap),
|
|
46
|
-
description: nls.localize('theia/terminal/profileColor', 'A terminal theme color ID to associate with the terminal.')
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const stringOrStringArray: IJSONSchema = {
|
|
51
|
-
oneOf: [
|
|
52
|
-
{ type: 'string' },
|
|
53
|
-
{
|
|
54
|
-
type: 'array',
|
|
55
|
-
items: {
|
|
56
|
-
type: 'string'
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
const pathProperty: IJSONSchema = {
|
|
63
|
-
description: nls.localize('theia/terminal/profilePath', 'The path of the shell that this profile uses.'),
|
|
64
|
-
...stringOrStringArray
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
function shellArgsDeprecatedMessage(type: OS.Type): string {
|
|
68
|
-
return nls.localize('theia/terminal/shell.deprecated', 'This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in \'terminal.integrated.profiles.{0}\' and setting its profile name as the default in \'terminal.integrated.defaultProfile.{0}.\'', type.toString().toLowerCase());
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export const TerminalConfigSchema: PreferenceSchema = {
|
|
72
|
-
type: 'object',
|
|
73
|
-
properties: {
|
|
74
|
-
'terminal.enableCopy': {
|
|
75
|
-
type: 'boolean',
|
|
76
|
-
description: nls.localize('theia/terminal/enableCopy', 'Enable ctrl-c (cmd-c on macOS) to copy selected text'),
|
|
77
|
-
default: true
|
|
78
|
-
},
|
|
79
|
-
'terminal.enablePaste': {
|
|
80
|
-
type: 'boolean',
|
|
81
|
-
description: nls.localize('theia/terminal/enablePaste', 'Enable ctrl-v (cmd-v on macOS) to paste from clipboard'),
|
|
82
|
-
default: true
|
|
83
|
-
},
|
|
84
|
-
'terminal.integrated.fontFamily': {
|
|
85
|
-
type: 'string',
|
|
86
|
-
markdownDescription: nls.localizeByDefault('Controls the font family of the terminal. Defaults to {0}\'s value.', '`#editor.fontFamily#`'),
|
|
87
|
-
default: editorGeneratedPreferenceProperties['editor.fontFamily'].default,
|
|
88
|
-
},
|
|
89
|
-
'terminal.integrated.fontSize': {
|
|
90
|
-
type: 'number',
|
|
91
|
-
description: nls.localizeByDefault('Controls the font size in pixels of the terminal.'),
|
|
92
|
-
minimum: 6,
|
|
93
|
-
default: editorGeneratedPreferenceProperties['editor.fontSize'].default
|
|
94
|
-
},
|
|
95
|
-
'terminal.integrated.fontWeight': {
|
|
96
|
-
type: 'string',
|
|
97
|
-
enum: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
98
|
-
description: nls.localizeByDefault('The font weight to use within the terminal for non-bold text. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.'),
|
|
99
|
-
default: 'normal'
|
|
100
|
-
},
|
|
101
|
-
'terminal.integrated.fontWeightBold': {
|
|
102
|
-
type: 'string',
|
|
103
|
-
enum: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
104
|
-
description: nls.localizeByDefault('The font weight to use within the terminal for bold text. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.'),
|
|
105
|
-
default: 'bold'
|
|
106
|
-
},
|
|
107
|
-
'terminal.integrated.drawBoldTextInBrightColors': {
|
|
108
|
-
description: nls.localizeByDefault('Controls whether bold text in the terminal will always use the \"bright\" ANSI color variant.'),
|
|
109
|
-
type: 'boolean',
|
|
110
|
-
default: true,
|
|
111
|
-
},
|
|
112
|
-
'terminal.integrated.letterSpacing': {
|
|
113
|
-
description: nls.localizeByDefault('Controls the letter spacing of the terminal. This is an integer value which represents the number of additional pixels to add between characters.'),
|
|
114
|
-
type: 'number',
|
|
115
|
-
default: 1
|
|
116
|
-
},
|
|
117
|
-
'terminal.integrated.lineHeight': {
|
|
118
|
-
description: nls.localizeByDefault('Controls the line height of the terminal. This number is multiplied by the terminal font size to get the actual line-height in pixels.'),
|
|
119
|
-
type: 'number',
|
|
120
|
-
minimum: 1,
|
|
121
|
-
default: 1
|
|
122
|
-
},
|
|
123
|
-
'terminal.integrated.scrollback': {
|
|
124
|
-
description: nls.localizeByDefault('Controls the maximum number of lines the terminal keeps in its buffer. We pre-allocate memory based on this value in order to ensure a smooth experience. As such, as the value increases, so will the amount of memory.'),
|
|
125
|
-
type: 'number',
|
|
126
|
-
default: 1000
|
|
127
|
-
},
|
|
128
|
-
'terminal.integrated.fastScrollSensitivity': {
|
|
129
|
-
markdownDescription: nls.localizeByDefault('Scrolling speed multiplier when pressing `Alt`.'),
|
|
130
|
-
type: 'number',
|
|
131
|
-
default: 5,
|
|
132
|
-
},
|
|
133
|
-
'terminal.integrated.rendererType': {
|
|
134
|
-
description: nls.localize('theia/terminal/rendererType', 'Controls how the terminal is rendered.'),
|
|
135
|
-
type: 'string',
|
|
136
|
-
enum: ['canvas', 'dom'],
|
|
137
|
-
default: 'canvas'
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
default:
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
default:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
default:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
nls.localizeByDefault('
|
|
205
|
-
nls.localizeByDefault('
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
'terminal.
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
'terminal.integrated.
|
|
372
|
-
'terminal.integrated.
|
|
373
|
-
'terminal.integrated.
|
|
374
|
-
'terminal.integrated.
|
|
375
|
-
'terminal.integrated.
|
|
376
|
-
'terminal.integrated.
|
|
377
|
-
'terminal.integrated.
|
|
378
|
-
'terminal.integrated.
|
|
379
|
-
'terminal.integrated.
|
|
380
|
-
'terminal.integrated.
|
|
381
|
-
'terminal.integrated.
|
|
382
|
-
'terminal.integrated.
|
|
383
|
-
'terminal.integrated.
|
|
384
|
-
'terminal.integrated.
|
|
385
|
-
'terminal.integrated.shell.
|
|
386
|
-
'terminal.integrated.shell.
|
|
387
|
-
'terminal.integrated.
|
|
388
|
-
'terminal.integrated.shellArgs.
|
|
389
|
-
'terminal.integrated.shellArgs.
|
|
390
|
-
'terminal.integrated.
|
|
391
|
-
'terminal.integrated.defaultProfile.
|
|
392
|
-
'terminal.integrated.defaultProfile.
|
|
393
|
-
'terminal.integrated.
|
|
394
|
-
'terminal.integrated.profiles.
|
|
395
|
-
'terminal.integrated.profiles.
|
|
396
|
-
'terminal.integrated.
|
|
397
|
-
'terminal.integrated.
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
export type
|
|
405
|
-
export type
|
|
406
|
-
export
|
|
407
|
-
export
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
export const
|
|
413
|
-
export
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
const
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
bind(
|
|
427
|
-
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2018 Bitsler and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
/* eslint-disable max-len */
|
|
18
|
+
|
|
19
|
+
import { interfaces } from '@theia/core/shared/inversify';
|
|
20
|
+
import { IJSONSchema } from '@theia/core/lib/common/json-schema';
|
|
21
|
+
import { createPreferenceProxy, PreferenceProxy, PreferenceService, PreferenceContribution, PreferenceSchema, PreferenceSchemaProperties } from '@theia/core/lib/browser';
|
|
22
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
23
|
+
import { editorGeneratedPreferenceProperties } from '@theia/editor/lib/browser/editor-generated-preference-schema';
|
|
24
|
+
import { OS } from '@theia/core';
|
|
25
|
+
import { terminalAnsiColorMap } from './terminal-theme-service';
|
|
26
|
+
|
|
27
|
+
const commonProfileProperties: PreferenceSchemaProperties = {
|
|
28
|
+
env: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
additionalProperties: {
|
|
31
|
+
type: 'string'
|
|
32
|
+
},
|
|
33
|
+
markdownDescription: nls.localizeByDefault('An object with environment variables that will be added to the terminal profile process. Set to `null` to delete environment variables from the base environment.'),
|
|
34
|
+
},
|
|
35
|
+
overrideName: {
|
|
36
|
+
type: 'boolean',
|
|
37
|
+
description: nls.localizeByDefault('Controls whether or not the profile name overrides the auto detected one.')
|
|
38
|
+
},
|
|
39
|
+
icon: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
markdownDescription: nls.localize('theia/terminal/profileIcon', 'A codicon ID to associate with the terminal icon.\nterminal-tmux:"$(terminal-tmux)"')
|
|
42
|
+
},
|
|
43
|
+
color: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
enum: Object.getOwnPropertyNames(terminalAnsiColorMap),
|
|
46
|
+
description: nls.localize('theia/terminal/profileColor', 'A terminal theme color ID to associate with the terminal.')
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const stringOrStringArray: IJSONSchema = {
|
|
51
|
+
oneOf: [
|
|
52
|
+
{ type: 'string' },
|
|
53
|
+
{
|
|
54
|
+
type: 'array',
|
|
55
|
+
items: {
|
|
56
|
+
type: 'string'
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const pathProperty: IJSONSchema = {
|
|
63
|
+
description: nls.localize('theia/terminal/profilePath', 'The path of the shell that this profile uses.'),
|
|
64
|
+
...stringOrStringArray
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
function shellArgsDeprecatedMessage(type: OS.Type): string {
|
|
68
|
+
return nls.localize('theia/terminal/shell.deprecated', 'This is deprecated, the new recommended way to configure your default shell is by creating a terminal profile in \'terminal.integrated.profiles.{0}\' and setting its profile name as the default in \'terminal.integrated.defaultProfile.{0}.\'', type.toString().toLowerCase());
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const TerminalConfigSchema: PreferenceSchema = {
|
|
72
|
+
type: 'object',
|
|
73
|
+
properties: {
|
|
74
|
+
'terminal.enableCopy': {
|
|
75
|
+
type: 'boolean',
|
|
76
|
+
description: nls.localize('theia/terminal/enableCopy', 'Enable ctrl-c (cmd-c on macOS) to copy selected text'),
|
|
77
|
+
default: true
|
|
78
|
+
},
|
|
79
|
+
'terminal.enablePaste': {
|
|
80
|
+
type: 'boolean',
|
|
81
|
+
description: nls.localize('theia/terminal/enablePaste', 'Enable ctrl-v (cmd-v on macOS) to paste from clipboard'),
|
|
82
|
+
default: true
|
|
83
|
+
},
|
|
84
|
+
'terminal.integrated.fontFamily': {
|
|
85
|
+
type: 'string',
|
|
86
|
+
markdownDescription: nls.localizeByDefault('Controls the font family of the terminal. Defaults to {0}\'s value.', '`#editor.fontFamily#`'),
|
|
87
|
+
default: editorGeneratedPreferenceProperties['editor.fontFamily'].default,
|
|
88
|
+
},
|
|
89
|
+
'terminal.integrated.fontSize': {
|
|
90
|
+
type: 'number',
|
|
91
|
+
description: nls.localizeByDefault('Controls the font size in pixels of the terminal.'),
|
|
92
|
+
minimum: 6,
|
|
93
|
+
default: editorGeneratedPreferenceProperties['editor.fontSize'].default
|
|
94
|
+
},
|
|
95
|
+
'terminal.integrated.fontWeight': {
|
|
96
|
+
type: 'string',
|
|
97
|
+
enum: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
98
|
+
description: nls.localizeByDefault('The font weight to use within the terminal for non-bold text. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.'),
|
|
99
|
+
default: 'normal'
|
|
100
|
+
},
|
|
101
|
+
'terminal.integrated.fontWeightBold': {
|
|
102
|
+
type: 'string',
|
|
103
|
+
enum: ['normal', 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900'],
|
|
104
|
+
description: nls.localizeByDefault('The font weight to use within the terminal for bold text. Accepts \"normal\" and \"bold\" keywords or numbers between 1 and 1000.'),
|
|
105
|
+
default: 'bold'
|
|
106
|
+
},
|
|
107
|
+
'terminal.integrated.drawBoldTextInBrightColors': {
|
|
108
|
+
description: nls.localizeByDefault('Controls whether bold text in the terminal will always use the \"bright\" ANSI color variant.'),
|
|
109
|
+
type: 'boolean',
|
|
110
|
+
default: true,
|
|
111
|
+
},
|
|
112
|
+
'terminal.integrated.letterSpacing': {
|
|
113
|
+
description: nls.localizeByDefault('Controls the letter spacing of the terminal. This is an integer value which represents the number of additional pixels to add between characters.'),
|
|
114
|
+
type: 'number',
|
|
115
|
+
default: 1
|
|
116
|
+
},
|
|
117
|
+
'terminal.integrated.lineHeight': {
|
|
118
|
+
description: nls.localizeByDefault('Controls the line height of the terminal. This number is multiplied by the terminal font size to get the actual line-height in pixels.'),
|
|
119
|
+
type: 'number',
|
|
120
|
+
minimum: 1,
|
|
121
|
+
default: 1
|
|
122
|
+
},
|
|
123
|
+
'terminal.integrated.scrollback': {
|
|
124
|
+
description: nls.localizeByDefault('Controls the maximum number of lines the terminal keeps in its buffer. We pre-allocate memory based on this value in order to ensure a smooth experience. As such, as the value increases, so will the amount of memory.'),
|
|
125
|
+
type: 'number',
|
|
126
|
+
default: 1000
|
|
127
|
+
},
|
|
128
|
+
'terminal.integrated.fastScrollSensitivity': {
|
|
129
|
+
markdownDescription: nls.localizeByDefault('Scrolling speed multiplier when pressing `Alt`.'),
|
|
130
|
+
type: 'number',
|
|
131
|
+
default: 5,
|
|
132
|
+
},
|
|
133
|
+
'terminal.integrated.rendererType': {
|
|
134
|
+
description: nls.localize('theia/terminal/rendererType', 'Controls how the terminal is rendered.'),
|
|
135
|
+
type: 'string',
|
|
136
|
+
enum: ['canvas', 'dom'],
|
|
137
|
+
default: 'canvas',
|
|
138
|
+
deprecationMessage: nls.localize('theia/terminal/rendererTypeDeprecationMessage', 'The renderer type is no longer supported as an option.')
|
|
139
|
+
},
|
|
140
|
+
'terminal.integrated.copyOnSelection': {
|
|
141
|
+
description: nls.localizeByDefault('Controls whether text selected in the terminal will be copied to the clipboard.'),
|
|
142
|
+
type: 'boolean',
|
|
143
|
+
default: false,
|
|
144
|
+
},
|
|
145
|
+
'terminal.integrated.cursorBlinking': {
|
|
146
|
+
description: nls.localizeByDefault('Controls whether the terminal cursor blinks.'),
|
|
147
|
+
type: 'boolean',
|
|
148
|
+
default: false
|
|
149
|
+
},
|
|
150
|
+
'terminal.integrated.cursorStyle': {
|
|
151
|
+
description: nls.localizeByDefault('Controls the style of terminal cursor when the terminal is focused.'),
|
|
152
|
+
enum: ['block', 'underline', 'line'],
|
|
153
|
+
default: 'block'
|
|
154
|
+
},
|
|
155
|
+
'terminal.integrated.cursorWidth': {
|
|
156
|
+
markdownDescription: nls.localizeByDefault('Controls the width of the cursor when {0} is set to {1}.', '`#terminal.integrated.cursorStyle#`', '`line`'),
|
|
157
|
+
type: 'number',
|
|
158
|
+
default: 1
|
|
159
|
+
},
|
|
160
|
+
'terminal.integrated.shell.windows': {
|
|
161
|
+
type: ['string', 'null'],
|
|
162
|
+
typeDetails: { isFilepath: true },
|
|
163
|
+
markdownDescription: nls.localize('theia/terminal/shellWindows', 'The path of the shell that the terminal uses on Windows. (default: \'{0}\').', 'C:\\Windows\\System32\\cmd.exe'),
|
|
164
|
+
default: undefined,
|
|
165
|
+
deprecationMessage: shellArgsDeprecatedMessage(OS.Type.Windows),
|
|
166
|
+
},
|
|
167
|
+
'terminal.integrated.shell.osx': {
|
|
168
|
+
type: ['string', 'null'],
|
|
169
|
+
markdownDescription: nls.localize('theia/terminal/shellOsx', 'The path of the shell that the terminal uses on macOS (default: \'{0}\'}).', '/bin/bash'),
|
|
170
|
+
default: undefined,
|
|
171
|
+
deprecationMessage: shellArgsDeprecatedMessage(OS.Type.OSX),
|
|
172
|
+
},
|
|
173
|
+
'terminal.integrated.shell.linux': {
|
|
174
|
+
type: ['string', 'null'],
|
|
175
|
+
markdownDescription: nls.localize('theia/terminal/shellLinux', 'The path of the shell that the terminal uses on Linux (default: \'{0}\'}).', '/bin/bash'),
|
|
176
|
+
default: undefined,
|
|
177
|
+
deprecationMessage: shellArgsDeprecatedMessage(OS.Type.Linux),
|
|
178
|
+
},
|
|
179
|
+
'terminal.integrated.shellArgs.windows': {
|
|
180
|
+
type: 'array',
|
|
181
|
+
markdownDescription: nls.localize('theia/terminal/shellArgsWindows', 'The command line arguments to use when on the Windows terminal.'),
|
|
182
|
+
default: [],
|
|
183
|
+
deprecationMessage: shellArgsDeprecatedMessage(OS.Type.Windows),
|
|
184
|
+
},
|
|
185
|
+
'terminal.integrated.shellArgs.osx': {
|
|
186
|
+
type: 'array',
|
|
187
|
+
markdownDescription: nls.localize('theia/terminal/shellArgsOsx', 'The command line arguments to use when on the macOS terminal.'),
|
|
188
|
+
default: [
|
|
189
|
+
'-l'
|
|
190
|
+
],
|
|
191
|
+
deprecationMessage: shellArgsDeprecatedMessage(OS.Type.OSX),
|
|
192
|
+
},
|
|
193
|
+
'terminal.integrated.shellArgs.linux': {
|
|
194
|
+
type: 'array',
|
|
195
|
+
markdownDescription: nls.localize('theia/terminal/shellArgsLinux', 'The command line arguments to use when on the Linux terminal.'),
|
|
196
|
+
default: [],
|
|
197
|
+
deprecationMessage: shellArgsDeprecatedMessage(OS.Type.Linux),
|
|
198
|
+
},
|
|
199
|
+
'terminal.integrated.confirmOnExit': {
|
|
200
|
+
type: 'string',
|
|
201
|
+
description: nls.localizeByDefault('Controls whether to confirm when the window closes if there are active terminal sessions.'),
|
|
202
|
+
enum: ['never', 'always', 'hasChildProcesses'],
|
|
203
|
+
enumDescriptions: [
|
|
204
|
+
nls.localizeByDefault('Never confirm.'),
|
|
205
|
+
nls.localizeByDefault('Always confirm if there are terminals.'),
|
|
206
|
+
nls.localizeByDefault('Confirm if there are any terminals that have child processes.'),
|
|
207
|
+
],
|
|
208
|
+
default: 'never'
|
|
209
|
+
},
|
|
210
|
+
'terminal.integrated.enablePersistentSessions': {
|
|
211
|
+
type: 'boolean',
|
|
212
|
+
description: nls.localizeByDefault('Persist terminal sessions/history for the workspace across window reloads.'),
|
|
213
|
+
default: true
|
|
214
|
+
},
|
|
215
|
+
'terminal.integrated.defaultProfile.windows': {
|
|
216
|
+
type: 'string',
|
|
217
|
+
description: nls.localize('theia/terminal/defaultProfile', 'The default profile used on {0}', OS.Type.Windows.toString())
|
|
218
|
+
|
|
219
|
+
},
|
|
220
|
+
'terminal.integrated.defaultProfile.linux': {
|
|
221
|
+
type: 'string',
|
|
222
|
+
description: nls.localize('theia/terminal/defaultProfile', 'The default profile used on {0}', OS.Type.Linux.toString())
|
|
223
|
+
|
|
224
|
+
},
|
|
225
|
+
'terminal.integrated.defaultProfile.osx': {
|
|
226
|
+
type: 'string',
|
|
227
|
+
description: nls.localize('theia/terminal/defaultProfile', 'The default profile used on {0}', OS.Type.OSX.toString())
|
|
228
|
+
},
|
|
229
|
+
'terminal.integrated.profiles.windows': {
|
|
230
|
+
markdownDescription: nls.localize('theia/terminal/profiles', 'The profiles to present when creating a new terminal. Set the path property manually with optional args.\nSet an existing profile to `null` to hide the profile from the list, for example: `"{0}": null`.', 'cmd'),
|
|
231
|
+
anyOf: [
|
|
232
|
+
{
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties: {
|
|
235
|
+
},
|
|
236
|
+
additionalProperties: {
|
|
237
|
+
oneOf: [{
|
|
238
|
+
type: 'object',
|
|
239
|
+
additionalProperties: false,
|
|
240
|
+
properties: {
|
|
241
|
+
path: pathProperty,
|
|
242
|
+
args: {
|
|
243
|
+
...stringOrStringArray,
|
|
244
|
+
description: nls.localize('theia/terminal/profileArgs', 'The shell arguments that this profile uses.'),
|
|
245
|
+
|
|
246
|
+
},
|
|
247
|
+
...commonProfileProperties
|
|
248
|
+
},
|
|
249
|
+
required: ['path']
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
type: 'object',
|
|
253
|
+
additionalProperties: false,
|
|
254
|
+
properties: {
|
|
255
|
+
source: {
|
|
256
|
+
type: 'string',
|
|
257
|
+
description: nls.localizeByDefault('A profile source that will auto detect the paths to the shell. Note that non-standard executable locations are not supported and must be created manually in a new profile.')
|
|
258
|
+
},
|
|
259
|
+
args: {
|
|
260
|
+
...stringOrStringArray,
|
|
261
|
+
description: nls.localize('theia/terminal/profileArgs', 'The shell arguments that this profile uses.'),
|
|
262
|
+
|
|
263
|
+
},
|
|
264
|
+
...commonProfileProperties
|
|
265
|
+
},
|
|
266
|
+
required: ['source'],
|
|
267
|
+
default: {
|
|
268
|
+
path: 'C:\\Windows\\System32\\cmd.exe'
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
}, {
|
|
272
|
+
type: 'null'
|
|
273
|
+
}]
|
|
274
|
+
},
|
|
275
|
+
default: {
|
|
276
|
+
cmd: {
|
|
277
|
+
path: 'C:\\Windows\\System32\\cmd.exe'
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{ type: 'null' }
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
'terminal.integrated.profiles.linux': {
|
|
285
|
+
markdownDescription: nls.localize('theia/terminal/profiles', 'The profiles to present when creating a new terminal. Set the path property manually with optional args.\nSet an existing profile to `null` to hide the profile from the list, for example: `"{0}": null`.', 'bash'),
|
|
286
|
+
anyOf: [{
|
|
287
|
+
type: 'object',
|
|
288
|
+
properties: {
|
|
289
|
+
},
|
|
290
|
+
additionalProperties: {
|
|
291
|
+
oneOf: [
|
|
292
|
+
{
|
|
293
|
+
type: 'object',
|
|
294
|
+
properties: {
|
|
295
|
+
path: pathProperty,
|
|
296
|
+
args: {
|
|
297
|
+
type: 'array',
|
|
298
|
+
items: { type: 'string' },
|
|
299
|
+
description: nls.localize('theia/terminal/profileArgs', 'The shell arguments that this profile uses.'),
|
|
300
|
+
},
|
|
301
|
+
...commonProfileProperties
|
|
302
|
+
},
|
|
303
|
+
required: ['path'],
|
|
304
|
+
additionalProperties: false,
|
|
305
|
+
},
|
|
306
|
+
{ type: 'null' }
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
default: {
|
|
310
|
+
path: '${env:SHELL}',
|
|
311
|
+
args: ['-l']
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
},
|
|
315
|
+
{ type: 'null' }
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
'terminal.integrated.profiles.osx': {
|
|
319
|
+
markdownDescription: nls.localize('theia/terminal/profiles', 'The profiles to present when creating a new terminal. Set the path property manually with optional args.\nSet an existing profile to `null` to hide the profile from the list, for example: `"{0}": null`.', 'zsh'),
|
|
320
|
+
anyOf: [{
|
|
321
|
+
type: 'object',
|
|
322
|
+
properties: {
|
|
323
|
+
},
|
|
324
|
+
additionalProperties: {
|
|
325
|
+
oneOf: [
|
|
326
|
+
{
|
|
327
|
+
type: 'object',
|
|
328
|
+
properties: {
|
|
329
|
+
path: pathProperty,
|
|
330
|
+
args: {
|
|
331
|
+
type: 'array',
|
|
332
|
+
items: { type: 'string' },
|
|
333
|
+
description: nls.localize('theia/terminal/profileArgs', 'The shell arguments that this profile uses.'),
|
|
334
|
+
},
|
|
335
|
+
...commonProfileProperties
|
|
336
|
+
},
|
|
337
|
+
required: ['path'],
|
|
338
|
+
additionalProperties: false,
|
|
339
|
+
},
|
|
340
|
+
{ type: 'null' }
|
|
341
|
+
]
|
|
342
|
+
},
|
|
343
|
+
default: {
|
|
344
|
+
path: '${env:SHELL}',
|
|
345
|
+
args: ['-l']
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
},
|
|
349
|
+
{ type: 'null' }
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
}
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
export type Profiles = null | {
|
|
356
|
+
[key: string]: {
|
|
357
|
+
path?: string | string[],
|
|
358
|
+
source?: string,
|
|
359
|
+
args?: string | string[],
|
|
360
|
+
env?: { [key: string]: string },
|
|
361
|
+
overrideName?: boolean;
|
|
362
|
+
icon?: string,
|
|
363
|
+
color?: string
|
|
364
|
+
}
|
|
365
|
+
};
|
|
366
|
+
|
|
367
|
+
export interface TerminalConfiguration {
|
|
368
|
+
'terminal.enableCopy': boolean
|
|
369
|
+
'terminal.enablePaste': boolean
|
|
370
|
+
// xterm compatible, see https://xtermjs.org/docs/api/terminal/interfaces/iterminaloptions/
|
|
371
|
+
'terminal.integrated.fontFamily': string
|
|
372
|
+
'terminal.integrated.fontSize': number
|
|
373
|
+
'terminal.integrated.fontWeight': FontWeight
|
|
374
|
+
'terminal.integrated.fontWeightBold': FontWeight,
|
|
375
|
+
'terminal.integrated.drawBoldTextInBrightColors': boolean,
|
|
376
|
+
'terminal.integrated.letterSpacing': number
|
|
377
|
+
'terminal.integrated.lineHeight': number,
|
|
378
|
+
'terminal.integrated.scrollback': number,
|
|
379
|
+
'terminal.integrated.fastScrollSensitivity': number,
|
|
380
|
+
'terminal.integrated.rendererType': TerminalRendererType,
|
|
381
|
+
'terminal.integrated.copyOnSelection': boolean,
|
|
382
|
+
'terminal.integrated.cursorBlinking': boolean,
|
|
383
|
+
'terminal.integrated.cursorStyle': CursorStyleVSCode,
|
|
384
|
+
'terminal.integrated.cursorWidth': number,
|
|
385
|
+
'terminal.integrated.shell.windows': string | null | undefined,
|
|
386
|
+
'terminal.integrated.shell.osx': string | null | undefined,
|
|
387
|
+
'terminal.integrated.shell.linux': string | null | undefined,
|
|
388
|
+
'terminal.integrated.shellArgs.windows': string[],
|
|
389
|
+
'terminal.integrated.shellArgs.osx': string[],
|
|
390
|
+
'terminal.integrated.shellArgs.linux': string[],
|
|
391
|
+
'terminal.integrated.defaultProfile.windows': string,
|
|
392
|
+
'terminal.integrated.defaultProfile.linux': string,
|
|
393
|
+
'terminal.integrated.defaultProfile.osx': string,
|
|
394
|
+
'terminal.integrated.profiles.windows': Profiles
|
|
395
|
+
'terminal.integrated.profiles.linux': Profiles,
|
|
396
|
+
'terminal.integrated.profiles.osx': Profiles,
|
|
397
|
+
'terminal.integrated.confirmOnExit': ConfirmOnExitType
|
|
398
|
+
'terminal.integrated.enablePersistentSessions': boolean
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
type FontWeight = 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
402
|
+
export type CursorStyle = 'block' | 'underline' | 'bar';
|
|
403
|
+
// VS Code uses 'line' to represent 'bar'. The following conversion is necessary to support their preferences.
|
|
404
|
+
export type CursorStyleVSCode = CursorStyle | 'line';
|
|
405
|
+
export type TerminalRendererType = 'canvas' | 'dom';
|
|
406
|
+
export type ConfirmOnExitType = 'never' | 'always' | 'hasChildProcesses';
|
|
407
|
+
export const DEFAULT_TERMINAL_RENDERER_TYPE = 'canvas';
|
|
408
|
+
export function isTerminalRendererType(arg: unknown): arg is TerminalRendererType {
|
|
409
|
+
return typeof arg === 'string' && (arg === 'canvas' || arg === 'dom');
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export const TerminalPreferenceContribution = Symbol('TerminalPreferenceContribution');
|
|
413
|
+
export const TerminalPreferences = Symbol('TerminalPreferences');
|
|
414
|
+
export type TerminalPreferences = PreferenceProxy<TerminalConfiguration>;
|
|
415
|
+
|
|
416
|
+
export function createTerminalPreferences(preferences: PreferenceService, schema: PreferenceSchema = TerminalConfigSchema): TerminalPreferences {
|
|
417
|
+
return createPreferenceProxy(preferences, schema);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export function bindTerminalPreferences(bind: interfaces.Bind): void {
|
|
421
|
+
bind(TerminalPreferences).toDynamicValue(ctx => {
|
|
422
|
+
const preferences = ctx.container.get<PreferenceService>(PreferenceService);
|
|
423
|
+
const contribution = ctx.container.get<PreferenceContribution>(TerminalPreferenceContribution);
|
|
424
|
+
return createTerminalPreferences(preferences, contribution.schema);
|
|
425
|
+
}).inSingletonScope();
|
|
426
|
+
bind(TerminalPreferenceContribution).toConstantValue({ schema: TerminalConfigSchema });
|
|
427
|
+
bind(PreferenceContribution).toService(TerminalPreferenceContribution);
|
|
428
|
+
}
|