tauri-pty 0.0.5 → 0.0.7

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Tauri Plugin Pseudo Terminal
2
2
 
3
- Developing! **Support Windows only now**. Wellcome to contribute!
3
+ Developing! Wellcome to contribute!
4
4
 
5
5
  ## Example
6
6
 
package/dist/index.es.js CHANGED
@@ -87,7 +87,7 @@ class TauriPty {
87
87
  flowControlPause: (_h = opt === null || opt === void 0 ? void 0 : opt.flowControlPause) !== null && _h !== void 0 ? _h : null,
88
88
  flowControlResume: (_j = opt === null || opt === void 0 ? void 0 : opt.flowControlResume) !== null && _j !== void 0 ? _j : null,
89
89
  };
90
- invoke('plugin:pty|spawn', invokeArgs).then(pid => {
90
+ this._init = invoke('plugin:pty|spawn', invokeArgs).then(pid => {
91
91
  this._exitted = false;
92
92
  this.pid = pid;
93
93
  this.readData();
@@ -101,22 +101,22 @@ class TauriPty {
101
101
  resize(columns, rows) {
102
102
  this.cols = columns;
103
103
  this.rows = rows;
104
- invoke('plugin:pty|resize', { pid: this.pid, cols: columns, rows }).catch(e => {
104
+ this._init.then(() => invoke('plugin:pty|resize', { pid: this.pid, cols: columns, rows }).catch(e => {
105
105
  console.error('Resize error: ', e);
106
106
  this.errorCheck();
107
- });
107
+ }));
108
108
  }
109
109
  clear() {
110
- throw new Error("Method not implemented.");
110
+ console.warn("clear is un implemented!");
111
111
  }
112
112
  write(data) {
113
- invoke('plugin:pty|write', { pid: this.pid, data }).catch(e => {
113
+ this._init.then(() => invoke('plugin:pty|write', { pid: this.pid, data }).catch(e => {
114
114
  console.error('Writing error: ', e);
115
115
  this.errorCheck();
116
- });
116
+ }));
117
117
  }
118
118
  kill(signal) {
119
- throw new Error("Method not implemented.");
119
+ this._init.then(() => invoke('plugin:pty|kill', { pid: this.pid }));
120
120
  }
121
121
  pause() {
122
122
  throw new Error("Method not implemented.");
@@ -126,6 +126,7 @@ class TauriPty {
126
126
  }
127
127
  readData() {
128
128
  return __awaiter(this, void 0, void 0, function* () {
129
+ yield this._init;
129
130
  try {
130
131
  for (;;) {
131
132
  const data = yield invoke('plugin:pty|read', { pid: this.pid });
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../api/eventEmitter2.ts","../api/index.ts"],"sourcesContent":["/**\r\n * Copyright (c) 2019, Microsoft Corporation (MIT License).\r\n */\r\n\r\nimport { IDisposable } from \".\";\r\n\r\ninterface IListener<T> {\r\n (e: T): void;\r\n}\r\n\r\nexport interface IEvent<T> {\r\n (listener: (e: T) => any): IDisposable;\r\n}\r\n\r\nexport class EventEmitter2<T> {\r\n private _listeners: IListener<T>[] = [];\r\n private _event?: IEvent<T>;\r\n\r\n public get event(): IEvent<T> {\r\n if (!this._event) {\r\n this._event = (listener: (e: T) => any) => {\r\n this._listeners.push(listener);\r\n const disposable = {\r\n dispose: () => {\r\n for (let i = 0; i < this._listeners.length; i++) {\r\n if (this._listeners[i] === listener) {\r\n this._listeners.splice(i, 1);\r\n return;\r\n }\r\n }\r\n }\r\n };\r\n return disposable;\r\n };\r\n }\r\n return this._event;\r\n }\r\n\r\n public fire(data: T): void {\r\n const queue: IListener<T>[] = [];\r\n for (let i = 0; i < this._listeners.length; i++) {\r\n queue.push(this._listeners[i]);\r\n }\r\n for (let i = 0; i < queue.length; i++) {\r\n queue[i].call(undefined, data);\r\n }\r\n }\r\n}","/**\r\n * Copyright (c) 2017, Daniel Imms (MIT License).\r\n * Copyright (c) 2018, Microsoft Corporation (MIT License).\r\n * Copyright (c) 2023, Tnze (MIT License).\r\n */\r\nimport { invoke } from \"@tauri-apps/api\"\r\nimport { EventEmitter2 } from \"./eventEmitter2\";\r\n\r\n/**\r\n * Forks a process as a pseudoterminal.\r\n * @param file The file to launch.\r\n * @param args The file's arguments as argv (string[]) or in a pre-escaped CommandLine format\r\n * (string). Note that the CommandLine option is only available on Windows and is expected to be\r\n * escaped properly.\r\n * @param options The options of the terminal.\r\n * @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx\r\n * @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx\r\n * @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx\r\n */\r\nexport function spawn(file: string, args: string[] | string, options: IPtyForkOptions | IWindowsPtyForkOptions): IPty {\r\n return new TauriPty(file, args, options)\r\n}\r\n\r\nexport interface IBasePtyForkOptions {\r\n\r\n /**\r\n * Name of the terminal to be set in environment ($TERM variable).\r\n */\r\n name?: string;\r\n\r\n /**\r\n * Number of intial cols of the pty.\r\n */\r\n cols?: number;\r\n\r\n /**\r\n * Number of initial rows of the pty.\r\n */\r\n rows?: number;\r\n\r\n /**\r\n * Working directory to be set for the child program.\r\n */\r\n cwd?: string;\r\n\r\n /**\r\n * Environment to be set for the child program.\r\n */\r\n env?: { [key: string]: string | undefined };\r\n\r\n /**\r\n * String encoding of the underlying pty.\r\n * If set, incoming data will be decoded to strings and outgoing strings to bytes applying this encoding.\r\n * If unset, incoming data will be delivered as raw bytes (Buffer type).\r\n * By default 'utf8' is assumed, to unset it explicitly set it to `null`.\r\n */\r\n encoding?: string | null;\r\n\r\n /**\r\n * (EXPERIMENTAL)\r\n * Whether to enable flow control handling (false by default). If enabled a message of `flowControlPause`\r\n * will pause the socket and thus blocking the child program execution due to buffer back pressure.\r\n * A message of `flowControlResume` will resume the socket into flow mode.\r\n * For performance reasons only a single message as a whole will match (no message part matching).\r\n * If flow control is enabled the `flowControlPause` and `flowControlResume` messages are not forwarded to\r\n * the underlying pseudoterminal.\r\n */\r\n handleFlowControl?: boolean;\r\n\r\n /**\r\n * (EXPERIMENTAL)\r\n * The string that should pause the pty when `handleFlowControl` is true. Default is XOFF ('\\x13').\r\n */\r\n flowControlPause?: string;\r\n\r\n /**\r\n * (EXPERIMENTAL)\r\n * The string that should resume the pty when `handleFlowControl` is true. Default is XON ('\\x11').\r\n */\r\n flowControlResume?: string;\r\n}\r\n\r\nexport interface IPtyForkOptions extends IBasePtyForkOptions {\r\n /**\r\n * Security warning: use this option with great caution,\r\n * as opened file descriptors with higher privileges might leak to the child program.\r\n */\r\n uid?: number;\r\n gid?: number;\r\n}\r\n\r\nexport interface IWindowsPtyForkOptions extends IBasePtyForkOptions {\r\n /**\r\n * Whether to use the ConPTY system on Windows. When this is not set, ConPTY will be used when\r\n * the Windows build number is >= 18309 (instead of winpty). Note that ConPTY is available from\r\n * build 17134 but is too unstable to enable by default.\r\n *\r\n * This setting does nothing on non-Windows.\r\n */\r\n useConpty?: boolean;\r\n\r\n /**\r\n * Whether to use PSEUDOCONSOLE_INHERIT_CURSOR in conpty.\r\n * @see https://docs.microsoft.com/en-us/windows/console/createpseudoconsole\r\n */\r\n conptyInheritCursor?: boolean;\r\n}\r\n\r\n/**\r\n * An interface representing a pseudoterminal, on Windows this is emulated via the winpty library.\r\n */\r\nexport interface IPty {\r\n /**\r\n * The process ID of the outer process.\r\n */\r\n readonly pid: number;\r\n\r\n /**\r\n * The column size in characters.\r\n */\r\n readonly cols: number;\r\n\r\n /**\r\n * The row size in characters.\r\n */\r\n readonly rows: number;\r\n\r\n /**\r\n * The title of the active process.\r\n */\r\n readonly process: string;\r\n\r\n /**\r\n * (EXPERIMENTAL)\r\n * Whether to handle flow control. Useful to disable/re-enable flow control during runtime.\r\n * Use this for binary data that is likely to contain the `flowControlPause` string by accident.\r\n */\r\n handleFlowControl: boolean;\r\n\r\n /**\r\n * Adds an event listener for when a data event fires. This happens when data is returned from\r\n * the pty.\r\n * @returns an `IDisposable` to stop listening.\r\n */\r\n readonly onData: IEvent<string>;\r\n\r\n /**\r\n * Adds an event listener for when an exit event fires. This happens when the pty exits.\r\n * @returns an `IDisposable` to stop listening.\r\n */\r\n readonly onExit: IEvent<{ exitCode: number, signal?: number }>;\r\n\r\n /**\r\n * Resizes the dimensions of the pty.\r\n * @param columns The number of columns to use.\r\n * @param rows The number of rows to use.\r\n */\r\n resize(columns: number, rows: number): void;\r\n\r\n /**\r\n * Clears the pty's internal representation of its buffer. This is a no-op\r\n * unless on Windows/ConPTY. This is useful if the buffer is cleared on the\r\n * frontend in order to synchronize state with the backend to avoid ConPTY\r\n * possibly reprinting the screen.\r\n */\r\n clear(): void;\r\n\r\n /**\r\n * Writes data to the pty.\r\n * @param data The data to write.\r\n */\r\n write(data: string): void;\r\n\r\n /**\r\n * Kills the pty.\r\n * @param signal The signal to use, defaults to SIGHUP. This parameter is not supported on\r\n * Windows.\r\n * @throws Will throw when signal is used on Windows.\r\n */\r\n kill(signal?: string): void;\r\n\r\n /**\r\n * Pauses the pty for customizable flow control.\r\n */\r\n pause(): void;\r\n\r\n /**\r\n * Resumes the pty for customizable flow control.\r\n */\r\n resume(): void;\r\n}\r\n\r\n/**\r\n * An object that can be disposed via a dispose function.\r\n */\r\nexport interface IDisposable {\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * An event that can be listened to.\r\n * @returns an `IDisposable` to stop listening.\r\n */\r\nexport interface IEvent<T> {\r\n (listener: (e: T) => any): IDisposable;\r\n}\r\n\r\nexport type ArgvOrCommandLine = string[] | string;\r\n\r\nclass TauriPty implements IPty, IDisposable {\r\n pid: number;\r\n cols: number;\r\n rows: number;\r\n process: string;\r\n handleFlowControl: boolean;\r\n\r\n _exitted: boolean;\r\n\r\n private _onData = new EventEmitter2<string>();\r\n private _onExit = new EventEmitter2<{ exitCode: number; signal?: number | undefined; }>();\r\n\r\n constructor(file: string, args?: ArgvOrCommandLine, opt?: IWindowsPtyForkOptions) {\r\n args = typeof args === 'string' ? [args] : args ?? []; // Convert args to string[] anyways.\r\n const invokeArgs = {\r\n file, args,\r\n termName: opt?.name ?? 'Terminal',\r\n cols: opt?.cols ?? null,\r\n rows: opt?.rows ?? null,\r\n cwd: opt?.cwd ?? null,\r\n env: opt?.env ?? {},\r\n encoding: opt?.encoding ?? null,\r\n handleFlowControl: opt?.handleFlowControl ?? null,\r\n flowControlPause: opt?.flowControlPause ?? null,\r\n flowControlResume: opt?.flowControlResume ?? null,\r\n };\r\n invoke<number>('plugin:pty|spawn', invokeArgs).then(pid => {\r\n this._exitted = false;\r\n this.pid = pid;\r\n this.readData()\r\n });\r\n }\r\n dispose(): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n public get onData(): IEvent<string> { return this._onData.event; }\r\n public get onExit(): IEvent<{ exitCode: number; signal?: number | undefined; }> { return this._onExit.event; }\r\n\r\n resize(columns: number, rows: number): void {\r\n this.cols = columns;\r\n this.rows = rows;\r\n invoke('plugin:pty|resize', { pid: this.pid, cols: columns, rows }).catch(e => {\r\n console.error('Resize error: ', e);\r\n this.errorCheck();\r\n });\r\n }\r\n clear(): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n write(data: string): void {\r\n invoke('plugin:pty|write', { pid: this.pid, data }).catch(e => {\r\n console.error('Writing error: ', e);\r\n this.errorCheck();\r\n });\r\n }\r\n kill(signal?: string | undefined): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n pause(): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n resume(): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n private async readData() {\r\n try {\r\n for (; ;) {\r\n const data = await invoke<string>('plugin:pty|read', { pid: this.pid });\r\n this._onData.fire(data);\r\n }\r\n } catch (e: any) {\r\n this.errorCheck();\r\n if (typeof e === 'string' && e.includes('EOF')) {\r\n return;\r\n }\r\n console.error('Reading error: ', e);\r\n }\r\n }\r\n\r\n private async errorCheck() {\r\n if (this._exitted) {\r\n return;\r\n }\r\n try {\r\n const exitCode = await invoke<number | null>('plugin:pty|exitstatus', { pid: this.pid })\r\n if (exitCode != null) {\r\n this._exitted = true;\r\n this._onExit.fire({ exitCode });\r\n }\r\n } catch (e: any) {\r\n console.error(e)\r\n }\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAca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,CAAC,CAAC;AACxE,oBAAA,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;iBAC3B;aACJ;YAAC,OAAO,CAAM,EAAE;gBACb,IAAI,CAAC,UAAU,EAAE,CAAC;AAClB,gBAAA,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;oBAC5C,OAAO;iBACV;AACD,gBAAA,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;aACvC;SACJ,CAAA,CAAA;AAAA,KAAA;IAEa,UAAU,GAAA;;AACpB,YAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,OAAO;aACV;AACD,YAAA,IAAI;AACA,gBAAA,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAgB,uBAAuB,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;AACxF,gBAAA,IAAI,QAAQ,IAAI,IAAI,EAAE;AAClB,oBAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;iBACnC;aACJ;YAAC,OAAO,CAAM,EAAE;AACb,gBAAA,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;aACnB;SACJ,CAAA,CAAA;AAAA,KAAA;AACJ;;;;"}
1
+ {"version":3,"file":"index.es.js","sources":["../api/eventEmitter2.ts","../api/index.ts"],"sourcesContent":["/**\r\n * Copyright (c) 2019, Microsoft Corporation (MIT License).\r\n */\r\n\r\nimport { IDisposable } from \".\";\r\n\r\ninterface IListener<T> {\r\n (e: T): void;\r\n}\r\n\r\nexport interface IEvent<T> {\r\n (listener: (e: T) => any): IDisposable;\r\n}\r\n\r\nexport class EventEmitter2<T> {\r\n private _listeners: IListener<T>[] = [];\r\n private _event?: IEvent<T>;\r\n\r\n public get event(): IEvent<T> {\r\n if (!this._event) {\r\n this._event = (listener: (e: T) => any) => {\r\n this._listeners.push(listener);\r\n const disposable = {\r\n dispose: () => {\r\n for (let i = 0; i < this._listeners.length; i++) {\r\n if (this._listeners[i] === listener) {\r\n this._listeners.splice(i, 1);\r\n return;\r\n }\r\n }\r\n }\r\n };\r\n return disposable;\r\n };\r\n }\r\n return this._event;\r\n }\r\n\r\n public fire(data: T): void {\r\n const queue: IListener<T>[] = [];\r\n for (let i = 0; i < this._listeners.length; i++) {\r\n queue.push(this._listeners[i]);\r\n }\r\n for (let i = 0; i < queue.length; i++) {\r\n queue[i].call(undefined, data);\r\n }\r\n }\r\n}","/**\r\n * Copyright (c) 2017, Daniel Imms (MIT License).\r\n * Copyright (c) 2018, Microsoft Corporation (MIT License).\r\n * Copyright (c) 2023, Tnze (MIT License).\r\n */\r\nimport { invoke } from '@tauri-apps/api'\r\nimport { EventEmitter2 } from \"./eventEmitter2\";\r\n\r\n/**\r\n * Forks a process as a pseudoterminal.\r\n * @param file The file to launch.\r\n * @param args The file's arguments as argv (string[]) or in a pre-escaped CommandLine format\r\n * (string). Note that the CommandLine option is only available on Windows and is expected to be\r\n * escaped properly.\r\n * @param options The options of the terminal.\r\n * @see CommandLineToArgvW https://msdn.microsoft.com/en-us/library/windows/desktop/bb776391(v=vs.85).aspx\r\n * @see Parsing C++ Comamnd-Line Arguments https://msdn.microsoft.com/en-us/library/17w5ykft.aspx\r\n * @see GetCommandLine https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156.aspx\r\n */\r\nexport function spawn(file: string, args: string[] | string, options: IPtyForkOptions | IWindowsPtyForkOptions): IPty {\r\n return new TauriPty(file, args, options)\r\n}\r\n\r\nexport interface IBasePtyForkOptions {\r\n\r\n /**\r\n * Name of the terminal to be set in environment ($TERM variable).\r\n */\r\n name?: string;\r\n\r\n /**\r\n * Number of intial cols of the pty.\r\n */\r\n cols?: number;\r\n\r\n /**\r\n * Number of initial rows of the pty.\r\n */\r\n rows?: number;\r\n\r\n /**\r\n * Working directory to be set for the child program.\r\n */\r\n cwd?: string;\r\n\r\n /**\r\n * Environment to be set for the child program.\r\n */\r\n env?: { [key: string]: string | undefined };\r\n\r\n /**\r\n * String encoding of the underlying pty.\r\n * If set, incoming data will be decoded to strings and outgoing strings to bytes applying this encoding.\r\n * If unset, incoming data will be delivered as raw bytes (Buffer type).\r\n * By default 'utf8' is assumed, to unset it explicitly set it to `null`.\r\n */\r\n encoding?: string | null;\r\n\r\n /**\r\n * (EXPERIMENTAL)\r\n * Whether to enable flow control handling (false by default). If enabled a message of `flowControlPause`\r\n * will pause the socket and thus blocking the child program execution due to buffer back pressure.\r\n * A message of `flowControlResume` will resume the socket into flow mode.\r\n * For performance reasons only a single message as a whole will match (no message part matching).\r\n * If flow control is enabled the `flowControlPause` and `flowControlResume` messages are not forwarded to\r\n * the underlying pseudoterminal.\r\n */\r\n handleFlowControl?: boolean;\r\n\r\n /**\r\n * (EXPERIMENTAL)\r\n * The string that should pause the pty when `handleFlowControl` is true. Default is XOFF ('\\x13').\r\n */\r\n flowControlPause?: string;\r\n\r\n /**\r\n * (EXPERIMENTAL)\r\n * The string that should resume the pty when `handleFlowControl` is true. Default is XON ('\\x11').\r\n */\r\n flowControlResume?: string;\r\n}\r\n\r\nexport interface IPtyForkOptions extends IBasePtyForkOptions {\r\n /**\r\n * Security warning: use this option with great caution,\r\n * as opened file descriptors with higher privileges might leak to the child program.\r\n */\r\n uid?: number;\r\n gid?: number;\r\n}\r\n\r\nexport interface IWindowsPtyForkOptions extends IBasePtyForkOptions {\r\n /**\r\n * Whether to use the ConPTY system on Windows. When this is not set, ConPTY will be used when\r\n * the Windows build number is >= 18309 (instead of winpty). Note that ConPTY is available from\r\n * build 17134 but is too unstable to enable by default.\r\n *\r\n * This setting does nothing on non-Windows.\r\n */\r\n useConpty?: boolean;\r\n\r\n /**\r\n * Whether to use PSEUDOCONSOLE_INHERIT_CURSOR in conpty.\r\n * @see https://docs.microsoft.com/en-us/windows/console/createpseudoconsole\r\n */\r\n conptyInheritCursor?: boolean;\r\n}\r\n\r\n/**\r\n * An interface representing a pseudoterminal, on Windows this is emulated via the winpty library.\r\n */\r\nexport interface IPty {\r\n /**\r\n * The process ID of the outer process.\r\n */\r\n readonly pid: number;\r\n\r\n /**\r\n * The column size in characters.\r\n */\r\n readonly cols: number;\r\n\r\n /**\r\n * The row size in characters.\r\n */\r\n readonly rows: number;\r\n\r\n /**\r\n * The title of the active process.\r\n */\r\n readonly process: string;\r\n\r\n /**\r\n * (EXPERIMENTAL)\r\n * Whether to handle flow control. Useful to disable/re-enable flow control during runtime.\r\n * Use this for binary data that is likely to contain the `flowControlPause` string by accident.\r\n */\r\n handleFlowControl: boolean;\r\n\r\n /**\r\n * Adds an event listener for when a data event fires. This happens when data is returned from\r\n * the pty.\r\n * @returns an `IDisposable` to stop listening.\r\n */\r\n readonly onData: IEvent<string>;\r\n\r\n /**\r\n * Adds an event listener for when an exit event fires. This happens when the pty exits.\r\n * @returns an `IDisposable` to stop listening.\r\n */\r\n readonly onExit: IEvent<{ exitCode: number, signal?: number }>;\r\n\r\n /**\r\n * Resizes the dimensions of the pty.\r\n * @param columns The number of columns to use.\r\n * @param rows The number of rows to use.\r\n */\r\n resize(columns: number, rows: number): void;\r\n\r\n /**\r\n * Clears the pty's internal representation of its buffer. This is a no-op\r\n * unless on Windows/ConPTY. This is useful if the buffer is cleared on the\r\n * frontend in order to synchronize state with the backend to avoid ConPTY\r\n * possibly reprinting the screen.\r\n */\r\n clear(): void;\r\n\r\n /**\r\n * Writes data to the pty.\r\n * @param data The data to write.\r\n */\r\n write(data: string): void;\r\n\r\n /**\r\n * Kills the pty.\r\n * @param signal The signal to use, defaults to SIGHUP. This parameter is not supported on\r\n * Windows.\r\n * @throws Will throw when signal is used on Windows.\r\n */\r\n kill(signal?: string): void;\r\n\r\n /**\r\n * Pauses the pty for customizable flow control.\r\n */\r\n pause(): void;\r\n\r\n /**\r\n * Resumes the pty for customizable flow control.\r\n */\r\n resume(): void;\r\n}\r\n\r\n/**\r\n * An object that can be disposed via a dispose function.\r\n */\r\nexport interface IDisposable {\r\n dispose(): void;\r\n}\r\n\r\n/**\r\n * An event that can be listened to.\r\n * @returns an `IDisposable` to stop listening.\r\n */\r\nexport interface IEvent<T> {\r\n (listener: (e: T) => any): IDisposable;\r\n}\r\n\r\nexport type ArgvOrCommandLine = string[] | string;\r\n\r\nclass TauriPty implements IPty, IDisposable {\r\n pid: number;\r\n cols: number;\r\n rows: number;\r\n process: string;\r\n handleFlowControl: boolean;\r\n\r\n private _exitted: boolean;\r\n private _init: Promise<void>;\r\n\r\n private _onData = new EventEmitter2<string>();\r\n private _onExit = new EventEmitter2<{ exitCode: number; signal?: number | undefined; }>();\r\n\r\n constructor(file: string, args?: ArgvOrCommandLine, opt?: IWindowsPtyForkOptions) {\r\n args = typeof args === 'string' ? [args] : args ?? []; // Convert args to string[] anyways.\r\n const invokeArgs = {\r\n file, args,\r\n termName: opt?.name ?? 'Terminal',\r\n cols: opt?.cols ?? null,\r\n rows: opt?.rows ?? null,\r\n cwd: opt?.cwd ?? null,\r\n env: opt?.env ?? {},\r\n encoding: opt?.encoding ?? null,\r\n handleFlowControl: opt?.handleFlowControl ?? null,\r\n flowControlPause: opt?.flowControlPause ?? null,\r\n flowControlResume: opt?.flowControlResume ?? null,\r\n };\r\n this._init = invoke<number>('plugin:pty|spawn', invokeArgs).then(pid => {\r\n this._exitted = false;\r\n this.pid = pid;\r\n this.readData();\r\n });\r\n }\r\n dispose(): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n public get onData(): IEvent<string> { return this._onData.event; }\r\n public get onExit(): IEvent<{ exitCode: number; signal?: number | undefined; }> { return this._onExit.event; }\r\n\r\n resize(columns: number, rows: number): void {\r\n this.cols = columns;\r\n this.rows = rows;\r\n this._init.then(() =>\r\n invoke('plugin:pty|resize', { pid: this.pid, cols: columns, rows }).catch(e => {\r\n console.error('Resize error: ', e);\r\n this.errorCheck();\r\n })\r\n );\r\n }\r\n clear(): void {\r\n console.warn(\"clear is un implemented!\")\r\n }\r\n write(data: string): void {\r\n this._init.then(() =>\r\n invoke('plugin:pty|write', { pid: this.pid, data }).catch(e => {\r\n console.error('Writing error: ', e);\r\n this.errorCheck();\r\n })\r\n );\r\n }\r\n kill(signal?: string | undefined): void {\r\n this._init.then(() =>\r\n invoke<string>('plugin:pty|kill', { pid: this.pid })\r\n );\r\n }\r\n pause(): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n resume(): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n\r\n private async readData() {\r\n await this._init;\r\n try {\r\n for (; ;) {\r\n const data = await invoke<string>('plugin:pty|read', { pid: this.pid });\r\n this._onData.fire(data);\r\n }\r\n } catch (e: any) {\r\n this.errorCheck();\r\n if (typeof e === 'string' && e.includes('EOF')) {\r\n return;\r\n }\r\n console.error('Reading error: ', e);\r\n }\r\n }\r\n\r\n private async errorCheck() {\r\n if (this._exitted) {\r\n return;\r\n }\r\n try {\r\n const exitCode = await invoke<number | null>('plugin:pty|exitstatus', { pid: this.pid })\r\n if (exitCode != null) {\r\n this._exitted = true;\r\n this._onExit.fire({ exitCode });\r\n }\r\n } catch (e: any) {\r\n console.error(e)\r\n }\r\n }\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAca,aAAa,CAAA;AAA1B,IAAA,WAAA,GAAA;QACU,IAAU,CAAA,UAAA,GAAmB,EAAE,CAAC;KAgCzC;AA7BC,IAAA,IAAW,KAAK,GAAA;AACd,QAAA,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;AAChB,YAAA,IAAI,CAAC,MAAM,GAAG,CAAC,QAAuB,KAAI;AACxC,gBAAA,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/B,gBAAA,MAAM,UAAU,GAAG;oBACjB,OAAO,EAAE,MAAK;AACZ,wBAAA,KAAK,IAAI,CAAC,GAAG,C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AAA,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;oBAC5C,OAAO;iBACV;AACD,gBAAA,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;aACvC;SACJ,CAAA,CAAA;AAAA,KAAA;IAEa,UAAU,GAAA;;AACpB,YAAA,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACf,OAAO;aACV;AACD,YAAA,IAAI;AACA,gBAAA,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAgB,uBAAuB,EAAE,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAA;AACxF,gBAAA,IAAI,QAAQ,IAAI,IAAI,EAAE;AAClB,oBAAA,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;oBACrB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC;iBACnC;aACJ;YAAC,OAAO,CAAM,EAAE;AACb,gBAAA,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;aACnB;SACJ,CAAA,CAAA;AAAA,KAAA;AACJ;;;;"}
package/package.json CHANGED
@@ -1,33 +1,33 @@
1
- {
2
- "name": "tauri-pty",
3
- "version": "0.0.5",
4
- "description": "API package for tauri-plugin-pty",
5
- "repository": {
6
- "type": "git",
7
- "url": "https://github.com/Tnze/tauri-plugin-pty.git"
8
- },
9
- "homepage": "https://github.com/Tnze/tauri-plugin-pty",
10
- "keywords": [
11
- "tauri-plugin"
12
- ],
13
- "type": "module",
14
- "scripts": {
15
- "build": "rollup -c"
16
- },
17
- "files": [
18
- "dist",
19
- "README.md"
20
- ],
21
- "module": "dist/index.es.js",
22
- "types": "dist/types/index.d.ts",
23
- "author": "Tnze",
24
- "license": "MIT",
25
- "dependencies": {
26
- "@tauri-apps/api": "^1.5.3"
27
- },
28
- "devDependencies": {
29
- "rollup": "^4.9.1",
30
- "rollup-plugin-typescript2": "^0.36.0",
31
- "typescript": "^5.3.3"
32
- }
1
+ {
2
+ "name": "tauri-pty",
3
+ "version": "0.0.7",
4
+ "description": "API package for tauri-plugin-pty",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/Tnze/tauri-plugin-pty.git"
8
+ },
9
+ "homepage": "https://github.com/Tnze/tauri-plugin-pty",
10
+ "keywords": [
11
+ "tauri-plugin"
12
+ ],
13
+ "type": "module",
14
+ "scripts": {
15
+ "build": "rollup -c"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "README.md"
20
+ ],
21
+ "module": "dist/index.es.js",
22
+ "types": "dist/types/index.d.ts",
23
+ "author": "Tnze",
24
+ "license": "MIT",
25
+ "dependencies": {
26
+ "@tauri-apps/api": "^1.5.3"
27
+ },
28
+ "devDependencies": {
29
+ "rollup": "^4.9.1",
30
+ "rollup-plugin-typescript2": "^0.36.0",
31
+ "typescript": "^5.3.3"
32
+ }
33
33
  }