Skip to content

Commit 87e684e

Browse files
authored
fix generic mark hover (microsoft#153385)
1 parent 0a435fb commit 87e684e

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

src/vs/platform/terminal/common/xterm/shellIntegrationAddon.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,12 @@ export class ShellIntegrationAddon extends Disposable implements IShellIntegrati
308308
return false;
309309
}
310310

311-
const [command, hoverMessage, disableCommandStorage] = data.split(';');
311+
const [command] = data.split(';');
312312
switch (command) {
313313
case ITermOscPt.SetMark: {
314-
this._createOrGetCommandDetection(this._terminal).handleGenericCommand({ genericMarkProperties: { hoverMessage: hoverMessage || '', disableCommandStorage: disableCommandStorage === 'true' ? true : false } });
314+
this._createOrGetCommandDetection(this._terminal).handleGenericCommand({ genericMarkProperties: { disableCommandStorage: true } });
315315
}
316316
}
317-
318317
// Unrecognized sequence
319318
return false;
320319
}

src/vs/workbench/contrib/terminal/browser/terminalEscapeSequences.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ export const enum VSCodeOscProperty {
9797
*/
9898
export const enum ITermOscPt {
9999
/**
100-
* Set a mark on the scroll bar `OSC 1337 ; SetMark`
101-
* Based on ITerm's `OSC 1337 ; SetMark`
100+
* Based on ITerm's `OSC 1337 ; SetMark` sets a mark on the scrollbar
102101
*/
103102
SetMark = 'SetMark'
104103
}

src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,10 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
289289
element.classList.add(DecorationSelector.CommandDecoration, DecorationSelector.Codicon, DecorationSelector.XtermDecoration);
290290
if (genericMarkProperties) {
291291
element.classList.add(DecorationSelector.DefaultColor, DecorationSelector.GenericMarkerIcon);
292+
if (!genericMarkProperties.hoverMessage) {
293+
//disable the mouse pointer
294+
element.classList.add(DecorationSelector.Default);
295+
}
292296
} else if (exitCode === undefined) {
293297
element.classList.add(DecorationSelector.DefaultColor, DecorationSelector.Default);
294298
element.classList.add(`codicon-${this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationIcon)}`);
@@ -319,9 +323,12 @@ export class DecorationAddon extends Disposable implements ITerminalAddon {
319323
this._hoverDelayer.trigger(() => {
320324
let hoverContent = `${localize('terminalPromptContextMenu', "Show Command Actions")}...`;
321325
hoverContent += '\n\n---\n\n';
322-
if (command.genericMarkProperties?.hoverMessage) {
323-
// TODO:@meganrogge localize
324-
hoverContent = command.genericMarkProperties.hoverMessage;
326+
if (command.genericMarkProperties) {
327+
if (command.genericMarkProperties.hoverMessage) {
328+
hoverContent = command.genericMarkProperties.hoverMessage;
329+
} else {
330+
return;
331+
}
325332
} else if (command.exitCode) {
326333
if (command.exitCode === -1) {
327334
hoverContent += localize('terminalPromptCommandFailed', 'Command executed {0} and failed', fromNow(command.timestamp, true));

0 commit comments

Comments
 (0)