Skip to content

Commit

Permalink
Switch to @lydell/node-pty
Browse files Browse the repository at this point in the history
  • Loading branch information
lydell committed Mar 19, 2024
1 parent 4fa3dc2 commit 9f61522
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 20 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ If you want a shell, you could do something like this: `run-pty % bash -c 'npm i

## Credits

- [microsoft/node-pty] does all the heavy lifting of running the commands.
- [microsoft/node-pty] does all the heavy lifting of running the commands. But it’s actually the fork [@lydell/node-pty] that is used. The only difference is that it has prebuilt binaries.
- [apiel/run-screen] was the inspiration for this tool.

## iTerm2 flicker
Expand All @@ -230,6 +230,7 @@ run-pty tries to avoid clearing the screen and only redraw lines that have chang

[MIT](LICENSE).

[@lydell/node-pty]: https://github.com/lydell/node-pty
[apiel/run-screen]: https://github.com/apiel/run-screen
[concurrently]: https://github.com/kimmobrunfeldt/concurrently
[gnu parallel]: https://www.gnu.org/software/parallel/
Expand Down
97 changes: 83 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"xterm"
],
"dependencies": {
"node-pty": "^1.0.0",
"@lydell/node-pty": "^1.0.0",
"tiny-decoders": "^23.0.0"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions run-pty.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
const fs = require("fs");
const path = require("path");
const os = require("os");
const pty = require("node-pty");
const pty = require("@lydell/node-pty");
const Codec = require("tiny-decoders");

/**
* @typedef {
| { tag: "Waiting" }
| { tag: "Running", terminal: import("node-pty").IPty }
| { tag: "Killing", terminal: import("node-pty").IPty, slow: boolean, lastKillPress: number | undefined, restartAfterKill: boolean }
| { tag: "Running", terminal: import("@lydell/node-pty").IPty }
| { tag: "Killing", terminal: import("@lydell/node-pty").IPty, slow: boolean, lastKillPress: number | undefined, restartAfterKill: boolean }
| { tag: "Exit", exitCode: number, wasKilled: boolean }
} Status
*
Expand Down
2 changes: 1 addition & 1 deletion test/run-pty.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const {

/**
* @param {{ pid: number }} init
* @returns {import("node-pty").IPty}
* @returns {import("@lydell/node-pty").IPty}
*/
function fakeTerminal({ pid }) {
return {
Expand Down

0 comments on commit 9f61522

Please sign in to comment.