mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
Merge branch 'master' into window_manipulation
This commit is contained in:
@@ -26,7 +26,13 @@ const end = ')($|' + negatedPathCharacterSet + ')';
|
||||
const strictUrlRegex = new RegExp(start + protocolClause + bodyClause + end);
|
||||
|
||||
function handleLink(event: MouseEvent, uri: string): void {
|
||||
window.open(uri, '_blank');
|
||||
const newWindow = window.open();
|
||||
if (newWindow) {
|
||||
newWindow.opener = null;
|
||||
newWindow.location.href = uri;
|
||||
} else {
|
||||
console.warn('Opening link blocked as opener could not be cleared');
|
||||
}
|
||||
}
|
||||
|
||||
export class WebLinksAddon implements ITerminalAddon {
|
||||
|
||||
@@ -298,7 +298,13 @@ export class Linkifier implements ILinkifier {
|
||||
if (matcher.handler) {
|
||||
return matcher.handler(e, uri);
|
||||
}
|
||||
window.open(uri, '_blank');
|
||||
const newWindow = window.open();
|
||||
if (newWindow) {
|
||||
newWindow.opener = null;
|
||||
newWindow.location.href = uri;
|
||||
} else {
|
||||
console.warn('Opening link blocked as opener could not be cleared');
|
||||
}
|
||||
},
|
||||
() => {
|
||||
this._onLinkHover.fire(this._createLinkHoverEvent(x1, y1, x2, y2, fg));
|
||||
|
||||
Vendored
+2
-22
@@ -1170,7 +1170,7 @@ declare module 'xterm' {
|
||||
}
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) Data type to register a CSI, DCS or ESC callback in the parser
|
||||
* Data type to register a CSI, DCS or ESC callback in the parser
|
||||
* in the form:
|
||||
* ESC I..I F
|
||||
* CSI Prefix P..P I..I F
|
||||
@@ -1214,7 +1214,7 @@ declare module 'xterm' {
|
||||
}
|
||||
|
||||
/**
|
||||
* (EXPERIMENTAL) Parser interface.
|
||||
* Allows hooking into the parser for custom handling of escape sequences.
|
||||
*/
|
||||
export interface IParser {
|
||||
/**
|
||||
@@ -1231,11 +1231,6 @@ declare module 'xterm' {
|
||||
*/
|
||||
registerCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable;
|
||||
|
||||
/**
|
||||
* @deprecated use `registerMarker` instead.
|
||||
*/
|
||||
addCsiHandler(id: IFunctionIdentifier, callback: (params: (number | number[])[]) => boolean): IDisposable;
|
||||
|
||||
/**
|
||||
* Adds a handler for DCS escape sequences.
|
||||
* @param id Specifies the function identifier under which the callback
|
||||
@@ -1255,11 +1250,6 @@ declare module 'xterm' {
|
||||
*/
|
||||
registerDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable;
|
||||
|
||||
/**
|
||||
* @deprecated use `registerMarker` instead.
|
||||
*/
|
||||
addDcsHandler(id: IFunctionIdentifier, callback: (data: string, param: (number | number[])[]) => boolean): IDisposable;
|
||||
|
||||
/**
|
||||
* Adds a handler for ESC escape sequences.
|
||||
* @param id Specifies the function identifier under which the callback
|
||||
@@ -1273,11 +1263,6 @@ declare module 'xterm' {
|
||||
*/
|
||||
registerEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable;
|
||||
|
||||
/**
|
||||
* @deprecated use `registerMarker` instead.
|
||||
*/
|
||||
addEscHandler(id: IFunctionIdentifier, handler: () => boolean): IDisposable;
|
||||
|
||||
/**
|
||||
* Adds a handler for OSC escape sequences.
|
||||
* @param ident The number (first parameter) of the sequence.
|
||||
@@ -1295,11 +1280,6 @@ declare module 'xterm' {
|
||||
* @return An IDisposable you can call to remove this handler.
|
||||
*/
|
||||
registerOscHandler(ident: number, callback: (data: string) => boolean): IDisposable;
|
||||
|
||||
/**
|
||||
* @deprecated use `registerMarker` instead.
|
||||
*/
|
||||
addOscHandler(ident: number, callback: (data: string) => boolean): IDisposable;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user