Tidy
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
"prepublishOnly": "npm run package"
|
"prepublishOnly": "npm run package"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@xterm/xterm": "^5.5.0"
|
"@xterm/xterm": "^5.4.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"js-base64": "^3.7.5"
|
"js-base64": "^3.7.5"
|
||||||
|
|||||||
@@ -11,13 +11,11 @@ export class ClipboardAddon implements ITerminalAddon {
|
|||||||
private _terminal?: Terminal;
|
private _terminal?: Terminal;
|
||||||
private _disposable?: IDisposable;
|
private _disposable?: IDisposable;
|
||||||
|
|
||||||
constructor(private _provider: IClipboardProvider = new ClipboardProvider()) {
|
constructor(private _provider: IClipboardProvider = new ClipboardProvider()) {}
|
||||||
this._provider = _provider;
|
|
||||||
}
|
|
||||||
|
|
||||||
public activate(terminal: Terminal): void {
|
public activate(terminal: Terminal): void {
|
||||||
this._disposable = terminal.parser.registerOscHandler(52, this._setOrReportClipboard);
|
|
||||||
this._terminal = terminal;
|
this._terminal = terminal;
|
||||||
|
this._disposable = terminal.parser.registerOscHandler(52, this._setOrReportClipboard);
|
||||||
}
|
}
|
||||||
|
|
||||||
public dispose(): void {
|
public dispose(): void {
|
||||||
@@ -42,7 +40,7 @@ export class ClipboardAddon implements ITerminalAddon {
|
|||||||
try {
|
try {
|
||||||
if (pd === '?') {
|
if (pd === '?') {
|
||||||
// Report clipboard
|
// Report clipboard
|
||||||
return this._provider.readText(pc).then(data => {
|
return this._provider.readText(pc).then((data) => {
|
||||||
this._terminal?.input(`\x1b]52;${pc};${data}\x07`, false);
|
this._terminal?.input(`\x1b]52;${pc};${data}\x07`, false);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
@@ -72,7 +70,7 @@ export class ClipboardProvider implements IClipboardProvider {
|
|||||||
* Zero means no limit.
|
* Zero means no limit.
|
||||||
*/
|
*/
|
||||||
limit: number = 0 // unlimited
|
limit: number = 0 // unlimited
|
||||||
){
|
) {
|
||||||
this._base64 = base64;
|
this._base64 = base64;
|
||||||
this.limit = limit;
|
this.limit = limit;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user