pterm 0.0.11 → 0.0.13

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.
Files changed (3) hide show
  1. package/index.js +10 -0
  2. package/package.json +1 -1
  3. package/script.js +6 -2
package/index.js CHANGED
@@ -37,6 +37,16 @@ const util = new Util();
37
37
  }
38
38
  } catch (e) {
39
39
  }
40
+ } else if (app === "script") {
41
+ try {
42
+ let r = await fetch("http://localhost:42000/pinokio/version").then((res) => {
43
+ return res.json()
44
+ })
45
+ if (r.script) {
46
+ console.log(`${r.script}`)
47
+ }
48
+ } catch (e) {
49
+ }
40
50
  }
41
51
  }
42
52
  } else if (cmd === "filepicker") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pterm",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
package/script.js CHANGED
@@ -2,7 +2,9 @@ const path = require('path')
2
2
  const RPC = require('./rpc')
3
3
  class Script {
4
4
  listen(onKey) {
5
- process.stdin.setRawMode(true);
5
+ if (process.stdin.isTTY) {
6
+ process.stdin.setRawMode(true);
7
+ }
6
8
  process.stdin.resume();
7
9
  process.stdin.setEncoding('utf8');
8
10
 
@@ -17,7 +19,9 @@ class Script {
17
19
  };
18
20
 
19
21
  const cleanup = () => {
20
- process.stdin.setRawMode(false);
22
+ if (process.stdin.isTTY) {
23
+ process.stdin.setRawMode(false);
24
+ }
21
25
  process.stdin.pause();
22
26
  process.stdin.off('data', handler);
23
27
  };