Merge remote-tracking branch 'upstream/master' into pr/silamon/4004

This commit is contained in:
Daniel Imms
2022-09-02 13:05:52 -07:00
68 changed files with 1620 additions and 767 deletions
+39
View File
@@ -128,6 +128,14 @@ declare module 'xterm' {
*/
lineHeight?: number;
/**
* The handler for OSC 8 hyperlinks. Links will use the `confirm` browser
* API if no link handler is set. Consider the security of users when using
* this, there should be some tooltip or prompt when hovering or activating
* the link.
*/
linkHandler?: ILinkHandler | null;
/**
* What log level to use, this will log for all levels below and including
* what is set:
@@ -1106,6 +1114,37 @@ declare module 'xterm' {
y: number;
}
/**
* A link handler for OSC 8 hyperlinks.
*/
interface ILinkHandler {
/**
* Calls when the link is activated.
* @param event The mouse event triggering the callback.
* @param text The text of the link.
* @param range The buffer range of the link.
*/
activate(event: MouseEvent, text: string, range: IBufferRange): void;
/**
* Called when the mouse hovers the link. To use this to create a DOM-based hover tooltip,
* create the hover element within `Terminal.element` and add the `xterm-hover` class to it,
* that will cause mouse events to not fall through and activate other links.
* @param event The mouse event triggering the callback.
* @param text The text of the link.
* @param range The buffer range of the link.
*/
hover?(event: MouseEvent, text: string, range: IBufferRange): void;
/**
* Called when the mouse leaves the link.
* @param event The mouse event triggering the callback.
* @param text The text of the link.
* @param range The buffer range of the link.
*/
leave?(event: MouseEvent, text: string, range: IBufferRange): void;
}
/**
* A custom link provider.
*/