mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 10:15:41 +00:00
Merge pull request #198316 from microsoft/tyriar/198313
Focus terminal after clicking sticky scroll
This commit is contained in:
commit
110e7886e2
2 changed files with 4 additions and 1 deletions
|
@ -93,6 +93,7 @@ export class TerminalStickyScrollContribution extends Disposable implements ITer
|
|||
const xtermCtorEventually = TerminalInstance.getXtermConstructor(this._keybindingService, this._contextKeyService);
|
||||
this._overlay.value = this._instantiationService.createInstance(
|
||||
TerminalStickyScrollOverlay,
|
||||
this._instance,
|
||||
this._xterm!,
|
||||
this._instantiationService.createInstance(TerminalInstanceColorProvider, this._instance),
|
||||
this._instance.capabilities.get(TerminalCapability.CommandDetection)!,
|
||||
|
|
|
@ -17,7 +17,7 @@ import { ICommandDetectionCapability, ITerminalCommand } from 'vs/platform/termi
|
|||
import { ICurrentPartialCommand } from 'vs/platform/terminal/common/capabilities/commandDetection/terminalCommand';
|
||||
import { TerminalSettingId } from 'vs/platform/terminal/common/terminal';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { IXtermColorProvider, IXtermTerminal } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { ITerminalInstance, IXtermColorProvider, IXtermTerminal } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||
import { IXtermCore } from 'vs/workbench/contrib/terminal/browser/xterm-private';
|
||||
import { TERMINAL_CONFIG_SECTION } from 'vs/workbench/contrib/terminal/common/terminal';
|
||||
import { terminalStickyScrollHoverBackground } from 'vs/workbench/contrib/terminalContrib/stickyScroll/browser/terminalStickyScrollColorRegistry';
|
||||
|
@ -49,6 +49,7 @@ export class TerminalStickyScrollOverlay extends Disposable {
|
|||
private _maxLineCount: number = 5;
|
||||
|
||||
constructor(
|
||||
private readonly _instance: ITerminalInstance,
|
||||
private readonly _xterm: IXtermTerminal & { raw: RawXtermTerminal },
|
||||
private readonly _xtermColorProvider: IXtermColorProvider,
|
||||
private readonly _commandDetection: ICommandDetectionCapability,
|
||||
|
@ -273,6 +274,7 @@ export class TerminalStickyScrollOverlay extends Disposable {
|
|||
this._register(addStandardDisposableListener(hoverOverlay, 'click', () => {
|
||||
if (this._xterm && this._currentStickyCommand && 'getOutput' in this._currentStickyCommand) {
|
||||
this._xterm.markTracker.revealCommand(this._currentStickyCommand);
|
||||
this._instance.focus();
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
Loading…
Reference in a new issue