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