mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
WIP: First draft
This commit is contained in:
@@ -36,6 +36,13 @@ function handleLink(event: MouseEvent, uri: string): void {
|
||||
*/
|
||||
export function webLinksInit(term: Terminal, handler: (event: MouseEvent, uri: string) => void = handleLink, options: ILinkMatcherOptions = {}): void {
|
||||
options.matchIndex = 1;
|
||||
|
||||
handler = (event, uri) => {
|
||||
if (!term.hasSelection()) {
|
||||
window.open(uri, '_blank');
|
||||
}
|
||||
};
|
||||
|
||||
term.registerLinkMatcher(strictUrlRegex, handler, options);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user