Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Run several commands concurrently. Show output for one command at a time. Kill all at once.
run-pty
is a command line tool that lets you run several commands concurrently and interactively. Show output for one command at a time. Kill all at once. Nothing more, nothing less.
It’s like concurrently but the command outputs aren’t mixed, and you can restart commands individually and interact with them. I bet you can do the same with tmux if you – and your team mates – feel like installing and learning it. In bash
you can use command1 & command2
together with fg
, bg
, jobs
and ctrl+z to achieve a similar result, but run-pty tries to be easier to use, and cross-platform.
ctrl+z shows the dashboard, which gives you an overview of all your running commands and lets you switch between them.
ctrl+c kills commands.
A use case is running several watchers. Maybe one or two for frontend (webpack, Parcel, Sass), and one for backend (nodemon, or even some watcher for another programming language).
{
"scripts": {
"start": "run-pty % npm run frontend % npm run backend",
"frontend": "parcel watch index.html",
"backend": "nodemon server.js"
}
}
$ npm start
> @ start /Users/lydell/src/run-pty/demo
> run-pty % npm run frontend % npm run backend
➡️
[1] 🟢 pid 11084 npm run frontend
[2] 🟢 pid 11085 npm run backend
[1-2] focus command
[ctrl+c] kill all
➡️ 1 ️️➡️
🟢 npm run frontend
> @ frontend /Users/lydell/src/run-pty/demo
> parcel watch index.html --log-level 4
[9:51:27 AM]: Building...
[9:51:27 AM]: Building index.html...
[9:51:27 AM]: Built index.html...
[9:51:27 AM]: Producing bundles...
[9:51:27 AM]: Packaging...
[9:51:27 AM]: ✨ Built in 67ms.
[ctrl+c] kill
[ctrl+z] dashboard
▊
➡️ ctrl+c ➡️
🟢 npm run frontend
> @ frontend /Users/lydell/src/run-pty/demo
> parcel watch index.html --log-level 4
[9:51:27 AM]: Building...
[9:51:27 AM]: Building index.html...
[9:51:27 AM]: Built index.html...
[9:51:27 AM]: Producing bundles...
[9:51:27 AM]: Packaging...
[9:51:27 AM]: ✨ Built in 67ms.
⚪ npm run frontend
exit 0
[enter] restart
[ctrl+c] kill all
[ctrl+z] dashboard
➡️ ctrl+z ➡️
[1] ⚪ exit 0 npm run frontend
[2] 🟢 pid 11085 npm run backend
[1-2] focus command
[ctrl+c] kill all
➡️ ctrl+c ➡️
[1] ⚪ exit 0 npm run frontend
[2] ⚪ exit 0 npm run backend
$ ▊
npm install --save-dev run-pty
npx run-pty --help
iTerm2 has a bug where the window flickers when clearing the screen without GPU rendering: https://gitlab.com/gnachman/iterm2/-/issues/7677
GPU rendering seems to be enabled by default, as long as your computer is connected to power.
You can enable GPU rendering always by toggling “Preferences > General > Magic > GPU Rendering + Advanced GPU Settings… > Disable GPU rendering when disconnected from power.”
There might still be occasional flicker. Hopefully the iTerm2 developers will improve this some time. It does not happen in the standard Terminal app.
MIT.
Version 2.0.0 (2020-08-03)
This release features proper killing of commands and some UI tweaks.
When killing commands, run-pty used to send the SIGHUP signal (because it’s the default). This works fine for killing npm run
, but not make
. run-pty now first sends SIGHUP (which causes npm run
to exit less noisily), and then a more conventional SIGTERM (just like kill
, which successfully kills make
).
run-pty now also waits for its commands to actually exit before exiting itself. Commands might take a little while to exit – or might even get stuck doing so. Pressing <kbd>ctrl+c</kbd> a second time sends a SIGKILL signal to more forcefully kill commands.
If you try to kill
the run-pty process, it now also kills its subprocesses, and waits for them just like for <kbd>ctrl+c</kbd> as mentioned above. A second kill
causes SIGKILLs to be sent.
Similarly, in case of an unhandled exception run-pty now tries to clean up by SIGKILL-ing all commands.
The above means that run-pty now always exits in the dashboard view, so you can see how killing all commands go.
The UI has been tweaked to only show currently relevant keyboard shortcuts, which now also blend better into your terminal color scheme. The scrollback is cleared when switching views, making it easier to find the start of command output. The screen, colors and cursor are reset before drawing run-pty UI, so it cannot be messed up by commands.
Finally, at most one million characters of output are now remembered per command. After that, old output is removed. You can control this with the RUN_PTY_MAX_HISTORY
environment variable. This is important for commands that print an extraordinary amount of output, or if you leave run-pty running for a long time.
FAQs
Run several commands concurrently. Show output for one command at a time. Kill all at once.
The npm package run-pty receives a total of 3,831 weekly downloads. As such, run-pty popularity was classified as popular.
We found that run-pty demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.