@theia/terminal 1.53.0-next.4 → 1.53.0-next.55

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 (45) hide show
  1. package/README.md +30 -30
  2. package/lib/browser/terminal-link-provider.d.ts +1 -1
  3. package/lib/browser/terminal-link-provider.d.ts.map +1 -1
  4. package/lib/browser/terminal-widget-impl.js +4 -4
  5. package/package.json +10 -10
  6. package/src/browser/base/terminal-service.ts +60 -60
  7. package/src/browser/base/terminal-widget.ts +268 -268
  8. package/src/browser/index.ts +17 -17
  9. package/src/browser/search/terminal-search-container.ts +28 -28
  10. package/src/browser/search/terminal-search-widget.tsx +161 -161
  11. package/src/browser/shell-terminal-profile.ts +45 -45
  12. package/src/browser/style/terminal-search.css +99 -99
  13. package/src/browser/style/terminal.css +32 -32
  14. package/src/browser/terminal-contribution.ts +19 -19
  15. package/src/browser/terminal-copy-on-selection-handler.ts +92 -92
  16. package/src/browser/terminal-file-link-provider.ts +289 -289
  17. package/src/browser/terminal-frontend-contribution.ts +1134 -1134
  18. package/src/browser/terminal-frontend-module.ts +138 -138
  19. package/src/browser/terminal-link-helpers.ts +187 -187
  20. package/src/browser/terminal-link-provider.ts +203 -203
  21. package/src/browser/terminal-preferences.ts +428 -428
  22. package/src/browser/terminal-profile-service.ts +180 -180
  23. package/src/browser/terminal-quick-open-service.ts +132 -132
  24. package/src/browser/terminal-theme-service.ts +213 -213
  25. package/src/browser/terminal-url-link-provider.ts +66 -66
  26. package/src/browser/terminal-widget-impl.ts +996 -996
  27. package/src/common/base-terminal-protocol.ts +125 -125
  28. package/src/common/shell-terminal-protocol.ts +103 -103
  29. package/src/common/terminal-common-module.ts +30 -30
  30. package/src/common/terminal-protocol.ts +32 -32
  31. package/src/common/terminal-watcher.ts +69 -69
  32. package/src/node/base-terminal-server.ts +173 -173
  33. package/src/node/buffering-stream.spec.ts +46 -46
  34. package/src/node/buffering-stream.ts +95 -95
  35. package/src/node/index.ts +17 -17
  36. package/src/node/shell-process.ts +102 -102
  37. package/src/node/shell-terminal-server.spec.ts +40 -40
  38. package/src/node/shell-terminal-server.ts +223 -223
  39. package/src/node/terminal-backend-contribution.slow-spec.ts +63 -63
  40. package/src/node/terminal-backend-contribution.ts +60 -60
  41. package/src/node/terminal-backend-module.ts +82 -82
  42. package/src/node/terminal-server.spec.ts +47 -47
  43. package/src/node/terminal-server.ts +52 -52
  44. package/src/node/test/terminal-test-container.ts +39 -39
  45. package/src/package.spec.ts +28 -28
