Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

run-pty

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

run-pty

Run several commands concurrently. Show output for one command at a time. Kill all at once.

  • 2.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.7K
increased by28.51%
Maintainers
1
Weekly downloads
 
Created
Source

run-pty

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).

Example

{
  "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

$ ▊

Installation

npm install --save-dev run-pty

npx run-pty --help

Credits

iTerm2 flicker

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.

License

MIT.

Keywords

FAQs

Package last updated on 09 Sep 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc