@@ -1535,6 +1535,16 @@ export class Terminal extends EventEmitter implements ITerminal, IDisposable, II
|
||||
return this.selectionManager ? this.selectionManager.hasSelection : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Selects text within the terminal.
|
||||
* @param column The column the selection starts at..
|
||||
* @param row The row the selection starts at.
|
||||
* @param length The length of the selection.
|
||||
*/
|
||||
public setSelection(column: number, row: number, length: number): void {
|
||||
this.selectionManager.setSelection(column, row, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the terminal's current selection, this is useful for implementing copy
|
||||
* behavior outside of xterm.js.
|
||||
|
||||
@@ -80,6 +80,9 @@ export class MockTerminal implements ITerminal {
|
||||
hasSelection(): boolean {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
setSelection(column: number, row: number, length: number): void {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
getSelection(): string {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
@@ -249,6 +249,7 @@ export interface IPublicTerminal extends IDisposable, IEventEmitter {
|
||||
deregisterCharacterJoiner(joinerId: number): void;
|
||||
addMarker(cursorYOffset: number): IMarker;
|
||||
hasSelection(): boolean;
|
||||
setSelection(column: number, row: number, length: number): void;
|
||||
getSelection(): string;
|
||||
clearSelection(): void;
|
||||
selectAll(): void;
|
||||
|
||||
@@ -96,6 +96,9 @@ export class Terminal implements ITerminalApi {
|
||||
public hasSelection(): boolean {
|
||||
return this._core.hasSelection();
|
||||
}
|
||||
public setSelection(column: number, row: number, length: number): void {
|
||||
this._core.setSelection(column, row, length);
|
||||
}
|
||||
public getSelection(): string {
|
||||
return this._core.getSelection();
|
||||
}
|
||||
|
||||
Vendored
+8
@@ -670,6 +670,14 @@ declare module 'xterm' {
|
||||
*/
|
||||
hasSelection(): boolean;
|
||||
|
||||
/**
|
||||
* Selects text within the terminal.
|
||||
* @param column The column the selection starts at..
|
||||
* @param row The row the selection starts at.
|
||||
* @param length The length of the selection.
|
||||
*/
|
||||
setSelection(column: number, row: number, length: number): void;
|
||||
|
||||
/**
|
||||
* Gets the terminal's current selection, this is useful for implementing
|
||||
* copy behavior outside of xterm.js.
|
||||
|
||||
Reference in New Issue
Block a user