@theia/terminal 1.34.2 → 1.34.3

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 (121) hide show
  1. package/LICENSE +641 -641
  2. package/README.md +30 -30
  3. package/lib/browser/base/terminal-service.d.ts +34 -34
  4. package/lib/browser/base/terminal-service.js +7 -7
  5. package/lib/browser/base/terminal-widget.d.ts +184 -184
  6. package/lib/browser/base/terminal-widget.js +34 -34
  7. package/lib/browser/index.d.ts +1 -1
  8. package/lib/browser/index.js +28 -28
  9. package/lib/browser/search/terminal-search-container.d.ts +3 -3
  10. package/lib/browser/search/terminal-search-container.js +28 -28
  11. package/lib/browser/search/terminal-search-widget.d.ts +30 -30
  12. package/lib/browser/search/terminal-search-widget.js +147 -147
  13. package/lib/browser/shell-terminal-profile.d.ts +19 -19
  14. package/lib/browser/shell-terminal-profile.js +39 -39
  15. package/lib/browser/terminal-contribution.d.ts +3 -3
  16. package/lib/browser/terminal-contribution.js +20 -20
  17. package/lib/browser/terminal-copy-on-selection-handler.d.ts +10 -10
  18. package/lib/browser/terminal-copy-on-selection-handler.js +103 -103
  19. package/lib/browser/terminal-file-link-provider.d.ts +24 -24
  20. package/lib/browser/terminal-file-link-provider.js +200 -200
  21. package/lib/browser/terminal-frontend-contribution.d.ts +112 -112
  22. package/lib/browser/terminal-frontend-contribution.js +994 -994
  23. package/lib/browser/terminal-frontend-module.d.ts +5 -5
  24. package/lib/browser/terminal-frontend-module.js +115 -115
  25. package/lib/browser/terminal-keybinding-contexts.d.ts +15 -15
  26. package/lib/browser/terminal-keybinding-contexts.js +71 -71
  27. package/lib/browser/terminal-link-helpers.d.ts +27 -27
  28. package/lib/browser/terminal-link-helpers.js +155 -155
  29. package/lib/browser/terminal-link-provider.d.ts +51 -51
  30. package/lib/browser/terminal-link-provider.js +197 -197
  31. package/lib/browser/terminal-preferences.d.ts +61 -61
  32. package/lib/browser/terminal-preferences.js +329 -329
  33. package/lib/browser/terminal-profile-service.d.ts +55 -55
  34. package/lib/browser/terminal-profile-service.js +149 -149
  35. package/lib/browser/terminal-quick-open-service.d.ts +36 -36
  36. package/lib/browser/terminal-quick-open-service.js +137 -137
  37. package/lib/browser/terminal-theme-service.d.ts +21 -21
  38. package/lib/browser/terminal-theme-service.js +218 -218
  39. package/lib/browser/terminal-url-link-provider.d.ts +11 -11
  40. package/lib/browser/terminal-url-link-provider.js +76 -76
  41. package/lib/browser/terminal-widget-impl.d.ts +173 -173
  42. package/lib/browser/terminal-widget-impl.js +769 -769
  43. package/lib/common/base-terminal-protocol.d.ts +100 -100
  44. package/lib/common/base-terminal-protocol.js +88 -88
  45. package/lib/common/shell-terminal-protocol.d.ts +29 -29
  46. package/lib/common/shell-terminal-protocol.js +22 -22
  47. package/lib/common/terminal-common-module.d.ts +7 -7
  48. package/lib/common/terminal-common-module.js +31 -31
  49. package/lib/common/terminal-protocol.d.ts +12 -12
  50. package/lib/common/terminal-protocol.js +21 -21
  51. package/lib/common/terminal-watcher.d.ts +13 -13
  52. package/lib/common/terminal-watcher.js +70 -70
  53. package/lib/node/base-terminal-server.d.ts +36 -36
  54. package/lib/node/base-terminal-server.js +252 -252
  55. package/lib/node/buffering-stream.d.ts +39 -39
  56. package/lib/node/buffering-stream.js +75 -75
  57. package/lib/node/buffering-stream.spec.d.ts +1 -1
  58. package/lib/node/buffering-stream.spec.js +43 -43
  59. package/lib/node/index.d.ts +1 -1
  60. package/lib/node/index.js +28 -28
  61. package/lib/node/shell-process.d.ts +26 -26
  62. package/lib/node/shell-process.js +106 -106
  63. package/lib/node/shell-terminal-server.d.ts +14 -14
  64. package/lib/node/shell-terminal-server.js +114 -114
  65. package/lib/node/shell-terminal-server.spec.d.ts +1 -1
  66. package/lib/node/shell-terminal-server.spec.js +35 -35
  67. package/lib/node/terminal-backend-contribution.d.ts +9 -9
  68. package/lib/node/terminal-backend-contribution.js +75 -75
  69. package/lib/node/terminal-backend-contribution.slow-spec.d.ts +1 -1
  70. package/lib/node/terminal-backend-contribution.slow-spec.js +54 -54
  71. package/lib/node/terminal-backend-module.d.ts +11 -11
  72. package/lib/node/terminal-backend-module.js +69 -69
  73. package/lib/node/terminal-server.d.ts +9 -9
  74. package/lib/node/terminal-server.js +64 -64
  75. package/lib/node/terminal-server.spec.d.ts +1 -1
  76. package/lib/node/terminal-server.spec.js +41 -41
  77. package/lib/node/test/terminal-test-container.d.ts +2 -2
  78. package/lib/node/test/terminal-test-container.js +40 -40
  79. package/lib/package.spec.js +25 -25
  80. package/package.json +9 -9
  81. package/src/browser/base/terminal-service.ts +60 -60
  82. package/src/browser/base/terminal-widget.ts +244 -244
  83. package/src/browser/index.ts +17 -17
  84. package/src/browser/search/terminal-search-container.ts +28 -28
  85. package/src/browser/search/terminal-search-widget.tsx +161 -161
  86. package/src/browser/shell-terminal-profile.ts +40 -40
  87. package/src/browser/style/terminal-search.css +93 -93
  88. package/src/browser/style/terminal.css +33 -33
  89. package/src/browser/terminal-contribution.ts +19 -19
  90. package/src/browser/terminal-copy-on-selection-handler.ts +92 -92
  91. package/src/browser/terminal-file-link-provider.ts +200 -200
  92. package/src/browser/terminal-frontend-contribution.ts +1048 -1048
  93. package/src/browser/terminal-frontend-module.ts +139 -139
  94. package/src/browser/terminal-keybinding-contexts.ts +52 -52
  95. package/src/browser/terminal-link-helpers.ts +187 -187
  96. package/src/browser/terminal-link-provider.ts +203 -203
  97. package/src/browser/terminal-preferences.ts +427 -427
  98. package/src/browser/terminal-profile-service.ts +170 -170
  99. package/src/browser/terminal-quick-open-service.ts +132 -132
  100. package/src/browser/terminal-theme-service.ts +209 -209
  101. package/src/browser/terminal-url-link-provider.ts +66 -66
  102. package/src/browser/terminal-widget-impl.ts +827 -827
  103. package/src/common/base-terminal-protocol.ts +183 -183
  104. package/src/common/shell-terminal-protocol.ts +50 -50
  105. package/src/common/terminal-common-module.ts +30 -30
  106. package/src/common/terminal-protocol.ts +32 -32
  107. package/src/common/terminal-watcher.ts +69 -69
  108. package/src/node/base-terminal-server.ts +279 -279
  109. package/src/node/buffering-stream.spec.ts +46 -46
  110. package/src/node/buffering-stream.ts +95 -95
  111. package/src/node/index.ts +17 -17
  112. package/src/node/shell-process.ts +101 -101
  113. package/src/node/shell-terminal-server.spec.ts +40 -40
  114. package/src/node/shell-terminal-server.ts +95 -95
  115. package/src/node/terminal-backend-contribution.slow-spec.ts +63 -63
  116. package/src/node/terminal-backend-contribution.ts +60 -60
  117. package/src/node/terminal-backend-module.ts +82 -82
  118. package/src/node/terminal-server.spec.ts +47 -47
  119. package/src/node/terminal-server.ts +52 -52
  120. package/src/node/test/terminal-test-container.ts +39 -39
  121. package/src/package.spec.ts +28 -28
