xshell 1.1.14 → 1.1.15

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 (2) hide show
  1. package/package.json +1 -1
  2. package/stdin.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
package/stdin.js CHANGED
@@ -5,8 +5,10 @@ import process from 'process';
5
5
  export function process_stdin(on_key, on_exit) {
6
6
  // https://stackoverflow.com/a/12506613/7609214
7
7
  let { stdin } = process;
8
- stdin.setRawMode(true);
9
- stdin.resume();
8
+ if (stdin.isTTY) {
9
+ stdin.setRawMode(true);
10
+ stdin.resume();
11
+ }
10
12
  stdin.setEncoding('utf-8');
11
13
  // on any data into stdin
12
14
  stdin.on('data', async (key) => {