Add clearSelection API

This commit is contained in:
Daniel Imms
2017-06-07 13:07:34 -07:00
parent 1343b83fc3
commit 5d33727ae4
2 changed files with 17 additions and 0 deletions
+10
View File
@@ -180,6 +180,16 @@ export class SelectionManager extends EventEmitter {
return result.join('\n');
}
/**
* Clears the current terminal selection.
*/
public clearSelection(): void {
this._model.selectionStart = null;
this._model.selectionEnd = null;
this._removeMouseDownListeners();
this.refresh();
}
/**
* Translates a buffer line to a string, with optional start and end columns.
* Wide characters will count as two columns in the resulting string. This
+7
View File
@@ -1389,6 +1389,13 @@ Terminal.prototype.getSelection = function() {
return prepareTextForClipboard(this.selectionManager.selectionText);
}
/**
* Clears the current terminal selection.
*/
Terminal.prototype.clearSelection = function() {
this.selectionManager.clearSelection();
}
/**
* Selects all text within the terminal.
*/