@xterm/xterm 5.4.0-beta.30 → 5.4.0-beta.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xterm/xterm",
3
3
  "description": "Full xterm terminal, in your browser",
4
- "version": "5.4.0-beta.30",
4
+ "version": "5.4.0-beta.32",
5
5
  "main": "lib/xterm.js",
6
6
  "style": "css/xterm.css",
7
7
  "types": "typings/xterm.d.ts",
@@ -138,6 +138,9 @@ export class Terminal extends Disposable implements ITerminalApi {
138
138
  public focus(): void {
139
139
  this._core.focus();
140
140
  }
141
+ public input(data: string, wasUserInput: boolean = true): void {
142
+ this._core.input(data, wasUserInput);
143
+ }
141
144
  public resize(columns: number, rows: number): void {
142
145
  this._verifyIntegers(columns, rows);
143
146
  this._core.resize(columns, rows);
@@ -247,7 +247,7 @@ export class RenderService extends Disposable implements IRenderService {
247
247
  return;
248
248
  }
249
249
  if (this._isPaused) {
250
- this._pausedResizeTask.set(() => this._renderer.value!.handleResize(cols, rows));
250
+ this._pausedResizeTask.set(() => this._renderer.value?.handleResize(cols, rows));
251
251
  } else {
252
252
  this._renderer.value.handleResize(cols, rows);
253
253
  }
@@ -168,6 +168,10 @@ export abstract class CoreTerminal extends Disposable implements ICoreTerminal {
168
168
  this._writeBuffer.writeSync(data, maxSubsequentCalls);
169
169
  }
170
170
 
171
+ public input(data: string, wasUserInput: boolean = true): void {
172
+ this.coreService.triggerDataEvent(data, wasUserInput);
173
+ }
174
+
171
175
  public resize(x: number, y: number): void {
172
176
  if (isNaN(x) || isNaN(y)) {
173
177
  return;
@@ -81,6 +81,10 @@ export class Terminal extends CoreTerminal {
81
81
  this._onBell.fire();
82
82
  }
83
83
 
84
+ public input(data: string, wasUserInput: boolean = true): void {
85
+ this.coreService.triggerDataEvent(data, wasUserInput);
86
+ }
87
+
84
88
  /**
85
89
  * Resizes the terminal.
86
90
  *
@@ -134,6 +134,9 @@ export class Terminal extends Disposable implements ITerminalApi {
134
134
  this._publicOptions[propName] = options[propName];
135
135
  }
136
136
  }
137
+ public input(data: string, wasUserInput: boolean = true): void {
138
+ this._core.input(data, wasUserInput);
139
+ }
137
140
  public resize(columns: number, rows: number): void {
138
141
  this._verifyIntegers(columns, rows);
139
142
  this._core.resize(columns, rows);
@@ -963,6 +963,18 @@ declare module '@xterm/xterm' {
963
963
  */
964
964
  focus(): void;
965
965
 
966
+ /**
967
+ * Input data to application side. The data is treated the same way input
968
+ * typed into the terminal would (ie. the {@link onData} event will fire).
969
+ * @param data The data to forward to the application.
970
+ * @param wasUserInput Whether the input is genuine user input. This is true
971
+ * by default and triggers additionalbehavior like focus or selection
972
+ * clearing. Set this to false if the data sent should not be treated like
973
+ * user input would, for example passing an escape sequence to the
974
+ * application.
975
+ */
976
+ input(data: string, wasUserInput?: boolean): void;
977
+
966
978
  /**
967
979
  * Resizes the terminal. It's best practice to debounce calls to resize,
968
980
  * this will help ensure that the pty can respond to the resize event