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 - npm Package Versions

13

4.0.0

Diff

Changelog

Source

Version 4.0.0 (2022-08-28)

  • Removed: NDJSON support. I used to have a bash script that generated JSON for run-pty in a hacky way, one line at a time. I’ve since re-written that script (using Node.js) and it became so much better! So I don’t need this feature myself anymore, and also realized that it is kind of an anti-feature: It’s better to write good scripts that generate JSON in a nice way! This change also allows for configuring more than the commands in the future.

  • Fixed: j, k and o now work properly. run-pty used to have secret Vim key bindings, that I had forgotten about. Recently I added so many commands to run in a project that I got all the way down to o for the command labels. I then noticed that pressing for example j didn’t focus that command as expected – instead it moved the selection down, as if I had pressed the down arrow key. That’s because j means down in Vim, while k means up, and o was used as an alternative to Enter. Adding those back in the day I didn’t think about that they would conflict with the command labels. Anyway, with this release those secret Vim key bindings are gone, solving the problem.

  • Added: The --auto-exit flag. This new flag is for conveniently running a couple of commands in parallel and get to know once they are done.

    run-pty --auto-exit % npm ci % dotnet restore && node build.js
    

    See the readme for more information!

  • Improved: Output on Windows.

    • Windows Terminal is now detected, because it supports emojis and a few more ANSI escape codes than the old cmd.exe. So Windows Terminal users now get nicer-looking output!

    • Fixed an issue where output could be cut off. For example, run-pty % ping localhost many times printed “eply” instead of “Reply”.

    • The keyboard shortcuts are now visible at the bottom of the command output in more cases. Well, at least in Windows Terminal. In cmd.exe, the keyboard shortcuts now only show up if the last line of output is empty. Either way, in both cases I managed to find a workaround for a “conpty” behavior that previously caused the keyboard shortcuts not to show up where they would have on macOS or Linux.

      (The reason the keyboard shortcuts are only shown when the command output ends with an empty line is because cmd.exe simply does not seem to support the ANSI escape code needed for a non-empty line. I did not know that before – that’s why some output was cut off sometimes as mentioned before. Oh, and which ANSI escape code is that you wonder? Well, one can use \f or \x1BD. The former – which run-pty used to use – is supported on most macOS and Linux Terminals, the latter is supported in Windows Terminal as well as on macOS and Linux, while neither is supported in cmd.exe.)

  • Changed: If using a JSON file where cwd and title are equal, run-pty used to not print the cwd. Now it does. I think that makes more sense.

  • Fixed: If you put color escape codes in title, and then use NO_COLOR, the color escape codes are now removed in the dashboard. Previously, they were only removed when focusing the command.

lydell
published 3.0.0 •

Changelog

Source

Version 3.0.0 (2022-03-06)

  • Added: The killAllSequence JSON field for commands. When you use “kill all” run-pty sends <kbd>ctrl+c</kbd> to all commands. However, not all commands exit when you do that. In such cases, you can use killAllSequence to specify what sequence of characters to the command to make it exit. This lets you cleanly exit commands, rather than double pressing <kbd>ctrl+c</kbd> which force kills them.
  • Improved: Showing the keyboard shortcuts at the bottom of commands is now much more reliable. Instead of using complicated and fragile home grown regex and string slicing approaches, run-pty now uses the “save cursor” and “restore cursor” ANSI escapes codes which seem to exist for this very use case. For example, this fixes problems where background colors could “bleed” into other lines, or parts of the output became duplicated.
  • Improved: ANSI escape codes allow programs to do things like changing colors or moving the cursor. There are also a few codes that work a little bit differently. When written, they don’t cause a state change. Instead, they cause the terminal to respond with information (in the form of other escape codes) on stdin. I’ve learned that run-pty needs to handle these differently. When you switch the focused command in run-pty, it can simply re-print the entire history of the command, including color escape codes which will work just fine. However, the codes that request a response should not be repeated like that, because the program might not be in a state where it expects a response anymore. run-pty now handles a few such escape codes, by making sure they only happen once and immediately. This fixes a problem where Vim would receive some “crap input” every time you switched from the dashboard to Vim. Also, run-pty already had some ad-hoc code related to this as a Windows special case. That’s now replaced with a more general solution.

Note: There are technically no breaking changes. You should be able to update without making any further changes. But since all the ANSI escape code stuff is pretty tricky, I’m bumping the major version so you can take the decision if you’re fine with potential issues right now. If anything, the rendering should be more stable than before, but just in case!

lydell
published 2.3.2 •

Changelog

Source

Version 2.3.2 (2021-05-20)

  • Fixed: cwd is now resolved (using path.resolve) before being passed to spawn. Previously, just passing cwd: "." could cause npm run not to find package.json.
lydell
published 2.3.1 •

Changelog

Source

Version 2.3.1 (2021-03-29)

  • Fixed: Running with an empty NDJSON file now just exits with status 0 instead of being an error, to match how a JSON file with [] works. This is useful when generating the NDJSON from a script and it sometimes produces no commands to run.
lydell
published 2.3.0 •

Changelog

Source

Version 2.3.0 (2021-02-25)

  • Fixed: <kbd>ctrl+c</kbd> now works just like in a regular terminal. Previously, run-pty sent a SIGHUP signal followed by SIGTERM to the command, because I thought that killing commands had to be handled specially. Turns out all I need to do is pass along the <kbd>ctrl+c</kbd> press to the command. This allows the command to handle <kbd>ctrl+c</kbd> in a custom way if it wants, and it will kill the entire process tree instead of just the top process.
  • Changed: Since <kbd>ctrl+c</kbd> is now sent to the command, it’s up to the command to actually exit then. Further key presses are now passed on to the command, including a second <kbd>ctrl+c</kbd>, which previously meant “force kill.” To force kill, double-press <kbd>ctrl+c</kbd>.
  • Added: You can now click commands to focus them in terminals that support mouse events.
  • Added: You can now use the arrow keys and <kbd>enter</kbd> to focus commands. (Vim-style keyboard shortcuts are available, too).
  • Added: You can now press <kbd>enter</kbd> in the dashboard to restart all exited commands (press <kdd>escape</kbd> to unselect first, if needed).
  • Changed: In focused commands, keyboard shortcuts are now always printed below the cursor, unless the command moves the cursor vertically or switches to the “alternate screen.”
  • Improved: The whole history of the command is no longer reprinted when you kill it. No more text flashing by.
  • Improved: History is cleared if the command clears the screen including the scrollback buffer. Many watchers clear the screen on each cycle. This means that focusing a long-running watcher command will now be faster and less text will flash by. This required having a separate history for the alternate screen.
  • Improved: Emoji indicators should now always be drawn using 2 character slots in the terminal, regardless of terminal and terminal bugs.
  • Changed: Exit code 130 is now marked with ⚪ instead of 🔴 since exit code 130 usually means exit via <kbd>ctrl+c</kbd>.
  • Fixed: Some line rendering weirdness at command startup on Windows.
lydell
published 2.3.0-beta.5 •

lydell
published 2.3.0-beta.4 •

lydell
published 2.3.0-beta.3 •

lydell
published 2.3.0-beta.2 •

lydell
published 2.3.0-beta.1 •

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