@@ -1,156 +1,156 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2022 STMicroelectronics and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.convertLinkRangeToBuffer = exports.getLinkContext = exports.LinkContext = void 0;
19
- exports.LinkContext = Symbol('LinkContext');
20
- /*---------------------------------------------------------------------------------------------
21
- * Copyright (c) Microsoft Corporation and others. All rights reserved.
22
- * Licensed under the MIT License.
23
- *--------------------------------------------------------------------------------------------*/
24
- function getLinkContext(terminal, line, maxLinkLength = 2000) {
25
- var _a, _b;
26
- // The following method is based on VS Code's TerminalLinkDetectorAdapter._provideLinks()
27
- // https://github.com/microsoft/vscode/blob/7888ff3a6b104e9e2e3d0f7890ca92dd0828215f/src/vs/workbench/contrib/terminal/browser/links/terminalLinkDetectorAdapter.ts#L51
28
- let startLine = line - 1;
29
- let endLine = startLine;
30
- const lines = [terminal.buffer.active.getLine(startLine)];
31
- // Cap the maximum context on either side of the line being provided, by taking the context
32
- // around the line being provided for this ensures the line the pointer is on will have
33
- // links provided.
34
- const maxLineContext = Math.max(maxLinkLength / terminal.cols);
35
- const minStartLine = Math.max(startLine - maxLineContext, 0);
36
- const maxEndLine = Math.min(endLine + maxLineContext, terminal.buffer.active.length);
37
- while (startLine >= minStartLine && ((_a = terminal.buffer.active.getLine(startLine)) === null || _a === void 0 ? void 0 : _a.isWrapped)) {
38
- lines.unshift(terminal.buffer.active.getLine(startLine - 1));
39
- startLine--;
40
- }
41
- while (endLine < maxEndLine && ((_b = terminal.buffer.active.getLine(endLine + 1)) === null || _b === void 0 ? void 0 : _b.isWrapped)) {
42
- lines.push(terminal.buffer.active.getLine(endLine + 1));
43
- endLine++;
44
- }
45
- const text = getXtermLineContent(terminal.buffer.active, startLine, endLine, terminal.cols);
46
- return { text, startLine, lines };
47
- }
48
- exports.getLinkContext = getLinkContext;
49
- // The following code is taken as is from
50
- // https://github.com/microsoft/vscode/blob/7888ff3a6b104e9e2e3d0f7890ca92dd0828215f/src/vs/workbench/contrib/terminal/browser/links/terminalLinkHelpers.ts#L1
51
- /**
52
- * Converts a possibly wrapped link's range (comprised of string indices) into a buffer range that plays nicely with xterm.js
53
- *
54
- * @param lines A single line (not the entire buffer)
55
- * @param bufferWidth The number of columns in the terminal
56
- * @param range The link range - string indices
57
- * @param startLine The absolute y position (on the buffer) of the line
58
- */
59
- function convertLinkRangeToBuffer(lines, bufferWidth, range, startLine) {
60
- const bufferRange = {
61
- start: {
62
- x: range.startColumn,
63
- y: range.startLineNumber + startLine
64
- },
65
- end: {
66
- x: range.endColumn - 1,
67
- y: range.endLineNumber + startLine
68
- }
69
- };
70
- // Shift start range right for each wide character before the link
71
- let startOffset = 0;
72
- const startWrappedLineCount = Math.ceil(range.startColumn / bufferWidth);
73
- for (let y = 0; y < Math.min(startWrappedLineCount); y++) {
74
- const lineLength = Math.min(bufferWidth, range.startColumn - y * bufferWidth);
75
- let lineOffset = 0;
76
- const line = lines[y];
77
- // Sanity check for line, apparently this can happen but it's not clear under what
78
- // circumstances this happens. Continue on, skipping the remainder of start offset if this
79
- // happens to minimize impact.
80
- if (!line) {
81
- break;
82
- }
83
- for (let x = 0; x < Math.min(bufferWidth, lineLength + lineOffset); x++) {
84
- const cell = line.getCell(x);
85
- const width = cell.getWidth();
86
- if (width === 2) {
87
- lineOffset++;
88
- }
89
- const char = cell.getChars();
90
- if (char.length > 1) {
91
- lineOffset -= char.length - 1;
92
- }
93
- }
94
- startOffset += lineOffset;
95
- }
96
- // Shift end range right for each wide character inside the link
97
- let endOffset = 0;
98
- const endWrappedLineCount = Math.ceil(range.endColumn / bufferWidth);
99
- for (let y = Math.max(0, startWrappedLineCount - 1); y < endWrappedLineCount; y++) {
100
- const start = (y === startWrappedLineCount - 1 ? (range.startColumn + startOffset) % bufferWidth : 0);
101
- const lineLength = Math.min(bufferWidth, range.endColumn + startOffset - y * bufferWidth);
102
- const startLineOffset = (y === startWrappedLineCount - 1 ? startOffset : 0);
103
- let lineOffset = 0;
104
- const line = lines[y];
105
- // Sanity check for line, apparently this can happen but it's not clear under what
106
- // circumstances this happens. Continue on, skipping the remainder of start offset if this
107
- // happens to minimize impact.
108
- if (!line) {
109
- break;
110
- }
111
- for (let x = start; x < Math.min(bufferWidth, lineLength + lineOffset + startLineOffset); x++) {
112
- const cell = line.getCell(x);
113
- const width = cell.getWidth();
114
- // Offset for 0 cells following wide characters
115
- if (width === 2) {
116
- lineOffset++;
117
- }
118
- // Offset for early wrapping when the last cell in row is a wide character
119
- if (x === bufferWidth - 1 && cell.getChars() === '') {
120
- lineOffset++;
121
- }
122
- }
123
- endOffset += lineOffset;
124
- }
125
- // Apply the width character offsets to the result
126
- bufferRange.start.x += startOffset;
127
- bufferRange.end.x += startOffset + endOffset;
128
- // Convert back to wrapped lines
129
- while (bufferRange.start.x > bufferWidth) {
130
- bufferRange.start.x -= bufferWidth;
131
- bufferRange.start.y++;
132
- }
133
- while (bufferRange.end.x > bufferWidth) {
134
- bufferRange.end.x -= bufferWidth;
135
- bufferRange.end.y++;
136
- }
137
- return bufferRange;
138
- }
139
- exports.convertLinkRangeToBuffer = convertLinkRangeToBuffer;
140
- function getXtermLineContent(buffer, lineStart, lineEnd, cols) {
141
- // Cap the maximum number of lines generated to prevent potential performance problems. This is
142
- // more of a sanity check as the wrapped line should already be trimmed down at this point.
143
- const maxLineLength = Math.max(2048 / cols * 2);
144
- lineEnd = Math.min(lineEnd, lineStart + maxLineLength);
145
- let content = '';
146
- for (let i = lineStart; i <= lineEnd; i++) {
147
- // Make sure only 0 to cols are considered as resizing when windows mode is enabled will
148
- // retain buffer data outside of the terminal width as reflow is disabled.
149
- const line = buffer.getLine(i);
150
- if (line) {
151
- content += line.translateToString(true, 0, cols);
152
- }
153
- }
154
- return content;
155
- }
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2022 STMicroelectronics and others.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.convertLinkRangeToBuffer = exports.getLinkContext = exports.LinkContext = void 0;
19
+ exports.LinkContext = Symbol('LinkContext');
20
+ /*---------------------------------------------------------------------------------------------
21
+ * Copyright (c) Microsoft Corporation and others. All rights reserved.
22
+ * Licensed under the MIT License.
23
+ *--------------------------------------------------------------------------------------------*/
24
+ function getLinkContext(terminal, line, maxLinkLength = 2000) {
25
+ var _a, _b;
26
+ // The following method is based on VS Code's TerminalLinkDetectorAdapter._provideLinks()
27
+ // https://github.com/microsoft/vscode/blob/7888ff3a6b104e9e2e3d0f7890ca92dd0828215f/src/vs/workbench/contrib/terminal/browser/links/terminalLinkDetectorAdapter.ts#L51
28
+ let startLine = line - 1;
29
+ let endLine = startLine;
30
+ const lines = [terminal.buffer.active.getLine(startLine)];
31
+ // Cap the maximum context on either side of the line being provided, by taking the context
32
+ // around the line being provided for this ensures the line the pointer is on will have
33
+ // links provided.
34
+ const maxLineContext = Math.max(maxLinkLength / terminal.cols);
35
+ const minStartLine = Math.max(startLine - maxLineContext, 0);
36
+ const maxEndLine = Math.min(endLine + maxLineContext, terminal.buffer.active.length);
37
+ while (startLine >= minStartLine && ((_a = terminal.buffer.active.getLine(startLine)) === null || _a === void 0 ? void 0 : _a.isWrapped)) {
38
+ lines.unshift(terminal.buffer.active.getLine(startLine - 1));
39
+ startLine--;
40
+ }
41
+ while (endLine < maxEndLine && ((_b = terminal.buffer.active.getLine(endLine + 1)) === null || _b === void 0 ? void 0 : _b.isWrapped)) {
42
+ lines.push(terminal.buffer.active.getLine(endLine + 1));
43
+ endLine++;
44
+ }
45
+ const text = getXtermLineContent(terminal.buffer.active, startLine, endLine, terminal.cols);
46
+ return { text, startLine, lines };
47
+ }
48
+ exports.getLinkContext = getLinkContext;
49
+ // The following code is taken as is from
50
+ // https://github.com/microsoft/vscode/blob/7888ff3a6b104e9e2e3d0f7890ca92dd0828215f/src/vs/workbench/contrib/terminal/browser/links/terminalLinkHelpers.ts#L1
51
+ /**
52
+ * Converts a possibly wrapped link's range (comprised of string indices) into a buffer range that plays nicely with xterm.js
53
+ *
54
+ * @param lines A single line (not the entire buffer)
55
+ * @param bufferWidth The number of columns in the terminal
56
+ * @param range The link range - string indices
57
+ * @param startLine The absolute y position (on the buffer) of the line
58
+ */
59
+ function convertLinkRangeToBuffer(lines, bufferWidth, range, startLine) {
60
+ const bufferRange = {
61
+ start: {
62
+ x: range.startColumn,
63
+ y: range.startLineNumber + startLine
64
+ },
65
+ end: {
66
+ x: range.endColumn - 1,
67
+ y: range.endLineNumber + startLine
68
+ }
69
+ };
70
+ // Shift start range right for each wide character before the link
71
+ let startOffset = 0;
72
+ const startWrappedLineCount = Math.ceil(range.startColumn / bufferWidth);
73
+ for (let y = 0; y < Math.min(startWrappedLineCount); y++) {
74
+ const lineLength = Math.min(bufferWidth, range.startColumn - y * bufferWidth);
75
+ let lineOffset = 0;
76
+ const line = lines[y];
77
+ // Sanity check for line, apparently this can happen but it's not clear under what
78
+ // circumstances this happens. Continue on, skipping the remainder of start offset if this
79
+ // happens to minimize impact.
80
+ if (!line) {
81
+ break;
82
+ }
83
+ for (let x = 0; x < Math.min(bufferWidth, lineLength + lineOffset); x++) {
84
+ const cell = line.getCell(x);
85
+ const width = cell.getWidth();
86
+ if (width === 2) {
87
+ lineOffset++;
88
+ }
89
+ const char = cell.getChars();
90
+ if (char.length > 1) {
91
+ lineOffset -= char.length - 1;
92
+ }
93
+ }
94
+ startOffset += lineOffset;
95
+ }
96
+ // Shift end range right for each wide character inside the link
97
+ let endOffset = 0;
98
+ const endWrappedLineCount = Math.ceil(range.endColumn / bufferWidth);
99
+ for (let y = Math.max(0, startWrappedLineCount - 1); y < endWrappedLineCount; y++) {
100
+ const start = (y === startWrappedLineCount - 1 ? (range.startColumn + startOffset) % bufferWidth : 0);
101
+ const lineLength = Math.min(bufferWidth, range.endColumn + startOffset - y * bufferWidth);
102
+ const startLineOffset = (y === startWrappedLineCount - 1 ? startOffset : 0);
103
+ let lineOffset = 0;
104
+ const line = lines[y];
105
+ // Sanity check for line, apparently this can happen but it's not clear under what
106
+ // circumstances this happens. Continue on, skipping the remainder of start offset if this
107
+ // happens to minimize impact.
108
+ if (!line) {
109
+ break;
110
+ }
111
+ for (let x = start; x < Math.min(bufferWidth, lineLength + lineOffset + startLineOffset); x++) {
112
+ const cell = line.getCell(x);
113
+ const width = cell.getWidth();
114
+ // Offset for 0 cells following wide characters
115
+ if (width === 2) {
116
+ lineOffset++;
117
+ }
118
+ // Offset for early wrapping when the last cell in row is a wide character
119
+ if (x === bufferWidth - 1 && cell.getChars() === '') {
120
+ lineOffset++;
121
+ }
122
+ }
123
+ endOffset += lineOffset;
124
+ }
125
+ // Apply the width character offsets to the result
126
+ bufferRange.start.x += startOffset;
127
+ bufferRange.end.x += startOffset + endOffset;
128
+ // Convert back to wrapped lines
129
+ while (bufferRange.start.x > bufferWidth) {
130
+ bufferRange.start.x -= bufferWidth;
131
+ bufferRange.start.y++;
132
+ }
133
+ while (bufferRange.end.x > bufferWidth) {
134
+ bufferRange.end.x -= bufferWidth;
135
+ bufferRange.end.y++;
136
+ }
137
+ return bufferRange;
138
+ }
139
+ exports.convertLinkRangeToBuffer = convertLinkRangeToBuffer;
140
+ function getXtermLineContent(buffer, lineStart, lineEnd, cols) {
141
+ // Cap the maximum number of lines generated to prevent potential performance problems. This is
142
+ // more of a sanity check as the wrapped line should already be trimmed down at this point.
143
+ const maxLineLength = Math.max(2048 / cols * 2);
144
+ lineEnd = Math.min(lineEnd, lineStart + maxLineLength);
145
+ let content = '';
146
+ for (let i = lineStart; i <= lineEnd; i++) {
147
+ // Make sure only 0 to cols are considered as resizing when windows mode is enabled will
148
+ // retain buffer data outside of the terminal width as reflow is disabled.
149
+ const line = buffer.getLine(i);
150
+ if (line) {
151
+ content += line.translateToString(true, 0, cols);
152
+ }
153
+ }
154
+ return content;
155
+ }
156
156
  //# sourceMappingURL=terminal-link-helpers.js.map
