···66- Set `PTY_SESSION` env var in child processes so they can detect they're inside a pty session
77- Add CPU and memory usage to `pty stats` (child process and daemon, via `ps`)
88- Add process PIDs to `pty stats` output
99+- Add terminal event logging — sessions capture bell, title changes, desktop notifications (OSC 9/99/777), focus requests, and cursor visibility transitions to a per-session JSONL file
1010+- Add `pty events <name>` command to follow events in real-time (like `tail -f`)
1111+- Add `pty events --all` to follow events from all sessions, interleaved
1212+- Add `pty events --recent <name>` to show recent events and exit
1313+- Add `pty events --json` for machine-readable JSONL output
1414+- Deduplicate consecutive identical title change events
1515+- Event files auto-truncate at 1,000 lines (keeping most recent 500)
1616+- Event file I/O is fully async (non-blocking write queue)
1717+- Event files are cleaned up with the existing 24-hour dead session TTL
9181019## 0.4.1
1120
+3-2
completions/pty.bash
···66 COMPREPLY=()
77 cur="${COMP_WORDS[COMP_CWORD]}"
88 prev="${COMP_WORDS[COMP_CWORD-1]}"
99- commands="run attach peek send kill list restart help"
99+ commands="run attach peek send kill list restart events help"
10101111 # Complete subcommand
1212 if [[ ${COMP_CWORD} -eq 1 ]]; then
···16161717 # Complete session names for commands that take them
1818 case "${COMP_WORDS[1]}" in
1919- attach|a|peek|send|kill|restart)
1919+ attach|a|peek|send|kill|restart|events)
2020 local session_dir="${PTY_SESSION_DIR:-${HOME}/.local/state/pty}"
2121 if [[ -d "${session_dir}" ]]; then
2222 local names
···3030 peek) COMPREPLY=($(compgen -W "--follow -f --plain" -- "${cur}")) ;;
3131 send) COMPREPLY=($(compgen -W "--seq --with-delay" -- "${cur}")) ;;
3232 restart) COMPREPLY=($(compgen -W "--yes -y" -- "${cur}")) ;;
3333+ events) COMPREPLY=($(compgen -W "--all --recent --json" -- "${cur}")) ;;
3334 esac
3435 fi
3536 ;;
+7
completions/pty.fish
···3737complete -c pty -n __pty_needs_command -a kill -d 'Kill or remove a session'
3838complete -c pty -n __pty_needs_command -a list -d 'List active sessions'
3939complete -c pty -n __pty_needs_command -a restart -d 'Restart a session'
4040+complete -c pty -n __pty_needs_command -a events -d 'Follow terminal events from sessions'
4041complete -c pty -n __pty_needs_command -a help -d 'Show usage information'
41424243# run: flags and file completion for the command argument
···6566# restart: session names and flags
6667complete -c pty -n '__pty_using_command restart' -a '(__pty_sessions)' -d 'Session'
6768complete -c pty -n '__pty_using_command restart' -s y -l yes -d 'Skip confirmation'
6969+7070+# events: session names and flags
7171+complete -c pty -n '__pty_using_command events' -a '(__pty_sessions)' -d 'Session'
7272+complete -c pty -n '__pty_using_command events' -l all -d 'Follow events from all sessions'
7373+complete -c pty -n '__pty_using_command events' -l recent -d 'Show recent events and exit'
7474+complete -c pty -n '__pty_using_command events' -l json -d 'Output raw JSONL'
68756976# list: flags
7077complete -c pty -n '__pty_using_command list' -l json -d 'Output as JSON'
+8
completions/pty.zsh
···2323 'list:List active sessions'
2424 'ls:List active sessions'
2525 'restart:Restart an exited session'
2626+ 'events:Follow terminal events from sessions'
2627 'help:Show usage information'
2728 )
2829···5960 restart)
6061 _arguments \
6162 '(-y --yes)'{-y,--yes}'[Skip confirmation for running sessions]' \
6363+ '1:session:_pty_sessions'
6464+ ;;
6565+ events)
6666+ _arguments \
6767+ '--all[Follow events from all sessions]' \
6868+ '--recent[Show recent events and exit]' \
6969+ '--json[Output raw JSONL]' \
6270 '1:session:_pty_sessions'
6371 ;;
6472 list|ls)
+1-1
flake.nix
···29293030 # Generated from package-lock.json.
3131 # Regenerate with: nix run nixpkgs#prefetch-npm-deps -- package-lock.json
3232- npmDepsHash = "sha256-jMQIzAnSvoUfZ6nUOt0a821HVuGApE/1vsGlOBzFZOc=";
3232+ npmDepsHash = "sha256-RpVlZ+xn3KY2xEgyDNqEe9/B6IOV3wX+MgGjXaNttDA=";
33333434 # node-pty has native code that needs these at build time
3535 nativeBuildInputs = with pkgs; [ python3 pkg-config ];