mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-31 17:20:28 -04:00
Merge from vscode 099a7622e6e90dbcc226e428d4e35a72cb19ecbc (#9646)
* Merge from vscode 099a7622e6e90dbcc226e428d4e35a72cb19ecbc * fix strict
This commit is contained in:
@@ -131,6 +131,14 @@ export interface ITerminalService {
|
||||
findNext(): void;
|
||||
findPrevious(): void;
|
||||
|
||||
/**
|
||||
* Link handlers can be registered here to allow intercepting links clicked in the terminal.
|
||||
* When a link is clicked, the link will be considered handled when the first interceptor
|
||||
* resolves with true. It will be considered not handled when _all_ link handlers resolve with
|
||||
* false, or 3 seconds have elapsed.
|
||||
*/
|
||||
addLinkHandler(key: string, callback: TerminalLinkHandlerCallback): IDisposable;
|
||||
|
||||
selectDefaultWindowsShell(): Promise<void>;
|
||||
|
||||
setContainers(panelContainer: HTMLElement, terminalContainer: HTMLElement): void;
|
||||
@@ -179,6 +187,18 @@ export enum WindowsShellType {
|
||||
}
|
||||
export type TerminalShellType = WindowsShellType | undefined;
|
||||
|
||||
export const LINK_INTERCEPT_THRESHOLD = 3000;
|
||||
|
||||
export interface ITerminalBeforeHandleLinkEvent {
|
||||
terminal?: ITerminalInstance;
|
||||
/** The text of the link */
|
||||
link: string;
|
||||
/** Call with whether the link was handled by the interceptor */
|
||||
resolve(wasHandled: boolean): void;
|
||||
}
|
||||
|
||||
export type TerminalLinkHandlerCallback = (e: ITerminalBeforeHandleLinkEvent) => Promise<boolean>;
|
||||
|
||||
export interface ITerminalInstance {
|
||||
/**
|
||||
* The ID of the terminal instance, this is an arbitrary number only used to identify the
|
||||
@@ -240,6 +260,11 @@ export interface ITerminalInstance {
|
||||
*/
|
||||
onExit: Event<number | undefined>;
|
||||
|
||||
/**
|
||||
* Attach a listener to intercept and handle link clicks in the terminal.
|
||||
*/
|
||||
onBeforeHandleLink: Event<ITerminalBeforeHandleLinkEvent>;
|
||||
|
||||
readonly exitCode: number | undefined;
|
||||
|
||||
processReady: Promise<void>;
|
||||
|
||||
Reference in New Issue
Block a user