Expose API method for writing to application side (#4948)

This commit is contained in:
arencoskun
2024-02-01 11:17:25 +03:00
parent 8e015ebf87
commit f1e563ad5f
5 changed files with 22 additions and 0 deletions
+9
View File
@@ -1191,6 +1191,15 @@ export class Terminal extends CoreTerminal implements ITerminal {
return false;
}
/**
* Input data to application side.
* The data is treated the same way as typed input at the terminal (will appear in the onData event).
*/
public input(data: string): void {
this.coreService.triggerDataEvent(data, true);
return this.write(data);
}
/**
* Resizes the terminal.
+3
View File
@@ -72,6 +72,9 @@ export class MockTerminal implements ITerminal {
public focus(): void {
throw new Error('Method not implemented.');
}
public input(data: string): void {
throw new Error('Method not implemented.');
}
public resize(columns: number, rows: number): void {
throw new Error('Method not implemented.');
}
+3
View File
@@ -138,6 +138,9 @@ export class Terminal extends Disposable implements ITerminalApi {
public focus(): void {
this._core.focus();
}
public input(data: string): void {
this._core.input(data);
}
public resize(columns: number, rows: number): void {
this._verifyIntegers(columns, rows);
this._core.resize(columns, rows);