@@ -1,52 +1,52 @@
1
- import { CancellationToken, ContributionProvider, DisposableCollection } from '@theia/core';
2
- import { PreferenceService } from '@theia/core/lib/browser';
3
- import { interfaces } from '@theia/core/shared/inversify';
4
- import { IBufferRange, ILink, ILinkDecorations } from 'xterm';
5
- import { TerminalWidget } from './base/terminal-widget';
6
- import { TerminalContribution } from './terminal-contribution';
7
- import { LinkContext } from './terminal-link-helpers';
8
- import { TerminalWidgetImpl } from './terminal-widget-impl';
9
- export declare const TerminalLinkProvider: unique symbol;
10
- export interface TerminalLinkProvider {
11
- provideLinks(line: string, terminal: TerminalWidget, cancelationToken?: CancellationToken): Promise<TerminalLink[]>;
12
- }
13
- export declare const TerminalLink: unique symbol;
14
- export interface TerminalLink {
15
- startIndex: number;
16
- length: number;
17
- tooltip?: string;
18
- handle(): Promise<void>;
19
- }
20
- export declare const XtermLink: unique symbol;
21
- export declare const XtermLinkFactory: unique symbol;
22
- export declare type XtermLinkFactory = (link: TerminalLink, terminal: TerminalWidgetImpl, context: LinkContext) => ILink;
23
- export declare function createXtermLinkFactory(ctx: interfaces.Context): XtermLinkFactory;
24
- export declare class TerminalLinkProviderContribution implements TerminalContribution {
25
- protected readonly terminalLinkContributionProvider: ContributionProvider<TerminalLinkProvider>;
26
- protected readonly xtermLinkFactory: XtermLinkFactory;
27
- onCreate(terminalWidget: TerminalWidgetImpl): void;
28
- protected provideTerminalLinks(terminal: TerminalWidgetImpl, line: number, provideLinks: (links?: ILink[]) => void): Promise<void>;
29
- }
30
- export declare class XtermLinkAdapter implements ILink {
31
- text: string;
32
- range: IBufferRange;
33
- decorations: ILinkDecorations;
34
- protected link: TerminalLink;
35
- protected terminalWidget: TerminalWidgetImpl;
36
- protected context: LinkContext;
37
- protected readonly preferences: PreferenceService;
38
- protected toDispose: DisposableCollection;
39
- protected mouseEnteredHover: boolean;
40
- protected mouseLeftHover: boolean;
41
- initializeLinkFields(): void;
42
- hover(event: MouseEvent, text: string): void;
43
- protected scheduleHover(event: MouseEvent): void;
44
- protected showHover(event: MouseEvent): void;
45
- leave(event: MouseEvent): void;
46
- protected cancelHover(): void;
47
- activate(event: MouseEvent, text: string): void;
48
- protected executeLinkHandler(): void;
49
- protected isModifierKeyDown(event: MouseEvent | KeyboardEvent): boolean;
50
- protected wasTouchEvent(event: MouseEvent, lastTouchEnd?: TouchEvent): boolean;
51
- }
1
+ import { CancellationToken, ContributionProvider, DisposableCollection } from '@theia/core';
2
+ import { PreferenceService } from '@theia/core/lib/browser';
3
+ import { interfaces } from '@theia/core/shared/inversify';
4
+ import { IBufferRange, ILink, ILinkDecorations } from 'xterm';
5
+ import { TerminalWidget } from './base/terminal-widget';
6
+ import { TerminalContribution } from './terminal-contribution';
7
+ import { LinkContext } from './terminal-link-helpers';
8
+ import { TerminalWidgetImpl } from './terminal-widget-impl';
9
+ export declare const TerminalLinkProvider: unique symbol;
10
+ export interface TerminalLinkProvider {
11
+ provideLinks(line: string, terminal: TerminalWidget, cancelationToken?: CancellationToken): Promise<TerminalLink[]>;
12
+ }
13
+ export declare const TerminalLink: unique symbol;
14
+ export interface TerminalLink {
15
+ startIndex: number;
16
+ length: number;
17
+ tooltip?: string;
18
+ handle(): Promise<void>;
19
+ }
20
+ export declare const XtermLink: unique symbol;
21
+ export declare const XtermLinkFactory: unique symbol;
22
+ export declare type XtermLinkFactory = (link: TerminalLink, terminal: TerminalWidgetImpl, context: LinkContext) => ILink;
23
+ export declare function createXtermLinkFactory(ctx: interfaces.Context): XtermLinkFactory;
24
+ export declare class TerminalLinkProviderContribution implements TerminalContribution {
25
+ protected readonly terminalLinkContributionProvider: ContributionProvider<TerminalLinkProvider>;
26
+ protected readonly xtermLinkFactory: XtermLinkFactory;
27
+ onCreate(terminalWidget: TerminalWidgetImpl): void;
28
+ protected provideTerminalLinks(terminal: TerminalWidgetImpl, line: number, provideLinks: (links?: ILink[]) => void): Promise<void>;
29
+ }
30
+ export declare class XtermLinkAdapter implements ILink {
31
+ text: string;
32
+ range: IBufferRange;
33
+ decorations: ILinkDecorations;
34
+ protected link: TerminalLink;
35
+ protected terminalWidget: TerminalWidgetImpl;
36
+ protected context: LinkContext;
37
+ protected readonly preferences: PreferenceService;
38
+ protected toDispose: DisposableCollection;
39
+ protected mouseEnteredHover: boolean;
40
+ protected mouseLeftHover: boolean;
41
+ initializeLinkFields(): void;
42
+ hover(event: MouseEvent, text: string): void;
43
+ protected scheduleHover(event: MouseEvent): void;
44
+ protected showHover(event: MouseEvent): void;
45
+ leave(event: MouseEvent): void;
46
+ protected cancelHover(): void;
47
+ activate(event: MouseEvent, text: string): void;
48
+ protected executeLinkHandler(): void;
49
+ protected isModifierKeyDown(event: MouseEvent | KeyboardEvent): boolean;
50
+ protected wasTouchEvent(event: MouseEvent, lastTouchEnd?: TouchEvent): boolean;
51
+ }
52
52
  //# sourceMappingURL=terminal-link-provider.d.ts.map