@theia/terminal 1.53.0-next.55 → 1.53.0-next.64
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/terminal-widget-impl.js +4 -4
- package/package.json +9 -9
- package/src/browser/base/terminal-service.ts +60 -60
- package/src/browser/base/terminal-widget.ts +268 -268
- 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 +289 -289
- package/src/browser/terminal-frontend-contribution.ts +1134 -1134
- package/src/browser/terminal-frontend-module.ts +138 -138
- 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 -428
- 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 -213
- package/src/browser/terminal-url-link-provider.ts +66 -66
- package/src/browser/terminal-widget-impl.ts +996 -996
- 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 +102 -102
- package/src/node/shell-terminal-server.spec.ts +40 -40
- package/src/node/shell-terminal-server.ts +223 -223
- 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,138 +1,138 @@
|
|
|
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
|
-
import '../../src/browser/style/terminal.css';
|
|
18
|
-
import 'xterm/css/xterm.css';
|
|
19
|
-
|
|
20
|
-
import { ContainerModule, Container } from '@theia/core/shared/inversify';
|
|
21
|
-
import { CommandContribution, MenuContribution, nls } from '@theia/core/lib/common';
|
|
22
|
-
import { bindContributionProvider } from '@theia/core';
|
|
23
|
-
import { KeybindingContribution, WebSocketConnectionProvider, WidgetFactory, FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
24
|
-
import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
25
|
-
import { TerminalFrontendContribution } from './terminal-frontend-contribution';
|
|
26
|
-
import { TerminalWidgetImpl, TERMINAL_WIDGET_FACTORY_ID } from './terminal-widget-impl';
|
|
27
|
-
import { TerminalWidget, TerminalWidgetOptions } from './base/terminal-widget';
|
|
28
|
-
import { ITerminalServer, terminalPath } from '../common/terminal-protocol';
|
|
29
|
-
import { TerminalWatcher } from '../common/terminal-watcher';
|
|
30
|
-
import { IShellTerminalServer, shellTerminalPath, ShellTerminalServerProxy } from '../common/shell-terminal-protocol';
|
|
31
|
-
import { createCommonBindings } from '../common/terminal-common-module';
|
|
32
|
-
import { TerminalService } from './base/terminal-service';
|
|
33
|
-
import { bindTerminalPreferences } from './terminal-preferences';
|
|
34
|
-
import { TerminalContribution } from './terminal-contribution';
|
|
35
|
-
import { TerminalSearchWidgetFactory } from './search/terminal-search-widget';
|
|
36
|
-
import { TerminalQuickOpenService, TerminalQuickOpenContribution } from './terminal-quick-open-service';
|
|
37
|
-
import { createTerminalSearchFactory } from './search/terminal-search-container';
|
|
38
|
-
import { TerminalCopyOnSelectionHandler } from './terminal-copy-on-selection-handler';
|
|
39
|
-
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
|
|
40
|
-
import { TerminalThemeService } from './terminal-theme-service';
|
|
41
|
-
import { QuickAccessContribution } from '@theia/core/lib/browser/quick-input/quick-access';
|
|
42
|
-
import { createXtermLinkFactory, TerminalLinkProvider, TerminalLinkProviderContribution, XtermLinkFactory } from './terminal-link-provider';
|
|
43
|
-
import { UrlLinkProvider } from './terminal-url-link-provider';
|
|
44
|
-
import { FileDiffPostLinkProvider, FileDiffPreLinkProvider, FileLinkProvider, LocalFileLinkProvider } from './terminal-file-link-provider';
|
|
45
|
-
import {
|
|
46
|
-
ContributedTerminalProfileStore, DefaultProfileStore, DefaultTerminalProfileService,
|
|
47
|
-
TerminalProfileService, TerminalProfileStore, UserTerminalProfileStore
|
|
48
|
-
} from './terminal-profile-service';
|
|
49
|
-
|
|
50
|
-
export default new ContainerModule(bind => {
|
|
51
|
-
bindTerminalPreferences(bind);
|
|
52
|
-
|
|
53
|
-
bind(TerminalWidget).to(TerminalWidgetImpl).inTransientScope();
|
|
54
|
-
bind(TerminalWatcher).toSelf().inSingletonScope();
|
|
55
|
-
|
|
56
|
-
let terminalNum = 0;
|
|
57
|
-
bind(WidgetFactory).toDynamicValue(ctx => ({
|
|
58
|
-
id: TERMINAL_WIDGET_FACTORY_ID,
|
|
59
|
-
createWidget: (options: TerminalWidgetOptions) => {
|
|
60
|
-
const child = new Container({ defaultScope: 'Singleton' });
|
|
61
|
-
child.parent = ctx.container;
|
|
62
|
-
const counter = terminalNum++;
|
|
63
|
-
const domId = options.id || 'terminal-' + counter;
|
|
64
|
-
const widgetOptions: TerminalWidgetOptions = {
|
|
65
|
-
title: `${nls.localizeByDefault('Terminal')} ${counter}`,
|
|
66
|
-
useServerTitle: true,
|
|
67
|
-
destroyTermOnClose: true,
|
|
68
|
-
...options
|
|
69
|
-
};
|
|
70
|
-
child.bind(TerminalWidgetOptions).toConstantValue(widgetOptions);
|
|
71
|
-
child.bind('terminal-dom-id').toConstantValue(domId);
|
|
72
|
-
|
|
73
|
-
child.bind(TerminalSearchWidgetFactory).toDynamicValue(context => createTerminalSearchFactory(context.container));
|
|
74
|
-
|
|
75
|
-
return child.get(TerminalWidget);
|
|
76
|
-
}
|
|
77
|
-
}));
|
|
78
|
-
|
|
79
|
-
bind(TerminalQuickOpenService).toSelf().inSingletonScope();
|
|
80
|
-
bind(TerminalCopyOnSelectionHandler).toSelf().inSingletonScope();
|
|
81
|
-
|
|
82
|
-
bind(TerminalQuickOpenContribution).toSelf().inSingletonScope();
|
|
83
|
-
for (const identifier of [CommandContribution, QuickAccessContribution]) {
|
|
84
|
-
bind(identifier).toService(TerminalQuickOpenContribution);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
bind(TerminalThemeService).toSelf().inSingletonScope();
|
|
88
|
-
bind(TerminalFrontendContribution).toSelf().inSingletonScope();
|
|
89
|
-
bind(TerminalService).toService(TerminalFrontendContribution);
|
|
90
|
-
for (const identifier of [CommandContribution, MenuContribution, KeybindingContribution, TabBarToolbarContribution, ColorContribution]) {
|
|
91
|
-
bind(identifier).toService(TerminalFrontendContribution);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
bind(ITerminalServer).toDynamicValue(ctx => {
|
|
95
|
-
const connection = ctx.container.get(WebSocketConnectionProvider);
|
|
96
|
-
const terminalWatcher = ctx.container.get(TerminalWatcher);
|
|
97
|
-
return connection.createProxy<ITerminalServer>(terminalPath, terminalWatcher.getTerminalClient());
|
|
98
|
-
}).inSingletonScope();
|
|
99
|
-
|
|
100
|
-
bind(ShellTerminalServerProxy).toDynamicValue(ctx => {
|
|
101
|
-
const connection = ctx.container.get(WebSocketConnectionProvider);
|
|
102
|
-
const terminalWatcher = ctx.container.get(TerminalWatcher);
|
|
103
|
-
return connection.createProxy<IShellTerminalServer>(shellTerminalPath, terminalWatcher.getTerminalClient());
|
|
104
|
-
}).inSingletonScope();
|
|
105
|
-
bind(IShellTerminalServer).toService(ShellTerminalServerProxy);
|
|
106
|
-
|
|
107
|
-
createCommonBindings(bind);
|
|
108
|
-
|
|
109
|
-
bindContributionProvider(bind, TerminalContribution);
|
|
110
|
-
|
|
111
|
-
// terminal link provider contribution point
|
|
112
|
-
bindContributionProvider(bind, TerminalLinkProvider);
|
|
113
|
-
bind(TerminalLinkProviderContribution).toSelf().inSingletonScope();
|
|
114
|
-
bind(TerminalContribution).toService(TerminalLinkProviderContribution);
|
|
115
|
-
bind(XtermLinkFactory).toFactory(createXtermLinkFactory);
|
|
116
|
-
|
|
117
|
-
// default terminal link provider
|
|
118
|
-
bind(UrlLinkProvider).toSelf().inSingletonScope();
|
|
119
|
-
bind(TerminalLinkProvider).toService(UrlLinkProvider);
|
|
120
|
-
bind(FileLinkProvider).toSelf().inSingletonScope();
|
|
121
|
-
bind(TerminalLinkProvider).toService(FileLinkProvider);
|
|
122
|
-
bind(FileDiffPreLinkProvider).toSelf().inSingletonScope();
|
|
123
|
-
bind(TerminalLinkProvider).toService(FileDiffPreLinkProvider);
|
|
124
|
-
bind(FileDiffPostLinkProvider).toSelf().inSingletonScope();
|
|
125
|
-
bind(TerminalLinkProvider).toService(FileDiffPostLinkProvider);
|
|
126
|
-
bind(LocalFileLinkProvider).toSelf().inSingletonScope();
|
|
127
|
-
bind(TerminalLinkProvider).toService(LocalFileLinkProvider);
|
|
128
|
-
|
|
129
|
-
bind(ContributedTerminalProfileStore).to(DefaultProfileStore).inSingletonScope();
|
|
130
|
-
bind(UserTerminalProfileStore).to(DefaultProfileStore).inSingletonScope();
|
|
131
|
-
bind(TerminalProfileService).toDynamicValue(ctx => {
|
|
132
|
-
const userStore = ctx.container.get<TerminalProfileStore>(UserTerminalProfileStore);
|
|
133
|
-
const contributedStore = ctx.container.get<TerminalProfileStore>(ContributedTerminalProfileStore);
|
|
134
|
-
return new DefaultTerminalProfileService(userStore, contributedStore);
|
|
135
|
-
}).inSingletonScope();
|
|
136
|
-
|
|
137
|
-
bind(FrontendApplicationContribution).toService(TerminalFrontendContribution);
|
|
138
|
-
});
|
|
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
|
+
import '../../src/browser/style/terminal.css';
|
|
18
|
+
import 'xterm/css/xterm.css';
|
|
19
|
+
|
|
20
|
+
import { ContainerModule, Container } from '@theia/core/shared/inversify';
|
|
21
|
+
import { CommandContribution, MenuContribution, nls } from '@theia/core/lib/common';
|
|
22
|
+
import { bindContributionProvider } from '@theia/core';
|
|
23
|
+
import { KeybindingContribution, WebSocketConnectionProvider, WidgetFactory, FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
24
|
+
import { TabBarToolbarContribution } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
25
|
+
import { TerminalFrontendContribution } from './terminal-frontend-contribution';
|
|
26
|
+
import { TerminalWidgetImpl, TERMINAL_WIDGET_FACTORY_ID } from './terminal-widget-impl';
|
|
27
|
+
import { TerminalWidget, TerminalWidgetOptions } from './base/terminal-widget';
|
|
28
|
+
import { ITerminalServer, terminalPath } from '../common/terminal-protocol';
|
|
29
|
+
import { TerminalWatcher } from '../common/terminal-watcher';
|
|
30
|
+
import { IShellTerminalServer, shellTerminalPath, ShellTerminalServerProxy } from '../common/shell-terminal-protocol';
|
|
31
|
+
import { createCommonBindings } from '../common/terminal-common-module';
|
|
32
|
+
import { TerminalService } from './base/terminal-service';
|
|
33
|
+
import { bindTerminalPreferences } from './terminal-preferences';
|
|
34
|
+
import { TerminalContribution } from './terminal-contribution';
|
|
35
|
+
import { TerminalSearchWidgetFactory } from './search/terminal-search-widget';
|
|
36
|
+
import { TerminalQuickOpenService, TerminalQuickOpenContribution } from './terminal-quick-open-service';
|
|
37
|
+
import { createTerminalSearchFactory } from './search/terminal-search-container';
|
|
38
|
+
import { TerminalCopyOnSelectionHandler } from './terminal-copy-on-selection-handler';
|
|
39
|
+
import { ColorContribution } from '@theia/core/lib/browser/color-application-contribution';
|
|
40
|
+
import { TerminalThemeService } from './terminal-theme-service';
|
|
41
|
+
import { QuickAccessContribution } from '@theia/core/lib/browser/quick-input/quick-access';
|
|
42
|
+
import { createXtermLinkFactory, TerminalLinkProvider, TerminalLinkProviderContribution, XtermLinkFactory } from './terminal-link-provider';
|
|
43
|
+
import { UrlLinkProvider } from './terminal-url-link-provider';
|
|
44
|
+
import { FileDiffPostLinkProvider, FileDiffPreLinkProvider, FileLinkProvider, LocalFileLinkProvider } from './terminal-file-link-provider';
|
|
45
|
+
import {
|
|
46
|
+
ContributedTerminalProfileStore, DefaultProfileStore, DefaultTerminalProfileService,
|
|
47
|
+
TerminalProfileService, TerminalProfileStore, UserTerminalProfileStore
|
|
48
|
+
} from './terminal-profile-service';
|
|
49
|
+
|
|
50
|
+
export default new ContainerModule(bind => {
|
|
51
|
+
bindTerminalPreferences(bind);
|
|
52
|
+
|
|
53
|
+
bind(TerminalWidget).to(TerminalWidgetImpl).inTransientScope();
|
|
54
|
+
bind(TerminalWatcher).toSelf().inSingletonScope();
|
|
55
|
+
|
|
56
|
+
let terminalNum = 0;
|
|
57
|
+
bind(WidgetFactory).toDynamicValue(ctx => ({
|
|
58
|
+
id: TERMINAL_WIDGET_FACTORY_ID,
|
|
59
|
+
createWidget: (options: TerminalWidgetOptions) => {
|
|
60
|
+
const child = new Container({ defaultScope: 'Singleton' });
|
|
61
|
+
child.parent = ctx.container;
|
|
62
|
+
const counter = terminalNum++;
|
|
63
|
+
const domId = options.id || 'terminal-' + counter;
|
|
64
|
+
const widgetOptions: TerminalWidgetOptions = {
|
|
65
|
+
title: `${nls.localizeByDefault('Terminal')} ${counter}`,
|
|
66
|
+
useServerTitle: true,
|
|
67
|
+
destroyTermOnClose: true,
|
|
68
|
+
...options
|
|
69
|
+
};
|
|
70
|
+
child.bind(TerminalWidgetOptions).toConstantValue(widgetOptions);
|
|
71
|
+
child.bind('terminal-dom-id').toConstantValue(domId);
|
|
72
|
+
|
|
73
|
+
child.bind(TerminalSearchWidgetFactory).toDynamicValue(context => createTerminalSearchFactory(context.container));
|
|
74
|
+
|
|
75
|
+
return child.get(TerminalWidget);
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
|
|
79
|
+
bind(TerminalQuickOpenService).toSelf().inSingletonScope();
|
|
80
|
+
bind(TerminalCopyOnSelectionHandler).toSelf().inSingletonScope();
|
|
81
|
+
|
|
82
|
+
bind(TerminalQuickOpenContribution).toSelf().inSingletonScope();
|
|
83
|
+
for (const identifier of [CommandContribution, QuickAccessContribution]) {
|
|
84
|
+
bind(identifier).toService(TerminalQuickOpenContribution);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
bind(TerminalThemeService).toSelf().inSingletonScope();
|
|
88
|
+
bind(TerminalFrontendContribution).toSelf().inSingletonScope();
|
|
89
|
+
bind(TerminalService).toService(TerminalFrontendContribution);
|
|
90
|
+
for (const identifier of [CommandContribution, MenuContribution, KeybindingContribution, TabBarToolbarContribution, ColorContribution]) {
|
|
91
|
+
bind(identifier).toService(TerminalFrontendContribution);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
bind(ITerminalServer).toDynamicValue(ctx => {
|
|
95
|
+
const connection = ctx.container.get(WebSocketConnectionProvider);
|
|
96
|
+
const terminalWatcher = ctx.container.get(TerminalWatcher);
|
|
97
|
+
return connection.createProxy<ITerminalServer>(terminalPath, terminalWatcher.getTerminalClient());
|
|
98
|
+
}).inSingletonScope();
|
|
99
|
+
|
|
100
|
+
bind(ShellTerminalServerProxy).toDynamicValue(ctx => {
|
|
101
|
+
const connection = ctx.container.get(WebSocketConnectionProvider);
|
|
102
|
+
const terminalWatcher = ctx.container.get(TerminalWatcher);
|
|
103
|
+
return connection.createProxy<IShellTerminalServer>(shellTerminalPath, terminalWatcher.getTerminalClient());
|
|
104
|
+
}).inSingletonScope();
|
|
105
|
+
bind(IShellTerminalServer).toService(ShellTerminalServerProxy);
|
|
106
|
+
|
|
107
|
+
createCommonBindings(bind);
|
|
108
|
+
|
|
109
|
+
bindContributionProvider(bind, TerminalContribution);
|
|
110
|
+
|
|
111
|
+
// terminal link provider contribution point
|
|
112
|
+
bindContributionProvider(bind, TerminalLinkProvider);
|
|
113
|
+
bind(TerminalLinkProviderContribution).toSelf().inSingletonScope();
|
|
114
|
+
bind(TerminalContribution).toService(TerminalLinkProviderContribution);
|
|
115
|
+
bind(XtermLinkFactory).toFactory(createXtermLinkFactory);
|
|
116
|
+
|
|
117
|
+
// default terminal link provider
|
|
118
|
+
bind(UrlLinkProvider).toSelf().inSingletonScope();
|
|
119
|
+
bind(TerminalLinkProvider).toService(UrlLinkProvider);
|
|
120
|
+
bind(FileLinkProvider).toSelf().inSingletonScope();
|
|
121
|
+
bind(TerminalLinkProvider).toService(FileLinkProvider);
|
|
122
|
+
bind(FileDiffPreLinkProvider).toSelf().inSingletonScope();
|
|
123
|
+
bind(TerminalLinkProvider).toService(FileDiffPreLinkProvider);
|
|
124
|
+
bind(FileDiffPostLinkProvider).toSelf().inSingletonScope();
|
|
125
|
+
bind(TerminalLinkProvider).toService(FileDiffPostLinkProvider);
|
|
126
|
+
bind(LocalFileLinkProvider).toSelf().inSingletonScope();
|
|
127
|
+
bind(TerminalLinkProvider).toService(LocalFileLinkProvider);
|
|
128
|
+
|
|
129
|
+
bind(ContributedTerminalProfileStore).to(DefaultProfileStore).inSingletonScope();
|
|
130
|
+
bind(UserTerminalProfileStore).to(DefaultProfileStore).inSingletonScope();
|
|
131
|
+
bind(TerminalProfileService).toDynamicValue(ctx => {
|
|
132
|
+
const userStore = ctx.container.get<TerminalProfileStore>(UserTerminalProfileStore);
|
|
133
|
+
const contributedStore = ctx.container.get<TerminalProfileStore>(ContributedTerminalProfileStore);
|
|
134
|
+
return new DefaultTerminalProfileService(userStore, contributedStore);
|
|
135
|
+
}).inSingletonScope();
|
|
136
|
+
|
|
137
|
+
bind(FrontendApplicationContribution).toService(TerminalFrontendContribution);
|
|
138
|
+
});
|