@codingame/monaco-vscode-xterm-common 24.1.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/empty.js +1 -0
- package/package.json +45 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.d.ts +11 -0
- package/vscode/src/vs/platform/terminal/common/capabilities/naiveCwdDetectionCapability.js +26 -0
- package/vscode/src/vs/platform/terminal/common/environmentVariable.d.ts +86 -0
- package/vscode/src/vs/platform/terminal/common/environmentVariable.js +10 -0
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.d.ts +17 -0
- package/vscode/src/vs/platform/terminal/common/environmentVariableCollection.js +214 -0
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.d.ts +14 -0
- package/vscode/src/vs/platform/terminal/common/terminalRecorder.js +75 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/environmentVariableInfo.js +125 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.d.ts +104 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalActions.js +1554 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalContextMenu.js +45 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalIconPicker.js +82 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.d.ts +408 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalInstance.js +2338 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.d.ts +143 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalProcessManager.js +684 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalResizeDebouncer.js +68 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalStatusList.js +135 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.d.ts +40 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTabsList.js +754 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/terminalTooltip.js +112 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/lineDataEventAddon.js +59 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalEnvironment.js +319 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStorageKeys.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminal/common/terminalStorageKeys.js +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +69 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css +49 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry.js +25 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.d.ts +35 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollContribution.js +117 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.d.ts +56 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollOverlay.js +428 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
+
import { MenuId } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
4
|
+
import { RawContextKey } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
5
|
+
|
|
6
|
+
var TerminalChatCommandId;
|
|
7
|
+
(function (TerminalChatCommandId) {
|
|
8
|
+
TerminalChatCommandId["Start"] = "workbench.action.terminal.chat.start";
|
|
9
|
+
TerminalChatCommandId["Close"] = "workbench.action.terminal.chat.close";
|
|
10
|
+
TerminalChatCommandId["MakeRequest"] = "workbench.action.terminal.chat.makeRequest";
|
|
11
|
+
TerminalChatCommandId["Cancel"] = "workbench.action.terminal.chat.cancel";
|
|
12
|
+
TerminalChatCommandId["RunCommand"] = "workbench.action.terminal.chat.runCommand";
|
|
13
|
+
TerminalChatCommandId["RunFirstCommand"] = "workbench.action.terminal.chat.runFirstCommand";
|
|
14
|
+
TerminalChatCommandId["InsertCommand"] = "workbench.action.terminal.chat.insertCommand";
|
|
15
|
+
TerminalChatCommandId["InsertFirstCommand"] = "workbench.action.terminal.chat.insertFirstCommand";
|
|
16
|
+
TerminalChatCommandId["ViewInChat"] = "workbench.action.terminal.chat.viewInChat";
|
|
17
|
+
TerminalChatCommandId["RerunRequest"] = "workbench.action.terminal.chat.rerunRequest";
|
|
18
|
+
TerminalChatCommandId["ViewHiddenChatTerminals"] = "workbench.action.terminal.chat.viewHiddenChatTerminals";
|
|
19
|
+
TerminalChatCommandId["OpenTerminalSettingsLink"] = "workbench.action.terminal.chat.openTerminalSettingsLink";
|
|
20
|
+
TerminalChatCommandId["DisableSessionAutoApproval"] = "workbench.action.terminal.chat.disableSessionAutoApproval";
|
|
21
|
+
TerminalChatCommandId["FocusMostRecentChatTerminalOutput"] = "workbench.action.terminal.chat.focusMostRecentChatTerminalOutput";
|
|
22
|
+
TerminalChatCommandId["FocusMostRecentChatTerminal"] = "workbench.action.terminal.chat.focusMostRecentChatTerminal";
|
|
23
|
+
TerminalChatCommandId["ToggleChatTerminalOutput"] = "workbench.action.terminal.chat.toggleChatTerminalOutput";
|
|
24
|
+
TerminalChatCommandId["FocusChatInstanceAction"] = "workbench.action.terminal.chat.focusChatInstance";
|
|
25
|
+
})(TerminalChatCommandId || (TerminalChatCommandId = {}));
|
|
26
|
+
const MENU_TERMINAL_CHAT_WIDGET_INPUT_SIDE_TOOLBAR = MenuId.for('terminalChatWidget');
|
|
27
|
+
const MENU_TERMINAL_CHAT_WIDGET_STATUS = MenuId.for('terminalChatWidget.status');
|
|
28
|
+
MenuId.for('terminalChatWidget.toolbar');
|
|
29
|
+
var TerminalChatContextKeyStrings;
|
|
30
|
+
(function (TerminalChatContextKeyStrings) {
|
|
31
|
+
TerminalChatContextKeyStrings["ChatFocus"] = "terminalChatFocus";
|
|
32
|
+
TerminalChatContextKeyStrings["ChatVisible"] = "terminalChatVisible";
|
|
33
|
+
TerminalChatContextKeyStrings["ChatActiveRequest"] = "terminalChatActiveRequest";
|
|
34
|
+
TerminalChatContextKeyStrings["ChatInputHasText"] = "terminalChatInputHasText";
|
|
35
|
+
TerminalChatContextKeyStrings["ChatAgentRegistered"] = "terminalChatAgentRegistered";
|
|
36
|
+
TerminalChatContextKeyStrings["ChatResponseEditorFocused"] = "terminalChatResponseEditorFocused";
|
|
37
|
+
TerminalChatContextKeyStrings["ChatResponseContainsCodeBlock"] = "terminalChatResponseContainsCodeBlock";
|
|
38
|
+
TerminalChatContextKeyStrings["ChatResponseContainsMultipleCodeBlocks"] = "terminalChatResponseContainsMultipleCodeBlocks";
|
|
39
|
+
TerminalChatContextKeyStrings["ChatResponseSupportsIssueReporting"] = "terminalChatResponseSupportsIssueReporting";
|
|
40
|
+
TerminalChatContextKeyStrings["ChatSessionResponseVote"] = "terminalChatSessionResponseVote";
|
|
41
|
+
TerminalChatContextKeyStrings["ChatHasTerminals"] = "hasChatTerminals";
|
|
42
|
+
TerminalChatContextKeyStrings["ChatHasHiddenTerminals"] = "hasHiddenChatTerminals";
|
|
43
|
+
})(TerminalChatContextKeyStrings || (TerminalChatContextKeyStrings = {}));
|
|
44
|
+
var TerminalChatContextKeys;
|
|
45
|
+
(function (TerminalChatContextKeys) {
|
|
46
|
+
TerminalChatContextKeys.focused = ( new RawContextKey(TerminalChatContextKeyStrings.ChatFocus, false, ( localize(11942, "Whether the chat view is focused."))));
|
|
47
|
+
TerminalChatContextKeys.visible = ( new RawContextKey(TerminalChatContextKeyStrings.ChatVisible, false, ( localize(11943, "Whether the chat view is visible."))));
|
|
48
|
+
TerminalChatContextKeys.requestActive = ( new RawContextKey(TerminalChatContextKeyStrings.ChatActiveRequest, false, ( localize(11944, "Whether there is an active chat request."))));
|
|
49
|
+
TerminalChatContextKeys.inputHasText = ( new RawContextKey(TerminalChatContextKeyStrings.ChatInputHasText, false, ( localize(11945, "Whether the chat input has text."))));
|
|
50
|
+
TerminalChatContextKeys.responseContainsCodeBlock = ( new RawContextKey(
|
|
51
|
+
TerminalChatContextKeyStrings.ChatResponseContainsCodeBlock,
|
|
52
|
+
false,
|
|
53
|
+
( localize(11946, "Whether the chat response contains a code block."))
|
|
54
|
+
));
|
|
55
|
+
TerminalChatContextKeys.responseContainsMultipleCodeBlocks = ( new RawContextKey(
|
|
56
|
+
TerminalChatContextKeyStrings.ChatResponseContainsMultipleCodeBlocks,
|
|
57
|
+
false,
|
|
58
|
+
( localize(11947, "Whether the chat response contains multiple code blocks."))
|
|
59
|
+
));
|
|
60
|
+
TerminalChatContextKeys.hasChatAgent = ( new RawContextKey(TerminalChatContextKeyStrings.ChatAgentRegistered, false, ( localize(11948, "Whether a chat agent is registered for the terminal location."))));
|
|
61
|
+
TerminalChatContextKeys.hasChatTerminals = ( new RawContextKey(TerminalChatContextKeyStrings.ChatHasTerminals, false, ( localize(11949, "Whether there are any chat terminals."))));
|
|
62
|
+
TerminalChatContextKeys.hasHiddenChatTerminals = ( new RawContextKey(
|
|
63
|
+
TerminalChatContextKeyStrings.ChatHasHiddenTerminals,
|
|
64
|
+
false,
|
|
65
|
+
( localize(11950, "Whether there are any hidden chat terminals."))
|
|
66
|
+
));
|
|
67
|
+
})(TerminalChatContextKeys || (TerminalChatContextKeys = {}));
|
|
68
|
+
|
|
69
|
+
export { MENU_TERMINAL_CHAT_WIDGET_INPUT_SIDE_TOOLBAR, MENU_TERMINAL_CHAT_WIDGET_STATUS, TerminalChatCommandId, TerminalChatContextKeyStrings, TerminalChatContextKeys };
|
package/vscode/src/vs/workbench/contrib/terminalContrib/stickyScroll/browser/media/stickyScroll.css
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*---------------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
+
*--------------------------------------------------------------------------------------------*/
|
|
5
|
+
|
|
6
|
+
.terminal-sticky-scroll {
|
|
7
|
+
display: none;
|
|
8
|
+
position: absolute;
|
|
9
|
+
left: 0;
|
|
10
|
+
right: 14px; /* Don't overlap terminal scroll bar */
|
|
11
|
+
z-index: 32; /* Must be higher than decorations */
|
|
12
|
+
background: var(--vscode-terminalStickyScroll-background, var(--vscode-terminal-background, var(--vscode-panel-background)));
|
|
13
|
+
box-shadow: var(--vscode-scrollbar-shadow) 0 3px 2px -2px;
|
|
14
|
+
border-bottom: 1px solid var(--vscode-terminalStickyScroll-border, transparent);
|
|
15
|
+
}
|
|
16
|
+
.part.sidebar .terminal-sticky-scroll,
|
|
17
|
+
.part.auxiliarybar .terminal-sticky-scroll {
|
|
18
|
+
background: var(--vscode-terminalStickyScroll-background, var(--vscode-terminal-background, var(--vscode-sideBar-background)));
|
|
19
|
+
}
|
|
20
|
+
.editor-instance .terminal-sticky-scroll {
|
|
21
|
+
background: var(--vscode-terminalStickyScroll-background, var(--vscode-terminal-background, var(--vscode-editor-background)));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.terminal-sticky-scroll.visible {
|
|
25
|
+
display:block;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.terminal-sticky-scroll:hover {
|
|
29
|
+
cursor: pointer !important;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.terminal-sticky-scroll .xterm {
|
|
33
|
+
position: relative !important;
|
|
34
|
+
pointer-events: none;
|
|
35
|
+
padding-bottom: 0 !important;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.terminal-sticky-scroll .hover-overlay {
|
|
39
|
+
position: absolute;
|
|
40
|
+
left: 0;
|
|
41
|
+
right: 0;
|
|
42
|
+
top: 0;
|
|
43
|
+
bottom: 0;
|
|
44
|
+
cursor: pointer !important;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.terminal-sticky-scroll .hover-overlay:hover {
|
|
48
|
+
background-color: var(--vscode-terminalStickyScrollHover-background, transparent);
|
|
49
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
+
import { registerColor } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
4
|
+
|
|
5
|
+
const terminalStickyScrollBackground = registerColor('terminalStickyScroll.background', null, ( localize(
|
|
6
|
+
12216,
|
|
7
|
+
'The background color of the sticky scroll overlay in the terminal.'
|
|
8
|
+
)));
|
|
9
|
+
const terminalStickyScrollHoverBackground = registerColor('terminalStickyScrollHover.background', {
|
|
10
|
+
dark: '#2A2D2E',
|
|
11
|
+
light: '#F0F0F0',
|
|
12
|
+
hcDark: '#E48B39',
|
|
13
|
+
hcLight: '#0f4a85'
|
|
14
|
+
}, ( localize(
|
|
15
|
+
12217,
|
|
16
|
+
'The background color of the sticky scroll overlay in the terminal when hovered.'
|
|
17
|
+
)));
|
|
18
|
+
registerColor('terminalStickyScroll.border', {
|
|
19
|
+
dark: null,
|
|
20
|
+
light: null,
|
|
21
|
+
hcDark: '#6fc3df',
|
|
22
|
+
hcLight: '#0f4a85'
|
|
23
|
+
}, ( localize(12218, 'The border of the sticky scroll overlay in the terminal.')));
|
|
24
|
+
|
|
25
|
+
export { terminalStickyScrollBackground, terminalStickyScrollHoverBackground };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Terminal as RawXtermTerminal } from "@xterm/xterm";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
4
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
5
|
+
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
|
+
import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
|
|
7
|
+
import { ITerminalContribution, ITerminalInstance, IXtermTerminal } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
8
|
+
import type { ITerminalContributionContext } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminalExtensions";
|
|
9
|
+
export declare class TerminalStickyScrollContribution extends Disposable implements ITerminalContribution {
|
|
10
|
+
private readonly _ctx;
|
|
11
|
+
private readonly _configurationService;
|
|
12
|
+
private readonly _contextKeyService;
|
|
13
|
+
private readonly _instantiationService;
|
|
14
|
+
private readonly _keybindingService;
|
|
15
|
+
static readonly ID = "terminal.stickyScroll";
|
|
16
|
+
static get(instance: ITerminalInstance): TerminalStickyScrollContribution | null;
|
|
17
|
+
private _xterm?;
|
|
18
|
+
private readonly _overlay;
|
|
19
|
+
private readonly _enableListeners;
|
|
20
|
+
private readonly _disableListeners;
|
|
21
|
+
private readonly _richCommandDetectionListeners;
|
|
22
|
+
constructor(_ctx: ITerminalContributionContext, _configurationService: IConfigurationService, _contextKeyService: IContextKeyService, _instantiationService: IInstantiationService, _keybindingService: IKeybindingService);
|
|
23
|
+
xtermReady(xterm: IXtermTerminal & {
|
|
24
|
+
raw: RawXtermTerminal;
|
|
25
|
+
}): void;
|
|
26
|
+
xtermOpen(xterm: IXtermTerminal & {
|
|
27
|
+
raw: RawXtermTerminal;
|
|
28
|
+
}): void;
|
|
29
|
+
hideLock(): void;
|
|
30
|
+
hideUnlock(): void;
|
|
31
|
+
private _refreshState;
|
|
32
|
+
private _tryEnable;
|
|
33
|
+
private _tryDisable;
|
|
34
|
+
private _shouldBeEnabled;
|
|
35
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
|
|
2
|
+
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
5
|
+
import { Disposable, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
7
|
+
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
8
|
+
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
9
|
+
import { IKeybindingService } from '@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service';
|
|
10
|
+
import { TerminalCapability } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities';
|
|
11
|
+
import { TerminalInstance, TerminalInstanceColorProvider } from '../../../terminal/browser/terminalInstance.js';
|
|
12
|
+
import { TerminalStickyScrollSettingId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/stickyScroll/common/terminalStickyScrollConfiguration';
|
|
13
|
+
import * as stickyScroll from './media/stickyScroll.css';
|
|
14
|
+
import { TerminalStickyScrollOverlay } from './terminalStickyScrollOverlay.js';
|
|
15
|
+
|
|
16
|
+
var TerminalStickyScrollContribution_1;
|
|
17
|
+
registerCss(stickyScroll);
|
|
18
|
+
let TerminalStickyScrollContribution = class TerminalStickyScrollContribution extends Disposable {
|
|
19
|
+
static { TerminalStickyScrollContribution_1 = this; }
|
|
20
|
+
static { this.ID = 'terminal.stickyScroll'; }
|
|
21
|
+
static get(instance) {
|
|
22
|
+
return instance.getContribution(TerminalStickyScrollContribution_1.ID);
|
|
23
|
+
}
|
|
24
|
+
constructor(_ctx, _configurationService, _contextKeyService, _instantiationService, _keybindingService) {
|
|
25
|
+
super();
|
|
26
|
+
this._ctx = _ctx;
|
|
27
|
+
this._configurationService = _configurationService;
|
|
28
|
+
this._contextKeyService = _contextKeyService;
|
|
29
|
+
this._instantiationService = _instantiationService;
|
|
30
|
+
this._keybindingService = _keybindingService;
|
|
31
|
+
this._overlay = this._register(( new MutableDisposable()));
|
|
32
|
+
this._enableListeners = this._register(( new MutableDisposable()));
|
|
33
|
+
this._disableListeners = this._register(( new MutableDisposable()));
|
|
34
|
+
this._richCommandDetectionListeners = this._register(( new MutableDisposable()));
|
|
35
|
+
this._register(Event.runAndSubscribe(this._configurationService.onDidChangeConfiguration, e => {
|
|
36
|
+
if (!e || e.affectsConfiguration(TerminalStickyScrollSettingId.Enabled)) {
|
|
37
|
+
this._refreshState();
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
xtermReady(xterm) {
|
|
42
|
+
this._xterm = xterm;
|
|
43
|
+
this._refreshState();
|
|
44
|
+
}
|
|
45
|
+
xtermOpen(xterm) {
|
|
46
|
+
this._refreshState();
|
|
47
|
+
}
|
|
48
|
+
hideLock() {
|
|
49
|
+
this._overlay.value?.lockHide();
|
|
50
|
+
}
|
|
51
|
+
hideUnlock() {
|
|
52
|
+
this._overlay.value?.unlockHide();
|
|
53
|
+
}
|
|
54
|
+
_refreshState() {
|
|
55
|
+
if (this._overlay.value) {
|
|
56
|
+
this._tryDisable();
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
this._tryEnable();
|
|
60
|
+
}
|
|
61
|
+
if (this._overlay.value) {
|
|
62
|
+
this._enableListeners.clear();
|
|
63
|
+
if (!this._disableListeners.value) {
|
|
64
|
+
this._disableListeners.value = this._ctx.instance.capabilities.onDidRemoveCapability(e => {
|
|
65
|
+
if (e.id === TerminalCapability.CommandDetection) {
|
|
66
|
+
this._refreshState();
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this._disableListeners.clear();
|
|
73
|
+
if (!this._enableListeners.value) {
|
|
74
|
+
this._enableListeners.value = this._ctx.instance.capabilities.onDidAddCapability(e => {
|
|
75
|
+
if (e.id === TerminalCapability.CommandDetection) {
|
|
76
|
+
this._refreshState();
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
_tryEnable() {
|
|
83
|
+
const capability = this._ctx.instance.capabilities.get(TerminalCapability.CommandDetection);
|
|
84
|
+
if (this._shouldBeEnabled()) {
|
|
85
|
+
const xtermCtorEventually = TerminalInstance.getXtermConstructor(this._keybindingService, this._contextKeyService);
|
|
86
|
+
this._overlay.value = this._instantiationService.createInstance(TerminalStickyScrollOverlay, this._ctx.instance, this._xterm, this._instantiationService.createInstance(TerminalInstanceColorProvider, this._ctx.instance.targetRef), capability, xtermCtorEventually);
|
|
87
|
+
this._richCommandDetectionListeners.clear();
|
|
88
|
+
}
|
|
89
|
+
else if (capability && !capability.hasRichCommandDetection) {
|
|
90
|
+
this._richCommandDetectionListeners.value = capability.onSetRichCommandDetection(() => {
|
|
91
|
+
this._refreshState();
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
this._richCommandDetectionListeners.clear();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
_tryDisable() {
|
|
99
|
+
if (!this._shouldBeEnabled()) {
|
|
100
|
+
this._overlay.clear();
|
|
101
|
+
this._richCommandDetectionListeners.clear();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
_shouldBeEnabled() {
|
|
105
|
+
const capability = this._ctx.instance.capabilities.get(TerminalCapability.CommandDetection);
|
|
106
|
+
const result = !!(this._configurationService.getValue(TerminalStickyScrollSettingId.Enabled) && capability && capability.hasRichCommandDetection && this._xterm?.raw?.element);
|
|
107
|
+
return result;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
TerminalStickyScrollContribution = TerminalStickyScrollContribution_1 = ( __decorate([
|
|
111
|
+
( __param(1, IConfigurationService)),
|
|
112
|
+
( __param(2, IContextKeyService)),
|
|
113
|
+
( __param(3, IInstantiationService)),
|
|
114
|
+
( __param(4, IKeybindingService))
|
|
115
|
+
], TerminalStickyScrollContribution));
|
|
116
|
+
|
|
117
|
+
export { TerminalStickyScrollContribution };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Terminal as RawXtermTerminal, Terminal as XTermTerminal } from "@xterm/xterm";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions.service";
|
|
4
|
+
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
5
|
+
import { IContextKeyService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service";
|
|
6
|
+
import { IContextMenuService } from "@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service";
|
|
7
|
+
import { IKeybindingService } from "@codingame/monaco-vscode-api/vscode/vs/platform/keybinding/common/keybinding.service";
|
|
8
|
+
import { ICommandDetectionCapability } from "@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities";
|
|
9
|
+
import { IThemeService } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service";
|
|
10
|
+
import { ITerminalInstance, IXtermColorProvider, IXtermTerminal } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal";
|
|
11
|
+
import { ITerminalConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service";
|
|
12
|
+
export declare class TerminalStickyScrollOverlay extends Disposable {
|
|
13
|
+
private readonly _instance;
|
|
14
|
+
private readonly _xterm;
|
|
15
|
+
private readonly _xtermColorProvider;
|
|
16
|
+
private readonly _commandDetection;
|
|
17
|
+
private readonly _contextMenuService;
|
|
18
|
+
private readonly _keybindingService;
|
|
19
|
+
private readonly _terminalConfigurationService;
|
|
20
|
+
private readonly _themeService;
|
|
21
|
+
private _stickyScrollOverlay?;
|
|
22
|
+
private readonly _xtermAddonLoader;
|
|
23
|
+
private _serializeAddon?;
|
|
24
|
+
private _webglAddon?;
|
|
25
|
+
private _ligaturesAddon?;
|
|
26
|
+
private _element?;
|
|
27
|
+
private _currentStickyCommand?;
|
|
28
|
+
private _currentContent?;
|
|
29
|
+
private _contextMenu;
|
|
30
|
+
private readonly _refreshListeners;
|
|
31
|
+
private _state;
|
|
32
|
+
private _isRefreshQueued;
|
|
33
|
+
private _rawMaxLineCount;
|
|
34
|
+
private _pendingShowOperation;
|
|
35
|
+
constructor(_instance: ITerminalInstance, _xterm: IXtermTerminal & {
|
|
36
|
+
raw: RawXtermTerminal;
|
|
37
|
+
}, _xtermColorProvider: IXtermColorProvider, _commandDetection: ICommandDetectionCapability, xtermCtor: Promise<typeof XTermTerminal>, configurationService: IConfigurationService, contextKeyService: IContextKeyService, _contextMenuService: IContextMenuService, _keybindingService: IKeybindingService, menuService: IMenuService, _terminalConfigurationService: ITerminalConfigurationService, _themeService: IThemeService);
|
|
38
|
+
lockHide(): void;
|
|
39
|
+
unlockHide(): void;
|
|
40
|
+
private _setState;
|
|
41
|
+
private _installRefreshListeners;
|
|
42
|
+
private _uninstallRefreshListeners;
|
|
43
|
+
private _setVisible;
|
|
44
|
+
private _show;
|
|
45
|
+
private _hide;
|
|
46
|
+
private _refresh;
|
|
47
|
+
private _refreshNow;
|
|
48
|
+
private _updateContent;
|
|
49
|
+
private _ensureElement;
|
|
50
|
+
private _syncOptions;
|
|
51
|
+
private _getOptions;
|
|
52
|
+
private _refreshGpuAcceleration;
|
|
53
|
+
private _shouldLoadWebgl;
|
|
54
|
+
private _getTheme;
|
|
55
|
+
private _isClearCommand;
|
|
56
|
+
}
|