@@ -1,268 +1,268 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2018 Red Hat, Inc. 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
- import { Event, ViewColumn } from '@theia/core';
18
- import { BaseWidget } from '@theia/core/lib/browser';
19
- import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
20
- import { ThemeIcon } from '@theia/core/lib/common/theme';
21
- import { CommandLineOptions } from '@theia/process/lib/common/shell-command-builder';
22
- import { TerminalSearchWidget } from '../search/terminal-search-widget';
23
- import { TerminalProcessInfo, TerminalExitReason } from '../../common/base-terminal-protocol';
24
- import URI from '@theia/core/lib/common/uri';
25
-
26
- export interface TerminalDimensions {
27
- cols: number;
28
- rows: number;
29
- }
30
-
31
- export interface TerminalExitStatus {
32
- readonly code: number | undefined;
33
- readonly reason: TerminalExitReason;
34
- }
35
-
36
- export type TerminalLocationOptions = TerminalLocation | TerminalEditorLocation | TerminalSplitLocation;
37
-
38
- export enum TerminalLocation {
39
- Panel = 1,
40
- Editor = 2
41
- }
42
-
43
- export interface TerminalEditorLocation {
44
- readonly viewColumn: ViewColumn;
45
- readonly preserveFocus?: boolean;
46
- }
47
-
48
- export interface TerminalSplitLocation {
49
- readonly parentTerminal: string;
50
- }
51
-
52
- export interface TerminalBuffer {
53
- readonly length: number;
54
- /**
55
- * @param start zero based index of the first line to return
56
- * @param length the max number or lines to return
57
- */
58
- getLines(start: number, length: number): string[];
59
- }
60
-
61
- /**
62
- * Terminal UI widget.
63
- */
64
- export abstract class TerminalWidget extends BaseWidget {
65
-
66
- abstract processId: Promise<number>;
67
- /**
68
- * Get the current executable and arguments.
69
- */
70
- abstract processInfo: Promise<TerminalProcessInfo>;
71
-
72
- /** The ids of extensions contributing to the environment of this terminal mapped to the provided description for their changes. */
73
- abstract envVarCollectionDescriptionsByExtension: Promise<Map<string, (string | MarkdownString | undefined)[]>>;
74
-
75
- /** Terminal kind that indicates whether a terminal is created by a user or by some extension for a user */
76
- abstract readonly kind: 'user' | string;
77
-
78
- abstract readonly terminalId: number;
79
-
80
- abstract readonly dimensions: TerminalDimensions;
81
-
82
- abstract readonly exitStatus: TerminalExitStatus | undefined;
83
-
84
- /** Terminal widget can be hidden from users until explicitly shown once. */
85
- abstract readonly hiddenFromUser: boolean;
86
-
87
- /** The position of the terminal widget. */
88
- abstract readonly location: TerminalLocationOptions;
89
-
90
- /** The last CWD assigned to the terminal, useful when attempting getCwdURI on a task terminal fails */
91
- lastCwd: URI;
92
-
93
- /**
94
- * Start terminal and return terminal id.
95
- * @param id - terminal id.
96
- */
97
- abstract start(id?: number): Promise<number>;
98
-
99
- /**
100
- * Send text to the terminal server.
101
- * @param text - text content.
102
- */
103
- abstract sendText(text: string): void;
104
-
105
- /**
106
- * Resolves when the command is successfully sent, this doesn't mean that it
107
- * was evaluated. Might reject if terminal wasn't properly started yet.
108
- *
109
- * Note that this method will try to escape your arguments as if it was
110
- * someone inputting everything in a shell.
111
- *
112
- * Supported shells: `bash`, `cmd.exe`, `wsl.exe`, `pwsh/powershell.exe`
113
- */
114
- abstract executeCommand(commandOptions: CommandLineOptions): Promise<void>;
115
-
116
- /** Event that fires when the terminal is connected or reconnected */
117
- abstract onDidOpen: Event<void>;
118
-
119
- /** Event that fires when the terminal fails to connect or reconnect */
120
- abstract onDidOpenFailure: Event<void>;
121
-
122
- /** Event that fires when the terminal size changed */
123
- abstract onSizeChanged: Event<{ cols: number; rows: number; }>;
124
-
125
- /** Event that fires when the terminal receives a key event. */
126
- abstract onKey: Event<{ key: string, domEvent: KeyboardEvent }>;
127
-
128
- /** Event that fires when the terminal input data */
129
- abstract onData: Event<string>;
130
-
131
- abstract onOutput: Event<string>;
132
-
133
- abstract buffer: TerminalBuffer;
134
-
135
- abstract scrollLineUp(): void;
136
-
137
- abstract scrollLineDown(): void;
138
-
139
- abstract scrollToTop(): void;
140
-
141
- abstract scrollToBottom(): void;
142
-
143
- abstract scrollPageUp(): void;
144
-
145
- abstract scrollPageDown(): void;
146
-
147
- abstract resetTerminal(): void;
148
- /**
149
- * Event which fires when terminal did closed. Event value contains closed terminal widget definition.
150
- */
151
- abstract onTerminalDidClose: Event<TerminalWidget>;
152
-
153
- /**
154
- * Cleat terminal output.
155
- */
156
- abstract clearOutput(): void;
157
-
158
- /**
159
- * Select entire content in the terminal.
160
- */
161
- abstract selectAll(): void;
162
-
163
- abstract writeLine(line: string): void;
164
-
165
- abstract write(data: string): void;
166
-
167
- abstract resize(cols: number, rows: number): void;
168
-
169
- /**
170
- * Return Terminal search box widget.
171
- */
172
- abstract getSearchBox(): TerminalSearchWidget;
173
- /**
174
- * Whether the terminal process has child processes.
175
- */
176
- abstract hasChildProcesses(): Promise<boolean>;
177
-
178
- abstract setTitle(title: string): void;
179
-
180
- abstract waitOnExit(waitOnExit?: boolean | string): void;
181
- }
182
-
183
- /**
184
- * Terminal widget options.
185
- */
186
- export const TerminalWidgetOptions = Symbol('TerminalWidgetOptions');
187
- export interface TerminalWidgetOptions {
188
-
189
- /**
190
- * Human readable terminal representation on the UI.
191
- */
192
- readonly title?: string;
193
-
194
- /**
195
- * icon class with or without color modifier
196
- */
197
- readonly iconClass?: string | ThemeIcon;
198
-
199
- /**
200
- * Path to the executable shell. For example: `/bin/bash`, `bash`, `sh`.
201
- */
202
- readonly shellPath?: string;
203
-
204
- /**
205
- * Args for the custom shell executable. A string can be used on Windows only which allows
206
- * specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).
207
- */
208
- readonly shellArgs?: string[] | string;
209
-
210
- /**
211
- * Current working directory.
212
- */
213
- readonly cwd?: string | URI;
214
-
215
- /**
216
- * Environment variables for terminal.
217
- */
218
- readonly env?: { [key: string]: string | null };
219
-
220
- /**
221
- * Whether the terminal process environment should be exactly as provided in `env`.
222
- */
223
- readonly strictEnv?: boolean;
224
-
225
- /**
226
- * In case `destroyTermOnClose` is true - terminal process will be destroyed on close terminal widget, otherwise will be kept
227
- * alive.
228
- */
229
- readonly destroyTermOnClose?: boolean;
230
-
231
- /**
232
- * Terminal server side can send to the client `terminal title` to display this value on the UI. If
233
- * useServerTitle = true then display this title, otherwise display title defined by 'title' argument.
234
- */
235
- readonly useServerTitle?: boolean;
236
-
237
- /**
238
- * Whether it is a pseudo terminal where an extension controls its input and output.
239
- */
240
- readonly isPseudoTerminal?: boolean;
241
-
242
- /**
243
- * Terminal id. Should be unique for all DOM.
244
- */
245
- readonly id?: string;
246
-
247
- /**
248
- * Terminal attributes. Can be useful to apply some implementation specific information.
249
- */
250
- readonly attributes?: { [key: string]: string | null };
251
-
252
- /**
253
- * Terminal kind that indicates whether a terminal is created by a user or by some extension for a user
254
- */
255
- readonly kind?: 'user' | string;
256
-
257
- /**
258
- * When enabled the terminal will run the process as normal but not be surfaced to the user until `Terminal.show` is called.
259
- */
260
- readonly hideFromUser?: boolean;
261
-
262
- readonly location?: TerminalLocationOptions;
263
-
264
- /**
265
- * When enabled, the terminal will not be persisted across window reloads.
266
- */
267
- readonly isTransient?: boolean;
268
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2018 Red Hat, Inc. 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
+ import { Event, ViewColumn } from '@theia/core';
18
+ import { BaseWidget } from '@theia/core/lib/browser';
19
+ import { MarkdownString } from '@theia/core/lib/common/markdown-rendering/markdown-string';
20
+ import { ThemeIcon } from '@theia/core/lib/common/theme';
21
+ import { CommandLineOptions } from '@theia/process/lib/common/shell-command-builder';
22
+ import { TerminalSearchWidget } from '../search/terminal-search-widget';
23
+ import { TerminalProcessInfo, TerminalExitReason } from '../../common/base-terminal-protocol';
24
+ import URI from '@theia/core/lib/common/uri';
25
+
26
+ export interface TerminalDimensions {
27
+ cols: number;
28
+ rows: number;
29
+ }
30
+
31
+ export interface TerminalExitStatus {
32
+ readonly code: number | undefined;
33
+ readonly reason: TerminalExitReason;
34
+ }
35
+
36
+ export type TerminalLocationOptions = TerminalLocation | TerminalEditorLocation | TerminalSplitLocation;
37
+
38
+ export enum TerminalLocation {
39
+ Panel = 1,
40
+ Editor = 2
41
+ }
42
+
43
+ export interface TerminalEditorLocation {
44
+ readonly viewColumn: ViewColumn;
45
+ readonly preserveFocus?: boolean;
46
+ }
47
+
48
+ export interface TerminalSplitLocation {
49
+ readonly parentTerminal: string;
50
+ }
51
+
52
+ export interface TerminalBuffer {
53
+ readonly length: number;
54
+ /**
55
+ * @param start zero based index of the first line to return
56
+ * @param length the max number or lines to return
57
+ */
58
+ getLines(start: number, length: number): string[];
59
+ }
60
+
61
+ /**
62
+ * Terminal UI widget.
63
+ */
64
+ export abstract class TerminalWidget extends BaseWidget {
65
+
66
+ abstract processId: Promise<number>;
67
+ /**
68
+ * Get the current executable and arguments.
69
+ */
70
+ abstract processInfo: Promise<TerminalProcessInfo>;
71
+
72
+ /** The ids of extensions contributing to the environment of this terminal mapped to the provided description for their changes. */
73
+ abstract envVarCollectionDescriptionsByExtension: Promise<Map<string, (string | MarkdownString | undefined)[]>>;
74
+
75
+ /** Terminal kind that indicates whether a terminal is created by a user or by some extension for a user */
76
+ abstract readonly kind: 'user' | string;
77
+
78
+ abstract readonly terminalId: number;
79
+
80
+ abstract readonly dimensions: TerminalDimensions;
81
+
82
+ abstract readonly exitStatus: TerminalExitStatus | undefined;
83
+
84
+ /** Terminal widget can be hidden from users until explicitly shown once. */
85
+ abstract readonly hiddenFromUser: boolean;
86
+
87
+ /** The position of the terminal widget. */
88
+ abstract readonly location: TerminalLocationOptions;
89
+
90
+ /** The last CWD assigned to the terminal, useful when attempting getCwdURI on a task terminal fails */
91
+ lastCwd: URI;
92
+
93
+ /**
94
+ * Start terminal and return terminal id.
95
+ * @param id - terminal id.
96
+ */
97
+ abstract start(id?: number): Promise<number>;
98
+
99
+ /**
100
+ * Send text to the terminal server.
101
+ * @param text - text content.
102
+ */
103
+ abstract sendText(text: string): void;
104
+
105
+ /**
106
+ * Resolves when the command is successfully sent, this doesn't mean that it
107
+ * was evaluated. Might reject if terminal wasn't properly started yet.
108
+ *
109
+ * Note that this method will try to escape your arguments as if it was
110
+ * someone inputting everything in a shell.
111
+ *
112
+ * Supported shells: `bash`, `cmd.exe`, `wsl.exe`, `pwsh/powershell.exe`
113
+ */
114
+ abstract executeCommand(commandOptions: CommandLineOptions): Promise<void>;
115
+
116
+ /** Event that fires when the terminal is connected or reconnected */
117
+ abstract onDidOpen: Event<void>;
118
+
119
+ /** Event that fires when the terminal fails to connect or reconnect */
120
+ abstract onDidOpenFailure: Event<void>;
121
+
122
+ /** Event that fires when the terminal size changed */
123
+ abstract onSizeChanged: Event<{ cols: number; rows: number; }>;
124
+
125
+ /** Event that fires when the terminal receives a key event. */
126
+ abstract onKey: Event<{ key: string, domEvent: KeyboardEvent }>;
127
+
128
+ /** Event that fires when the terminal input data */
129
+ abstract onData: Event<string>;
130
+
131
+ abstract onOutput: Event<string>;
132
+
133
+ abstract buffer: TerminalBuffer;
134
+
135
+ abstract scrollLineUp(): void;
136
+
137
+ abstract scrollLineDown(): void;
138
+
139
+ abstract scrollToTop(): void;
140
+
141
+ abstract scrollToBottom(): void;
142
+
143
+ abstract scrollPageUp(): void;
144
+
145
+ abstract scrollPageDown(): void;
146
+
147
+ abstract resetTerminal(): void;
148
+ /**
149
+ * Event which fires when terminal did closed. Event value contains closed terminal widget definition.
150
+ */
151
+ abstract onTerminalDidClose: Event<TerminalWidget>;
152
+
153
+ /**
154
+ * Cleat terminal output.
155
+ */
156
+ abstract clearOutput(): void;
157
+
158
+ /**
159
+ * Select entire content in the terminal.
160
+ */
161
+ abstract selectAll(): void;
162
+
163
+ abstract writeLine(line: string): void;
164
+
165
+ abstract write(data: string): void;
166
+
167
+ abstract resize(cols: number, rows: number): void;
168
+
169
+ /**
170
+ * Return Terminal search box widget.
171
+ */
172
+ abstract getSearchBox(): TerminalSearchWidget;
173
+ /**
174
+ * Whether the terminal process has child processes.
175
+ */
176
+ abstract hasChildProcesses(): Promise<boolean>;
177
+
178
+ abstract setTitle(title: string): void;
179
+
180
+ abstract waitOnExit(waitOnExit?: boolean | string): void;
181
+ }
182
+
183
+ /**
184
+ * Terminal widget options.
185
+ */
186
+ export const TerminalWidgetOptions = Symbol('TerminalWidgetOptions');
187
+ export interface TerminalWidgetOptions {
188
+
189
+ /**
190
+ * Human readable terminal representation on the UI.
191
+ */
192
+ readonly title?: string;
193
+
194
+ /**
195
+ * icon class with or without color modifier
196
+ */
197
+ readonly iconClass?: string | ThemeIcon;
198
+
199
+ /**
200
+ * Path to the executable shell. For example: `/bin/bash`, `bash`, `sh`.
201
+ */
202
+ readonly shellPath?: string;
203
+
204
+ /**
205
+ * Args for the custom shell executable. A string can be used on Windows only which allows
206
+ * specifying shell args in [command-line format](https://msdn.microsoft.com/en-au/08dfcab2-eb6e-49a4-80eb-87d4076c98c6).
207
+ */
208
+ readonly shellArgs?: string[] | string;
209
+
210
+ /**
211
+ * Current working directory.
212
+ */
213
+ readonly cwd?: string | URI;
214
+
215
+ /**
216
+ * Environment variables for terminal.
217
+ */
218
+ readonly env?: { [key: string]: string | null };
219
+
220
+ /**
221
+ * Whether the terminal process environment should be exactly as provided in `env`.
222
+ */
223
+ readonly strictEnv?: boolean;
224
+
225
+ /**
226
+ * In case `destroyTermOnClose` is true - terminal process will be destroyed on close terminal widget, otherwise will be kept
227
+ * alive.
228
+ */
229
+ readonly destroyTermOnClose?: boolean;
230
+
231
+ /**
232
+ * Terminal server side can send to the client `terminal title` to display this value on the UI. If
233
+ * useServerTitle = true then display this title, otherwise display title defined by 'title' argument.
234
+ */
235
+ readonly useServerTitle?: boolean;
236
+
237
+ /**
238
+ * Whether it is a pseudo terminal where an extension controls its input and output.
239
+ */
240
+ readonly isPseudoTerminal?: boolean;
241
+
242
+ /**
243
+ * Terminal id. Should be unique for all DOM.
244
+ */
245
+ readonly id?: string;
246
+
247
+ /**
248
+ * Terminal attributes. Can be useful to apply some implementation specific information.
249
+ */
250
+ readonly attributes?: { [key: string]: string | null };
251
+
252
+ /**
253
+ * Terminal kind that indicates whether a terminal is created by a user or by some extension for a user
254
+ */
255
+ readonly kind?: 'user' | string;
256
+
257
+ /**
258
+ * When enabled the terminal will run the process as normal but not be surfaced to the user until `Terminal.show` is called.
259
+ */
260
+ readonly hideFromUser?: boolean;
261
+
262
+ readonly location?: TerminalLocationOptions;
263
+
264
+ /**
265
+ * When enabled, the terminal will not be persisted across window reloads.
266
+ */
267
+ readonly isTransient?: boolean;
268
+ }
@@ -1,17 +1,17 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2017 TypeFox 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
- export * from './terminal-frontend-module';
1
+ // *****************************************************************************
2
+ // Copyright (C) 2017 TypeFox 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
+ export * from './terminal-frontend-module';
@@ -1,28 +1,28 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2019 Red Hat, Inc. 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
- import { interfaces } from '@theia/core/shared/inversify';
18
- import { TerminalSearchWidget, TerminalSearchWidgetFactory } from './terminal-search-widget';
19
- import { Terminal } from 'xterm';
20
-
21
- export function createTerminalSearchFactory(container: interfaces.Container): TerminalSearchWidgetFactory {
22
- container.bind(TerminalSearchWidget).toSelf().inSingletonScope();
23
-
24
- return (terminal: Terminal) => {
25
- container.bind(Terminal).toConstantValue(terminal);
26
- return container.get(TerminalSearchWidget);
27
- };
28
- }
1
+ // *****************************************************************************
2
+ // Copyright (C) 2019 Red Hat, Inc. 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
+ import { interfaces } from '@theia/core/shared/inversify';
18
+ import { TerminalSearchWidget, TerminalSearchWidgetFactory } from './terminal-search-widget';
19
+ import { Terminal } from 'xterm';
20
+
21
+ export function createTerminalSearchFactory(container: interfaces.Container): TerminalSearchWidgetFactory {
22
+ container.bind(TerminalSearchWidget).toSelf().inSingletonScope();
23
+
24
+ return (terminal: Terminal) => {
25
+ container.bind(Terminal).toConstantValue(terminal);
26
+ return container.get(TerminalSearchWidget);
27
+ };
28
+ }