This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

Update readme with interactive stuff

Nathan Herald (Mar 18, 2026, 8:16 PM +0100) 4bf25b21 bf46807d

+48 -13
+48 -13
README.md
··· 13 13 npm link 14 14 ``` 15 15 16 + Or install directly from GitHub: 17 + 18 + ```sh 19 + npm install -g github:myobie/pty 20 + ``` 21 + 22 + Requires Node.js. Works on macOS and Linux. 23 + 16 24 ## Usage 25 + 26 + Run `pty` with no arguments to launch the interactive session manager: 27 + 28 + ``` 29 + ╭─ pty ────────────────────────────────────────────────────────────╮ 30 + │ │ 31 + │ Filter: (type to filter) │ 32 + │ │ 33 + │ ● webserver ~/projects/myapp node server.js │ 34 + │ ● worker ~/projects/myapp npm run worker │ 35 + │ ● devlog ~/projects/myapp tail -f log/dev.log │ 36 + │ ○ migrations (exited 2h ago) npm run migrate │ 37 + │ + Create new session... │ 38 + │ │ 39 + ╰──────────────────────────────────────────────────────────────────╯ 40 + ↑↓ select ⏎ attach q quit 41 + ``` 42 + 43 + Arrow keys to navigate, type to filter, Enter to attach, `q` to quit. Creating a new session walks through a directory picker and name/command prompt. 44 + 45 + When you detach from a session entered via the interactive list (`Ctrl+\`), you return to the list. The session keeps running in the background. 46 + 47 + ### Commands 17 48 18 49 ```sh 19 - pty run myserver -- node server.js # start a session and attach 20 - pty run -d myserver -- node server.js # start in the background 50 + pty # interactive session manager 51 + pty run myserver -- node server.js # start a session and attach 52 + pty run -d myserver -- node server.js # start in the background 53 + pty run -a myserver -- node server.js # create or attach if already running 21 54 22 - pty # no args runs list 23 - pty list # show active sessions 55 + pty list # show active sessions 56 + pty list --json # show as JSON 24 57 25 - pty attach myserver # reconnect 26 - pty peek myserver # print current screen and exit 27 - pty peek -f myserver # follow output read-only 58 + pty attach myserver # reconnect to a session 59 + pty attach -r myserver # reconnect, auto-restart if exited 60 + pty peek myserver # print current screen and exit 61 + pty peek --plain myserver # print as plain text (no ANSI) 62 + pty peek -f myserver # follow output read-only 28 63 29 - pty send myserver "hello" # send text (no implicit newline) 30 - pty send myserver $'hello\n' # send text with newline (shell syntax) 64 + pty send myserver "hello" # send text (no implicit newline) 65 + pty send myserver $'hello\n' # send text with newline (shell syntax) 31 66 pty send myserver --seq "git status" --seq key:return # ordered sequence 32 - pty send myserver --seq key:ctrl+c # send control keys 67 + pty send myserver --seq key:ctrl+c # send control keys 33 68 34 - pty restart myserver # restart an exited session 35 - pty kill myserver # terminate a session 69 + pty restart myserver # restart an exited session 70 + pty kill myserver # terminate a session 36 71 ``` 37 72 38 73 Detach with `Ctrl+\`. (Press `Ctrl+\` twice to send it through to the process.) ··· 40 75 ## Tab Completion 41 76 42 77 ```sh 43 - brew install bash-completion # required for bash; zsh works out of the box 78 + brew install bash-completion # required for bash on macOS; zsh works out of the box 44 79 npm run install-completions 45 80 ``` 46 81