@opensumi/ide-terminal-next 3.7.2-next-1740052080.0 → 3.7.2-next-1740054042.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/lib/browser/component/resize.delegate.d.ts +14 -0
- package/lib/browser/component/resize.delegate.d.ts.map +1 -0
- package/lib/browser/component/resize.delegate.js +46 -0
- package/lib/browser/component/resize.delegate.js.map +1 -0
- package/lib/browser/component/resize.module.less +77 -0
- package/lib/browser/component/resize.view.d.ts +16 -0
- package/lib/browser/component/resize.view.d.ts.map +1 -0
- package/lib/browser/component/resize.view.js +55 -0
- package/lib/browser/component/resize.view.js.map +1 -0
- package/lib/browser/component/search.module.less +61 -0
- package/lib/browser/component/search.view.d.ts +3 -0
- package/lib/browser/component/search.view.d.ts.map +1 -0
- package/lib/browser/component/search.view.js +89 -0
- package/lib/browser/component/search.view.js.map +1 -0
- package/lib/browser/component/tab.item.d.ts +7 -0
- package/lib/browser/component/tab.item.d.ts.map +1 -0
- package/lib/browser/component/tab.item.js +121 -0
- package/lib/browser/component/tab.item.js.map +1 -0
- package/lib/browser/component/tab.module.less +174 -0
- package/lib/browser/component/tab.view.d.ts +4 -0
- package/lib/browser/component/tab.view.d.ts.map +1 -0
- package/lib/browser/component/tab.view.js +65 -0
- package/lib/browser/component/tab.view.js.map +1 -0
- package/lib/browser/component/terminal.module.less +50 -0
- package/lib/browser/component/terminal.variable.d.ts +8 -0
- package/lib/browser/component/terminal.variable.d.ts.map +1 -0
- package/lib/browser/component/terminal.variable.js +44 -0
- package/lib/browser/component/terminal.variable.js.map +1 -0
- package/lib/browser/component/terminal.view.d.ts +5 -0
- package/lib/browser/component/terminal.view.d.ts.map +1 -0
- package/lib/browser/component/terminal.view.js +63 -0
- package/lib/browser/component/terminal.view.js.map +1 -0
- package/lib/browser/component/terminal.widget.d.ts +10 -0
- package/lib/browser/component/terminal.widget.d.ts.map +1 -0
- package/lib/browser/component/terminal.widget.js +65 -0
- package/lib/browser/component/terminal.widget.js.map +1 -0
- package/lib/browser/component/variable.module.less +15 -0
- package/lib/browser/contribution/index.d.ts.map +1 -0
- package/lib/browser/contribution/index.js +11 -0
- package/lib/browser/contribution/index.js.map +1 -0
- package/lib/browser/contribution/terminal.command.js +328 -0
- package/lib/browser/contribution/terminal.keybinding.js +87 -0
- package/lib/browser/contribution/terminal.lifecycle.js +52 -0
- package/lib/browser/contribution/terminal.menu.js +168 -0
- package/lib/browser/contribution/terminal.network.js +44 -0
- package/lib/browser/contribution/terminal.preference.js +43 -0
- package/lib/browser/contribution/terminal.view.js +57 -0
- package/lib/browser/index.js +124 -0
- package/lib/browser/links/base.d.ts +8 -0
- package/lib/browser/links/base.d.ts.map +1 -0
- package/lib/browser/links/base.js +13 -0
- package/lib/browser/links/base.js.map +1 -0
- package/lib/browser/links/external-link-provider-adapter.d.ts +21 -0
- package/lib/browser/links/external-link-provider-adapter.d.ts.map +1 -0
- package/lib/browser/links/external-link-provider-adapter.js +74 -0
- package/lib/browser/links/external-link-provider-adapter.js.map +1 -0
- package/lib/browser/links/helpers.d.ts +7 -0
- package/lib/browser/links/helpers.d.ts.map +1 -0
- package/lib/browser/links/helpers.js +128 -0
- package/lib/browser/links/helpers.js.map +1 -0
- package/lib/browser/links/link-manager.d.ts +92 -0
- package/lib/browser/links/link-manager.d.ts.map +1 -0
- package/lib/browser/links/link-manager.js +342 -0
- package/lib/browser/links/link-manager.js.map +1 -0
- package/lib/browser/links/link.d.ts +31 -0
- package/lib/browser/links/link.d.ts.map +1 -0
- package/lib/browser/links/link.js +136 -0
- package/lib/browser/links/link.js.map +1 -0
- package/lib/browser/links/protocol-link-provider.d.ts +14 -0
- package/lib/browser/links/protocol-link-provider.d.ts.map +1 -0
- package/lib/browser/links/protocol-link-provider.js +71 -0
- package/lib/browser/links/protocol-link-provider.js.map +1 -0
- package/lib/browser/links/validated-local-link-provider.d.ts +41 -0
- package/lib/browser/links/validated-local-link-provider.d.ts.map +1 -0
- package/lib/browser/links/validated-local-link-provider.js +235 -0
- package/lib/browser/links/validated-local-link-provider.js.map +1 -0
- package/lib/browser/links/word-link-provider.d.ts +29 -0
- package/lib/browser/links/word-link-provider.d.ts.map +1 -0
- package/lib/browser/links/word-link-provider.js +153 -0
- package/lib/browser/links/word-link-provider.js.map +1 -0
- package/lib/browser/terminal.addon.js +83 -0
- package/lib/browser/terminal.api.js +162 -0
- package/lib/browser/terminal.client.js +680 -0
- package/lib/browser/terminal.color.js +240 -0
- package/lib/browser/terminal.context-key.js +29 -0
- package/lib/browser/terminal.context-menu.js +96 -0
- package/lib/browser/terminal.controller.js +669 -0
- package/lib/browser/terminal.environment.service.js +153 -0
- package/lib/browser/terminal.error.js +61 -0
- package/lib/browser/terminal.ext.host.proxy.js +108 -0
- package/lib/browser/terminal.hover.manager.js +85 -0
- package/lib/browser/terminal.input.js +32 -0
- package/lib/browser/terminal.internal.service.js +107 -0
- package/lib/browser/terminal.network.js +150 -0
- package/lib/browser/terminal.preference.js +136 -0
- package/lib/browser/terminal.profile.internal.js +104 -0
- package/lib/browser/terminal.profile.js +211 -0
- package/lib/browser/terminal.render.js +25 -0
- package/lib/browser/terminal.restore.js +49 -0
- package/lib/browser/terminal.search.js +109 -0
- package/lib/browser/terminal.service.js +163 -0
- package/lib/common/api.d.ts +22 -0
- package/lib/common/api.d.ts.map +1 -0
- package/lib/common/api.js +5 -0
- package/lib/common/api.js.map +1 -0
- package/lib/common/client.d.ts +199 -0
- package/lib/common/client.d.ts.map +1 -0
- package/lib/common/client.js +6 -0
- package/lib/common/client.js.map +1 -0
- package/lib/common/controller.d.ts +149 -0
- package/lib/common/controller.d.ts.map +1 -0
- package/lib/common/controller.js +8 -0
- package/lib/common/controller.js.map +1 -0
- package/lib/common/environmentVariable.d.ts +116 -0
- package/lib/common/environmentVariable.d.ts.map +1 -0
- package/lib/common/environmentVariable.js +30 -0
- package/lib/common/environmentVariable.js.map +1 -0
- package/lib/common/environmentVariableCollection.d.ts +9 -0
- package/lib/common/environmentVariableCollection.d.ts.map +1 -0
- package/lib/common/environmentVariableCollection.js +140 -0
- package/lib/common/environmentVariableCollection.js.map +1 -0
- package/lib/common/error.d.ts +41 -0
- package/lib/common/error.d.ts.map +1 -0
- package/lib/common/error.js +13 -0
- package/lib/common/error.js.map +1 -0
- package/lib/common/extension.d.ts +139 -0
- package/lib/common/extension.d.ts.map +1 -0
- package/lib/common/extension.js +57 -0
- package/lib/common/extension.js.map +1 -0
- package/lib/common/index.d.ts +17 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +20 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/link-computer.d.ts +56 -0
- package/lib/common/link-computer.d.ts.map +1 -0
- package/lib/common/link-computer.js +282 -0
- package/lib/common/link-computer.js.map +1 -0
- package/lib/common/network.d.ts +48 -0
- package/lib/common/network.d.ts.map +1 -0
- package/lib/common/network.js +10 -0
- package/lib/common/network.js.map +1 -0
- package/lib/common/preference.d.ts +134 -0
- package/lib/common/preference.d.ts.map +1 -0
- package/lib/common/preference.js +199 -0
- package/lib/common/preference.js.map +1 -0
- package/lib/common/process.d.ts +8 -0
- package/lib/common/process.d.ts.map +1 -0
- package/lib/common/process.js +3 -0
- package/lib/common/process.js.map +1 -0
- package/lib/common/profile.d.ts +99 -0
- package/lib/common/profile.d.ts.map +1 -0
- package/lib/common/profile.js +27 -0
- package/lib/common/profile.js.map +1 -0
- package/lib/common/pty.d.ts +525 -0
- package/lib/common/pty.d.ts.map +1 -0
- package/lib/common/pty.js +28 -0
- package/lib/common/pty.js.map +1 -0
- package/lib/common/render.d.ts +29 -0
- package/lib/common/render.d.ts.map +1 -0
- package/lib/common/render.js +10 -0
- package/lib/common/render.js.map +1 -0
- package/lib/common/resize.d.ts +43 -0
- package/lib/common/resize.d.ts.map +1 -0
- package/lib/common/resize.js +3 -0
- package/lib/common/resize.js.map +1 -0
- package/lib/common/restore.d.ts +6 -0
- package/lib/common/restore.d.ts.map +1 -0
- package/lib/common/restore.js +5 -0
- package/lib/common/restore.js.map +1 -0
- package/lib/common/service.d.ts +96 -0
- package/lib/common/service.d.ts.map +1 -0
- package/lib/common/service.js +6 -0
- package/lib/common/service.js.map +1 -0
- package/lib/common/shell.d.ts +11 -0
- package/lib/common/shell.d.ts.map +1 -0
- package/lib/common/shell.js +14 -0
- package/lib/common/shell.js.map +1 -0
- package/lib/common/theme.d.ts +6 -0
- package/lib/common/theme.d.ts.map +1 -0
- package/lib/common/theme.js +5 -0
- package/lib/common/theme.js.map +1 -0
- package/lib/common/utils.d.ts +4 -0
- package/lib/common/utils.d.ts.map +1 -0
- package/lib/common/utils.js +15 -0
- package/lib/common/utils.js.map +1 -0
- package/lib/common/xterm.d.ts +27 -0
- package/lib/common/xterm.d.ts.map +1 -0
- package/lib/common/xterm.js +10 -0
- package/lib/common/xterm.js.map +1 -0
- package/lib/index.js +5 -0
- package/lib/node/data-store.d.ts +13 -0
- package/lib/node/data-store.d.ts.map +1 -0
- package/lib/node/data-store.js +6 -0
- package/lib/node/data-store.js.map +1 -0
- package/lib/node/index.d.ts +10 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +64 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/pty.d.ts +42 -0
- package/lib/node/pty.d.ts.map +1 -0
- package/lib/node/pty.js +277 -0
- package/lib/node/pty.js.map +1 -0
- package/lib/node/pty.manager.d.ts +52 -0
- package/lib/node/pty.manager.d.ts.map +1 -0
- package/lib/node/pty.manager.js +157 -0
- package/lib/node/pty.manager.js.map +1 -0
- package/lib/node/pty.manager.remote.d.ts +23 -0
- package/lib/node/pty.manager.remote.d.ts.map +1 -0
- package/lib/node/pty.manager.remote.js +124 -0
- package/lib/node/pty.manager.remote.js.map +1 -0
- package/lib/node/pty.proxy.d.ts +45 -0
- package/lib/node/pty.proxy.d.ts.map +1 -0
- package/lib/node/pty.proxy.js +277 -0
- package/lib/node/pty.proxy.js.map +1 -0
- package/lib/node/pty.proxy.remote.exec.d.ts +2 -0
- package/lib/node/pty.proxy.remote.exec.d.ts.map +1 -0
- package/lib/node/pty.proxy.remote.exec.js +7 -0
- package/lib/node/pty.proxy.remote.exec.js.map +1 -0
- package/lib/node/shell-integration.service.d.ts +24 -0
- package/lib/node/shell-integration.service.d.ts.map +1 -0
- package/lib/node/shell-integration.service.js +187 -0
- package/lib/node/shell-integration.service.js.map +1 -0
- package/lib/node/shell.d.ts +20 -0
- package/lib/node/shell.d.ts.map +1 -0
- package/lib/node/shell.js +199 -0
- package/lib/node/shell.js.map +1 -0
- package/lib/node/terminal.process.service.d.ts +5 -0
- package/lib/node/terminal.process.service.d.ts.map +1 -0
- package/lib/node/terminal.process.service.js +15 -0
- package/lib/node/terminal.process.service.js.map +1 -0
- package/lib/node/terminal.profile.service.d.ts +19 -0
- package/lib/node/terminal.profile.service.d.ts.map +1 -0
- package/lib/node/terminal.profile.service.js +228 -0
- package/lib/node/terminal.profile.service.js.map +1 -0
- package/lib/node/terminal.service.client.d.ts +51 -0
- package/lib/node/terminal.service.client.d.ts.map +1 -0
- package/lib/node/terminal.service.client.js +159 -0
- package/lib/node/terminal.service.client.js.map +1 -0
- package/lib/node/terminal.service.d.ts +30 -0
- package/lib/node/terminal.service.d.ts.map +1 -0
- package/lib/node/terminal.service.js +246 -0
- package/lib/node/terminal.service.js.map +1 -0
- package/package.json +18 -18
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalCommandContribution = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const di_1 = require("@opensumi/di");
|
|
6
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
7
|
+
const ide_main_layout_1 = require("@opensumi/ide-main-layout");
|
|
8
|
+
const common_1 = require("../../common");
|
|
9
|
+
const terminal_environment_service_1 = require("../terminal.environment.service");
|
|
10
|
+
const terminal_input_1 = require("../terminal.input");
|
|
11
|
+
const environmentVariable_1 = require("./../../common/environmentVariable");
|
|
12
|
+
let TerminalCommandContribution = class TerminalCommandContribution {
|
|
13
|
+
onReconnect() {
|
|
14
|
+
this.terminalController.reconnect();
|
|
15
|
+
}
|
|
16
|
+
onDisposeSideEffects() {
|
|
17
|
+
// TODO 销毁 Node.js 端的 Terminal Client
|
|
18
|
+
// 目前的情况下,想要终端重连后正常工作的话,会导致一些内存泄漏
|
|
19
|
+
}
|
|
20
|
+
setDefaultTerminalType(type) {
|
|
21
|
+
this.preference.update("terminal.type" /* TerminalSettingsId.Type */, type);
|
|
22
|
+
}
|
|
23
|
+
registerCommands(registry) {
|
|
24
|
+
// 搜索
|
|
25
|
+
registry.registerCommand({
|
|
26
|
+
...ide_core_browser_1.TERMINAL_COMMANDS.OPEN_SEARCH,
|
|
27
|
+
iconClass: (0, ide_core_browser_1.getIcon)('search'),
|
|
28
|
+
}, {
|
|
29
|
+
execute: () => {
|
|
30
|
+
if (this.search.isVisible) {
|
|
31
|
+
this.search.close();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.search.open();
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
// 拆分终端
|
|
38
|
+
registry.registerCommand({
|
|
39
|
+
...ide_core_browser_1.TERMINAL_COMMANDS.SPLIT,
|
|
40
|
+
iconClass: (0, ide_core_browser_1.getIcon)('embed'),
|
|
41
|
+
}, {
|
|
42
|
+
execute: () => {
|
|
43
|
+
const group = this.view.currentGroup.get();
|
|
44
|
+
if (!group) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const widget = this.view.createWidget(group);
|
|
48
|
+
this.view.selectWidget(widget.id);
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
// 删除所有终端
|
|
52
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.CLEAR, {
|
|
53
|
+
execute: () => {
|
|
54
|
+
this.view.clear();
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.ADD, {
|
|
58
|
+
execute: async () => {
|
|
59
|
+
await this.terminalController.createTerminalWithWidget({});
|
|
60
|
+
this.terminalController.showTerminalPanel();
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.TOGGLE_TERMINAL, {
|
|
64
|
+
execute: () => {
|
|
65
|
+
this.terminalController.toggleTerminalPanel();
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.SEARCH_NEXT, {
|
|
69
|
+
execute: () => {
|
|
70
|
+
if (this.search.isVisible) {
|
|
71
|
+
this.search.search();
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.search.open();
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
registry.registerCommand({
|
|
79
|
+
...ide_core_browser_1.TERMINAL_COMMANDS.REMOVE,
|
|
80
|
+
iconClass: (0, ide_core_browser_1.getIcon)('delete'),
|
|
81
|
+
}, {
|
|
82
|
+
execute: async () => {
|
|
83
|
+
const widgetId = this.view.currentWidgetId.get();
|
|
84
|
+
if (widgetId) {
|
|
85
|
+
this.view.removeWidget(widgetId);
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.OPEN_WITH_PATH, {
|
|
90
|
+
execute: async (uri) => {
|
|
91
|
+
if (uri) {
|
|
92
|
+
const client = await this.terminalApi.createTerminal({ cwd: uri.codeUri.fsPath });
|
|
93
|
+
client.show();
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
});
|
|
97
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.TAB_RENAME, {
|
|
98
|
+
execute: async (_, index) => {
|
|
99
|
+
const group = this.view.getGroup(index);
|
|
100
|
+
if (group) {
|
|
101
|
+
group.edit();
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
registry.registerCommand({
|
|
106
|
+
...ide_core_browser_1.TERMINAL_COMMANDS.SELECT_ALL_CONTENT,
|
|
107
|
+
}, {
|
|
108
|
+
execute: () => {
|
|
109
|
+
const widgetId = this.view.currentWidgetId.get();
|
|
110
|
+
const client = this.terminalController.findClientFromWidgetId(widgetId);
|
|
111
|
+
if (client) {
|
|
112
|
+
client.selectAll();
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
registry.registerCommand({
|
|
117
|
+
...ide_core_browser_1.TERMINAL_COMMANDS.CLEAR_CONTENT,
|
|
118
|
+
iconClass: (0, ide_core_browser_1.getIcon)('clear'),
|
|
119
|
+
}, {
|
|
120
|
+
execute: () => {
|
|
121
|
+
const current = this.view.currentWidgetId.get();
|
|
122
|
+
const client = this.terminalController.findClientFromWidgetId(current);
|
|
123
|
+
if (client) {
|
|
124
|
+
client.clear();
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
registry.registerCommand({
|
|
129
|
+
...ide_core_browser_1.TERMINAL_COMMANDS.CLEAR_ALL_CONTENT,
|
|
130
|
+
}, {
|
|
131
|
+
execute: () => {
|
|
132
|
+
this.terminalController.clearAllGroups();
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.SELECT_ZSH, {
|
|
136
|
+
execute: async () => {
|
|
137
|
+
this.setDefaultTerminalType('zsh');
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.SELECT_BASH, {
|
|
141
|
+
execute: async () => {
|
|
142
|
+
this.setDefaultTerminalType('bash');
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.SELECT_SH, {
|
|
146
|
+
execute: async () => {
|
|
147
|
+
this.setDefaultTerminalType('sh');
|
|
148
|
+
},
|
|
149
|
+
});
|
|
150
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.SELECT_POWERSHELL, {
|
|
151
|
+
execute: async () => {
|
|
152
|
+
this.setDefaultTerminalType('powershell');
|
|
153
|
+
},
|
|
154
|
+
});
|
|
155
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.SELECT_CMD, {
|
|
156
|
+
execute: async () => {
|
|
157
|
+
this.setDefaultTerminalType('cmd');
|
|
158
|
+
},
|
|
159
|
+
});
|
|
160
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.MORE_SETTINGS, {
|
|
161
|
+
execute: async () => {
|
|
162
|
+
this.commands.executeCommand(ide_core_browser_1.COMMON_COMMANDS.OPEN_PREFERENCES.id, 'terminal');
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.COPY, {
|
|
166
|
+
execute: async () => {
|
|
167
|
+
const current = this.view.currentWidgetId.get();
|
|
168
|
+
const client = this.terminalController.findClientFromWidgetId(current);
|
|
169
|
+
if (client) {
|
|
170
|
+
await this.clipboardService.writeText(client.getSelection());
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
});
|
|
174
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.PASTE, {
|
|
175
|
+
execute: async () => {
|
|
176
|
+
const current = this.view.currentWidgetId.get();
|
|
177
|
+
const client = this.terminalController.findClientFromWidgetId(current);
|
|
178
|
+
if (client) {
|
|
179
|
+
client.paste(await this.clipboardService.readText());
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
});
|
|
183
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.SELECT_ALL, {
|
|
184
|
+
execute: () => {
|
|
185
|
+
const current = this.view.currentWidgetId.get();
|
|
186
|
+
const client = this.terminalController.findClientFromWidgetId(current);
|
|
187
|
+
if (client) {
|
|
188
|
+
client.selectAll();
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.RE_LAUNCH, {
|
|
193
|
+
execute: () => {
|
|
194
|
+
const groups = this.view.groups.get();
|
|
195
|
+
for (const group of groups) {
|
|
196
|
+
const widgets = group.widgets.get();
|
|
197
|
+
widgets.forEach((widget) => {
|
|
198
|
+
const client = this.terminalController.findClientFromWidgetId(widget.id);
|
|
199
|
+
if (client) {
|
|
200
|
+
client.reset();
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
registry.registerCommand(ide_core_browser_1.COMMON_COMMANDS.ENVIRONMENT_VARIABLE, {
|
|
207
|
+
execute: async () => {
|
|
208
|
+
const env = await this.terminalEnvironmentService.getProcessEnv();
|
|
209
|
+
return env;
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.FOCUS_NEXT_TERMINAL, {
|
|
213
|
+
execute: () => {
|
|
214
|
+
const group = this.view.currentGroup.get();
|
|
215
|
+
if (group && group.widgets.get().length <= 1) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
const client = this.getNextOrPrevTerminalClient('next');
|
|
219
|
+
client === null || client === void 0 ? void 0 : client.focus();
|
|
220
|
+
},
|
|
221
|
+
});
|
|
222
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.FOCUS_PREVIOUS_TERMINAL, {
|
|
223
|
+
execute: () => {
|
|
224
|
+
const group = this.view.currentGroup.get();
|
|
225
|
+
if (group && group.widgets.get().length <= 1) {
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const client = this.getNextOrPrevTerminalClient('prev');
|
|
229
|
+
client === null || client === void 0 ? void 0 : client.focus();
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
registry.registerCommand(ide_core_browser_1.TERMINAL_COMMANDS.KILL_PROCESS, {
|
|
233
|
+
execute: async () => {
|
|
234
|
+
const current = this.view.currentWidgetId.get();
|
|
235
|
+
const client = this.terminalController.findClientFromWidgetId(current);
|
|
236
|
+
if (client) {
|
|
237
|
+
const select = client.getSelection();
|
|
238
|
+
if (select && select.length > 0) {
|
|
239
|
+
// 有选择内容则复制到剪贴板
|
|
240
|
+
await this.clipboardService.writeText(client.getSelection());
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
// 没有选择内容则执行结束进程命令
|
|
244
|
+
await this.terminalApi.sendText(current, '\x03');
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
getNextOrPrevTerminalClient(kind) {
|
|
251
|
+
const group = this.view.currentGroup.get();
|
|
252
|
+
if (!group) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
const widgets = group.widgets.get();
|
|
256
|
+
const currentIdx = widgets.findIndex((w) => w.id === this.view.currentWidgetId.get());
|
|
257
|
+
let index;
|
|
258
|
+
if (kind === 'next') {
|
|
259
|
+
index = currentIdx === widgets.length - 1 ? 0 : currentIdx + 1;
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
index = currentIdx === 0 ? widgets.length - 1 : currentIdx - 1;
|
|
263
|
+
}
|
|
264
|
+
const widget = widgets[index];
|
|
265
|
+
return this.terminalController.findClientFromWidgetId(widget.id);
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
exports.TerminalCommandContribution = TerminalCommandContribution;
|
|
269
|
+
tslib_1.__decorate([
|
|
270
|
+
(0, di_1.Autowired)(common_1.ITerminalController),
|
|
271
|
+
tslib_1.__metadata("design:type", Object)
|
|
272
|
+
], TerminalCommandContribution.prototype, "terminalController", void 0);
|
|
273
|
+
tslib_1.__decorate([
|
|
274
|
+
(0, di_1.Autowired)(environmentVariable_1.EnvironmentVariableServiceToken),
|
|
275
|
+
tslib_1.__metadata("design:type", terminal_environment_service_1.TerminalEnvironmentService)
|
|
276
|
+
], TerminalCommandContribution.prototype, "terminalEnvironmentService", void 0);
|
|
277
|
+
tslib_1.__decorate([
|
|
278
|
+
(0, di_1.Autowired)(common_1.ITerminalGroupViewService),
|
|
279
|
+
tslib_1.__metadata("design:type", Object)
|
|
280
|
+
], TerminalCommandContribution.prototype, "view", void 0);
|
|
281
|
+
tslib_1.__decorate([
|
|
282
|
+
(0, di_1.Autowired)(common_1.ITerminalSearchService),
|
|
283
|
+
tslib_1.__metadata("design:type", Object)
|
|
284
|
+
], TerminalCommandContribution.prototype, "search", void 0);
|
|
285
|
+
tslib_1.__decorate([
|
|
286
|
+
(0, di_1.Autowired)(common_1.ITerminalRestore),
|
|
287
|
+
tslib_1.__metadata("design:type", Object)
|
|
288
|
+
], TerminalCommandContribution.prototype, "store", void 0);
|
|
289
|
+
tslib_1.__decorate([
|
|
290
|
+
(0, di_1.Autowired)(common_1.ITerminalApiService),
|
|
291
|
+
tslib_1.__metadata("design:type", Object)
|
|
292
|
+
], TerminalCommandContribution.prototype, "terminalApi", void 0);
|
|
293
|
+
tslib_1.__decorate([
|
|
294
|
+
(0, di_1.Autowired)(ide_core_browser_1.PreferenceService),
|
|
295
|
+
tslib_1.__metadata("design:type", Object)
|
|
296
|
+
], TerminalCommandContribution.prototype, "preference", void 0);
|
|
297
|
+
tslib_1.__decorate([
|
|
298
|
+
(0, di_1.Autowired)(ide_core_browser_1.IPreferenceSettingsService),
|
|
299
|
+
tslib_1.__metadata("design:type", Object)
|
|
300
|
+
], TerminalCommandContribution.prototype, "settingService", void 0);
|
|
301
|
+
tslib_1.__decorate([
|
|
302
|
+
(0, di_1.Autowired)(ide_core_browser_1.CommandService),
|
|
303
|
+
tslib_1.__metadata("design:type", Object)
|
|
304
|
+
], TerminalCommandContribution.prototype, "commands", void 0);
|
|
305
|
+
tslib_1.__decorate([
|
|
306
|
+
(0, di_1.Autowired)(ide_main_layout_1.IMainLayoutService),
|
|
307
|
+
tslib_1.__metadata("design:type", Object)
|
|
308
|
+
], TerminalCommandContribution.prototype, "mainlayoutService", void 0);
|
|
309
|
+
tslib_1.__decorate([
|
|
310
|
+
(0, di_1.Autowired)(ide_core_browser_1.AppConfig),
|
|
311
|
+
tslib_1.__metadata("design:type", Object)
|
|
312
|
+
], TerminalCommandContribution.prototype, "config", void 0);
|
|
313
|
+
tslib_1.__decorate([
|
|
314
|
+
(0, di_1.Autowired)(),
|
|
315
|
+
tslib_1.__metadata("design:type", terminal_input_1.TerminalKeyBoardInputService)
|
|
316
|
+
], TerminalCommandContribution.prototype, "terminalInput", void 0);
|
|
317
|
+
tslib_1.__decorate([
|
|
318
|
+
(0, di_1.Autowired)(ide_core_browser_1.ILogger),
|
|
319
|
+
tslib_1.__metadata("design:type", Object)
|
|
320
|
+
], TerminalCommandContribution.prototype, "logger", void 0);
|
|
321
|
+
tslib_1.__decorate([
|
|
322
|
+
(0, di_1.Autowired)(ide_core_browser_1.IClipboardService),
|
|
323
|
+
tslib_1.__metadata("design:type", Object)
|
|
324
|
+
], TerminalCommandContribution.prototype, "clipboardService", void 0);
|
|
325
|
+
exports.TerminalCommandContribution = TerminalCommandContribution = tslib_1.__decorate([
|
|
326
|
+
(0, ide_core_browser_1.Domain)(ide_core_browser_1.CommandContribution, ide_core_browser_1.ClientAppContribution)
|
|
327
|
+
], TerminalCommandContribution);
|
|
328
|
+
//# sourceMappingURL=terminal.command.js.map
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalKeybindingContribution = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
6
|
+
const contextkey_1 = require("@opensumi/ide-core-browser/lib/contextkey");
|
|
7
|
+
const raw_context_key_1 = require("@opensumi/ide-core-browser/lib/raw-context-key");
|
|
8
|
+
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
9
|
+
let TerminalKeybindingContribution = class TerminalKeybindingContribution {
|
|
10
|
+
registerKeybindings(registry) {
|
|
11
|
+
registry.registerKeybinding({
|
|
12
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.OPEN_SEARCH.id,
|
|
13
|
+
keybinding: 'ctrlcmd+f',
|
|
14
|
+
when: contextkey_1.IsTerminalFocused.raw,
|
|
15
|
+
});
|
|
16
|
+
registry.registerKeybinding({
|
|
17
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.CLEAR_CONTENT.id,
|
|
18
|
+
keybinding: 'ctrlcmd+k',
|
|
19
|
+
when: contextkey_1.IsTerminalFocused.raw,
|
|
20
|
+
});
|
|
21
|
+
registry.registerKeybinding({
|
|
22
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.SEARCH_NEXT.id,
|
|
23
|
+
keybinding: 'ctrlcmd+g',
|
|
24
|
+
when: contextkey_1.IsTerminalFocused.raw,
|
|
25
|
+
});
|
|
26
|
+
registry.registerKeybinding({
|
|
27
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.COPY.id,
|
|
28
|
+
keybinding: ide_core_common_1.isWindows ? 'ctrlcmd+shift+c' : 'ctrlcmd+c',
|
|
29
|
+
// http 协议无法访问 navigator.clipboard,使用 xterm 原生快捷键
|
|
30
|
+
when: raw_context_key_1.RawContextKey.and(contextkey_1.IsTerminalFocused.raw, 'locationProtocol != http'),
|
|
31
|
+
});
|
|
32
|
+
registry.registerKeybinding({
|
|
33
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.KILL_PROCESS.id,
|
|
34
|
+
keybinding: 'ctrlcmd+c',
|
|
35
|
+
when: raw_context_key_1.RawContextKey.and(contextkey_1.IsTerminalFocused.raw, 'locationProtocol != http', 'isWindows'),
|
|
36
|
+
});
|
|
37
|
+
registry.registerKeybinding({
|
|
38
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.PASTE.id,
|
|
39
|
+
keybinding: ide_core_common_1.isWindows ? 'ctrlcmd+shift+v' : 'ctrlcmd+v',
|
|
40
|
+
// http 协议无法访问 navigator.clipboard,使用 xterm 原生快捷键
|
|
41
|
+
when: raw_context_key_1.RawContextKey.and(contextkey_1.IsTerminalFocused.raw, 'locationProtocol != http'),
|
|
42
|
+
});
|
|
43
|
+
registry.registerKeybinding({
|
|
44
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.SELECT_ALL.id,
|
|
45
|
+
keybinding: 'ctrlcmd+a',
|
|
46
|
+
when: contextkey_1.IsTerminalFocused.raw,
|
|
47
|
+
});
|
|
48
|
+
registry.registerKeybinding({
|
|
49
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.SPLIT.id,
|
|
50
|
+
keybinding: 'ctrlcmd+\\',
|
|
51
|
+
when: contextkey_1.IsTerminalFocused.raw,
|
|
52
|
+
});
|
|
53
|
+
registry.registerKeybinding({
|
|
54
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.ADD.id,
|
|
55
|
+
keybinding: 'ctrl+shift+`',
|
|
56
|
+
});
|
|
57
|
+
registry.registerKeybinding({
|
|
58
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.FOCUS_NEXT_TERMINAL.id,
|
|
59
|
+
keybinding: 'ctrlcmd+alt+right',
|
|
60
|
+
when: contextkey_1.IsTerminalFocused.raw,
|
|
61
|
+
});
|
|
62
|
+
registry.registerKeybinding({
|
|
63
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.FOCUS_NEXT_TERMINAL.id,
|
|
64
|
+
keybinding: 'ctrlcmd+alt+down',
|
|
65
|
+
when: contextkey_1.IsTerminalFocused.raw,
|
|
66
|
+
});
|
|
67
|
+
registry.registerKeybinding({
|
|
68
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.FOCUS_PREVIOUS_TERMINAL.id,
|
|
69
|
+
keybinding: 'ctrlcmd+alt+left',
|
|
70
|
+
when: contextkey_1.IsTerminalFocused.raw,
|
|
71
|
+
});
|
|
72
|
+
registry.registerKeybinding({
|
|
73
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.FOCUS_PREVIOUS_TERMINAL.id,
|
|
74
|
+
keybinding: 'ctrlcmd+alt+up',
|
|
75
|
+
when: contextkey_1.IsTerminalFocused.raw,
|
|
76
|
+
});
|
|
77
|
+
registry.registerKeybinding({
|
|
78
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.TOGGLE_TERMINAL.id,
|
|
79
|
+
keybinding: 'ctrl+`',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.TerminalKeybindingContribution = TerminalKeybindingContribution;
|
|
84
|
+
exports.TerminalKeybindingContribution = TerminalKeybindingContribution = tslib_1.__decorate([
|
|
85
|
+
(0, ide_core_common_1.Domain)(ide_core_browser_1.KeybindingContribution)
|
|
86
|
+
], TerminalKeybindingContribution);
|
|
87
|
+
//# sourceMappingURL=terminal.keybinding.js.map
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalLifeCycleContribution = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const di_1 = require("@opensumi/di");
|
|
6
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
7
|
+
const ide_main_layout_1 = require("@opensumi/ide-main-layout");
|
|
8
|
+
const common_1 = require("../../common");
|
|
9
|
+
const environmentVariable_1 = require("../../common/environmentVariable");
|
|
10
|
+
const terminal_color_1 = require("../terminal.color");
|
|
11
|
+
const terminal_input_1 = require("../terminal.input");
|
|
12
|
+
let TerminalLifeCycleContribution = class TerminalLifeCycleContribution {
|
|
13
|
+
initialize() {
|
|
14
|
+
(0, terminal_color_1.registerTerminalColors)();
|
|
15
|
+
}
|
|
16
|
+
onStart() {
|
|
17
|
+
this.terminalInput.listen();
|
|
18
|
+
this.environmentService.initEnvironmentVariableCollections();
|
|
19
|
+
}
|
|
20
|
+
// 必须等待这个事件返回,否则 tabHandler 无法保证获取
|
|
21
|
+
onDidRender() {
|
|
22
|
+
this.store.restore().then(() => {
|
|
23
|
+
this.terminalController.firstInitialize();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
onStop() {
|
|
27
|
+
// dispose all task executor
|
|
28
|
+
this.terminalController.disposeTerminalClients({ isTaskExecutor: true });
|
|
29
|
+
this.store.save();
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.TerminalLifeCycleContribution = TerminalLifeCycleContribution;
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, di_1.Autowired)(),
|
|
35
|
+
tslib_1.__metadata("design:type", terminal_input_1.TerminalKeyBoardInputService)
|
|
36
|
+
], TerminalLifeCycleContribution.prototype, "terminalInput", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, di_1.Autowired)(common_1.ITerminalController),
|
|
39
|
+
tslib_1.__metadata("design:type", Object)
|
|
40
|
+
], TerminalLifeCycleContribution.prototype, "terminalController", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, di_1.Autowired)(common_1.ITerminalRestore),
|
|
43
|
+
tslib_1.__metadata("design:type", Object)
|
|
44
|
+
], TerminalLifeCycleContribution.prototype, "store", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, di_1.Autowired)(environmentVariable_1.EnvironmentVariableServiceToken),
|
|
47
|
+
tslib_1.__metadata("design:type", Object)
|
|
48
|
+
], TerminalLifeCycleContribution.prototype, "environmentService", void 0);
|
|
49
|
+
exports.TerminalLifeCycleContribution = TerminalLifeCycleContribution = tslib_1.__decorate([
|
|
50
|
+
(0, ide_core_browser_1.Domain)(ide_core_browser_1.ClientAppContribution, ide_main_layout_1.MainLayoutContribution)
|
|
51
|
+
], TerminalLifeCycleContribution);
|
|
52
|
+
//# sourceMappingURL=terminal.lifecycle.js.map
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalMenuContribution = exports.more2 = exports.more1Sub = exports.more1 = exports.group = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const di_1 = require("@opensumi/di");
|
|
6
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
7
|
+
const container_id_1 = require("@opensumi/ide-core-browser/lib/common/container-id");
|
|
8
|
+
const next_1 = require("@opensumi/ide-core-browser/lib/menu/next");
|
|
9
|
+
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
10
|
+
const common_1 = require("../../common");
|
|
11
|
+
exports.group = 'panel_menu';
|
|
12
|
+
exports.more1 = 'more_1';
|
|
13
|
+
exports.more1Sub = 'more_1_sub';
|
|
14
|
+
exports.more2 = 'more_2';
|
|
15
|
+
let TerminalMenuContribution = class TerminalMenuContribution {
|
|
16
|
+
registerMenus(menuRegistry) {
|
|
17
|
+
/** 终端 Tab 菜单 */
|
|
18
|
+
menuRegistry.registerMenuItem(next_1.MenuId.TerminalTabContext, {
|
|
19
|
+
command: {
|
|
20
|
+
id: ide_core_browser_1.TERMINAL_COMMANDS.TAB_RENAME.id,
|
|
21
|
+
label: (0, ide_core_browser_1.localize)('terminal.menu.rename'),
|
|
22
|
+
},
|
|
23
|
+
order: 1,
|
|
24
|
+
group: exports.group,
|
|
25
|
+
});
|
|
26
|
+
menuRegistry.registerMenuItem(next_1.MenuId.TerminalTabContext, {
|
|
27
|
+
command: {
|
|
28
|
+
id: ide_core_browser_1.TERMINAL_COMMANDS.SPLIT.id,
|
|
29
|
+
label: (0, ide_core_browser_1.localize)('terminal.menu.split'),
|
|
30
|
+
},
|
|
31
|
+
order: 2,
|
|
32
|
+
group: exports.group,
|
|
33
|
+
});
|
|
34
|
+
menuRegistry.registerMenuItem(next_1.MenuId.TerminalTabContext, {
|
|
35
|
+
command: {
|
|
36
|
+
id: ide_core_browser_1.TERMINAL_COMMANDS.REMOVE.id,
|
|
37
|
+
label: (0, ide_core_browser_1.localize)('terminal.menu.stopGroup'),
|
|
38
|
+
},
|
|
39
|
+
order: 3,
|
|
40
|
+
group: exports.group,
|
|
41
|
+
});
|
|
42
|
+
/** end */
|
|
43
|
+
/** 终端面板右键菜单 */
|
|
44
|
+
menuRegistry.registerMenuItem(next_1.MenuId.TerminalInstanceContext, {
|
|
45
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.COPY,
|
|
46
|
+
group: '1_modify',
|
|
47
|
+
});
|
|
48
|
+
menuRegistry.registerMenuItem(next_1.MenuId.TerminalInstanceContext, {
|
|
49
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.PASTE,
|
|
50
|
+
group: '1_modify',
|
|
51
|
+
});
|
|
52
|
+
menuRegistry.registerMenuItem(next_1.MenuId.TerminalInstanceContext, {
|
|
53
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.SELECT_ALL,
|
|
54
|
+
group: '1_modify',
|
|
55
|
+
});
|
|
56
|
+
menuRegistry.registerMenuItem(next_1.MenuId.TerminalInstanceContext, {
|
|
57
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.CLEAR_CONTENT,
|
|
58
|
+
group: '1_modify',
|
|
59
|
+
});
|
|
60
|
+
const location = (0, ide_core_browser_1.getSlotLocation)('@opensumi/ide-terminal-next', this.config.layoutConfig);
|
|
61
|
+
const tabbarCtxKey = (0, ide_core_browser_1.getTabbarCtxKey)(location);
|
|
62
|
+
const commonMenuId = (0, next_1.getTabbarCommonMenuId)(location);
|
|
63
|
+
const when = `${tabbarCtxKey} == ${container_id_1.TERMINAL_CONTAINER_ID}`;
|
|
64
|
+
/** 更多菜单 */
|
|
65
|
+
menuRegistry.registerMenuItem(commonMenuId, {
|
|
66
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.CLEAR,
|
|
67
|
+
order: 1,
|
|
68
|
+
group: exports.more1,
|
|
69
|
+
when,
|
|
70
|
+
});
|
|
71
|
+
menuRegistry.registerMenuItem(commonMenuId, {
|
|
72
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.CLEAR_ALL_CONTENT,
|
|
73
|
+
order: 1,
|
|
74
|
+
group: exports.more1,
|
|
75
|
+
when,
|
|
76
|
+
});
|
|
77
|
+
menuRegistry.registerMenuItem(commonMenuId, {
|
|
78
|
+
label: (0, ide_core_browser_1.localize)('terminal.menu.selectType'),
|
|
79
|
+
submenu: next_1.MenuId.TerminalDefaultTypeMenu,
|
|
80
|
+
order: 1,
|
|
81
|
+
group: exports.more2,
|
|
82
|
+
when,
|
|
83
|
+
});
|
|
84
|
+
if (ide_core_common_1.isWindows) {
|
|
85
|
+
menuRegistry.registerMenuItems(next_1.MenuId.TerminalDefaultTypeMenu, [
|
|
86
|
+
{
|
|
87
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.SELECT_CMD,
|
|
88
|
+
order: 1,
|
|
89
|
+
group: exports.more1Sub,
|
|
90
|
+
toggledWhen: 'config.terminal.type == cmd',
|
|
91
|
+
when,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.SELECT_POWERSHELL,
|
|
95
|
+
order: 2,
|
|
96
|
+
group: exports.more1Sub,
|
|
97
|
+
toggledWhen: 'config.terminal.type == powershell',
|
|
98
|
+
when,
|
|
99
|
+
},
|
|
100
|
+
]);
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
menuRegistry.registerMenuItems(next_1.MenuId.TerminalDefaultTypeMenu, [
|
|
104
|
+
{
|
|
105
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.SELECT_ZSH,
|
|
106
|
+
order: 1,
|
|
107
|
+
group: exports.more1Sub,
|
|
108
|
+
toggledWhen: 'config.terminal.type == zsh',
|
|
109
|
+
when,
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.SELECT_BASH,
|
|
113
|
+
order: 2,
|
|
114
|
+
group: exports.more1Sub,
|
|
115
|
+
toggledWhen: 'config.terminal.type == bash',
|
|
116
|
+
when,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.SELECT_SH,
|
|
120
|
+
order: 3,
|
|
121
|
+
group: exports.more1Sub,
|
|
122
|
+
toggledWhen: 'config.terminal.type == sh',
|
|
123
|
+
when,
|
|
124
|
+
},
|
|
125
|
+
]);
|
|
126
|
+
}
|
|
127
|
+
menuRegistry.registerMenuItem(commonMenuId, {
|
|
128
|
+
command: ide_core_browser_1.TERMINAL_COMMANDS.MORE_SETTINGS,
|
|
129
|
+
order: 1,
|
|
130
|
+
group: exports.more2,
|
|
131
|
+
when,
|
|
132
|
+
});
|
|
133
|
+
/** end */
|
|
134
|
+
}
|
|
135
|
+
};
|
|
136
|
+
exports.TerminalMenuContribution = TerminalMenuContribution;
|
|
137
|
+
tslib_1.__decorate([
|
|
138
|
+
(0, di_1.Autowired)(common_1.ITerminalController),
|
|
139
|
+
tslib_1.__metadata("design:type", Object)
|
|
140
|
+
], TerminalMenuContribution.prototype, "terminalController", void 0);
|
|
141
|
+
tslib_1.__decorate([
|
|
142
|
+
(0, di_1.Autowired)(common_1.ITerminalGroupViewService),
|
|
143
|
+
tslib_1.__metadata("design:type", Object)
|
|
144
|
+
], TerminalMenuContribution.prototype, "view", void 0);
|
|
145
|
+
tslib_1.__decorate([
|
|
146
|
+
(0, di_1.Autowired)(common_1.ITerminalSearchService),
|
|
147
|
+
tslib_1.__metadata("design:type", Object)
|
|
148
|
+
], TerminalMenuContribution.prototype, "search", void 0);
|
|
149
|
+
tslib_1.__decorate([
|
|
150
|
+
(0, di_1.Autowired)(ide_core_browser_1.IPreferenceSettingsService),
|
|
151
|
+
tslib_1.__metadata("design:type", Object)
|
|
152
|
+
], TerminalMenuContribution.prototype, "settingService", void 0);
|
|
153
|
+
tslib_1.__decorate([
|
|
154
|
+
(0, di_1.Autowired)(ide_core_common_1.CommandService),
|
|
155
|
+
tslib_1.__metadata("design:type", Object)
|
|
156
|
+
], TerminalMenuContribution.prototype, "commands", void 0);
|
|
157
|
+
tslib_1.__decorate([
|
|
158
|
+
(0, di_1.Autowired)(ide_core_browser_1.AppConfig),
|
|
159
|
+
tslib_1.__metadata("design:type", Object)
|
|
160
|
+
], TerminalMenuContribution.prototype, "config", void 0);
|
|
161
|
+
tslib_1.__decorate([
|
|
162
|
+
(0, di_1.Autowired)(ide_core_browser_1.PreferenceService),
|
|
163
|
+
tslib_1.__metadata("design:type", Object)
|
|
164
|
+
], TerminalMenuContribution.prototype, "preference", void 0);
|
|
165
|
+
exports.TerminalMenuContribution = TerminalMenuContribution = tslib_1.__decorate([
|
|
166
|
+
(0, ide_core_common_1.Domain)(next_1.MenuContribution)
|
|
167
|
+
], TerminalMenuContribution);
|
|
168
|
+
//# sourceMappingURL=terminal.menu.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TerminalNetworkContribution = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const di_1 = require("@opensumi/di");
|
|
6
|
+
const ide_core_browser_1 = require("@opensumi/ide-core-browser");
|
|
7
|
+
const ide_core_common_1 = require("@opensumi/ide-core-common");
|
|
8
|
+
const common_1 = require("../../common");
|
|
9
|
+
let TerminalNetworkContribution = class TerminalNetworkContribution extends ide_core_common_1.WithEventBus {
|
|
10
|
+
onStart() {
|
|
11
|
+
this.network.bindErrors();
|
|
12
|
+
}
|
|
13
|
+
handleBrowserConnectionOpen(_e) {
|
|
14
|
+
this.network.setStatus(common_1.TerminalNetworkStatus.CONNECTED);
|
|
15
|
+
}
|
|
16
|
+
handleBrowserConnectionClose(_e) {
|
|
17
|
+
this.network.setStatus(common_1.TerminalNetworkStatus.DISCONNECTED);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
exports.TerminalNetworkContribution = TerminalNetworkContribution;
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, di_1.Autowired)(common_1.ITerminalNetwork),
|
|
23
|
+
tslib_1.__metadata("design:type", Object)
|
|
24
|
+
], TerminalNetworkContribution.prototype, "network", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, di_1.Autowired)(common_1.ITerminalInternalService),
|
|
27
|
+
tslib_1.__metadata("design:type", Object)
|
|
28
|
+
], TerminalNetworkContribution.prototype, "service", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, ide_core_common_1.OnEvent)(ide_core_common_1.BrowserConnectionOpenEvent),
|
|
31
|
+
tslib_1.__metadata("design:type", Function),
|
|
32
|
+
tslib_1.__metadata("design:paramtypes", [ide_core_common_1.BrowserConnectionOpenEvent]),
|
|
33
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
34
|
+
], TerminalNetworkContribution.prototype, "handleBrowserConnectionOpen", null);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, ide_core_common_1.OnEvent)(ide_core_common_1.BrowserConnectionCloseEvent),
|
|
37
|
+
tslib_1.__metadata("design:type", Function),
|
|
38
|
+
tslib_1.__metadata("design:paramtypes", [ide_core_common_1.BrowserConnectionCloseEvent]),
|
|
39
|
+
tslib_1.__metadata("design:returntype", void 0)
|
|
40
|
+
], TerminalNetworkContribution.prototype, "handleBrowserConnectionClose", null);
|
|
41
|
+
exports.TerminalNetworkContribution = TerminalNetworkContribution = tslib_1.__decorate([
|
|
42
|
+
(0, ide_core_browser_1.Domain)(ide_core_browser_1.ClientAppContribution)
|
|
43
|
+
], TerminalNetworkContribution);
|
|
44
|
+
//# sourceMappingURL=terminal.network.js.map
|