@travetto/terminal 3.1.0-rc.1 → 3.1.1
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 +1 -1
- package/src/query.ts +2 -3
package/package.json
CHANGED
package/src/query.ts
CHANGED
|
@@ -8,8 +8,7 @@ import { RGB, TermCoord, TermQuery } from './types';
|
|
|
8
8
|
const to256 = (x: string): number => Math.trunc(parseInt(x, 16) / (16 ** (x.length - 2)));
|
|
9
9
|
const COLOR_RESPONSE = /(?<r>][0-9a-f]+)[/](?<g>[0-9a-f]+)[/](?<b>[0-9a-f]+)[/]?(?<a>[0-9a-f]+)?/i;
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
const queryScript = (function (...bytes) {
|
|
11
|
+
const queryScript = (function (...bytes: number[]): void {
|
|
13
12
|
const i = process.stdin;
|
|
14
13
|
i.setRawMode(true);
|
|
15
14
|
i.resume();
|
|
@@ -24,7 +23,7 @@ const queryScript = (function (...bytes) {
|
|
|
24
23
|
|
|
25
24
|
const runQuery = async (input: tty.ReadStream, output: tty.WriteStream, code: string): Promise<Buffer> => {
|
|
26
25
|
const script = queryScript.toString().replaceAll('\'', '"').replaceAll('\n', '');
|
|
27
|
-
const fullScript = `(${script})(${code.split('').map(x => x.charCodeAt(0))})
|
|
26
|
+
const fullScript = `(${script})(${code.split('').map(x => x.charCodeAt(0))})`;
|
|
28
27
|
const proc = spawn(process.argv0, ['-e', fullScript], { stdio: [input, output, 2, 'ipc'], detached: true });
|
|
29
28
|
const text = await new Promise<string>((res, rej) => {
|
|
30
29
|
proc.once('message', res);
|