fix(tnotify): write to client TTY and survive PTY destruction - #8
Conversation
The tnotify watcher would silently die (SIGHUP on PTY destruction) and leave a stale PID file, causing notifications to queue up until a new pane was opened. Three changes: - tnotify: write raw OSC 99 to the tmux client TTY instead of DCS passthrough to /dev/tty, decoupling delivery from the originating pane - tnotify-watch: add HUP to the signal cleanup handler - config.fish: start the watcher with nohup to survive PTY destruction
There was a problem hiding this comment.
Pull request overview
Improves reliability of tnotify/tnotify-watch notifications in tmux-over-SSH by decoupling notification delivery from the originating pane鈥檚 PTY and tightening watcher lifecycle handling.
Changes:
- Update
tnotifyto write the raw OSC 99 escape sequence directly to a tmux client TTY (#{client_tty}) instead of using tmux DCS passthrough to/dev/tty. - Add SIGHUP handling to the
tnotify-watchcleanup handler so stale PID files get removed on HUP-driven exits. - Start the watcher via
nohupfromconfig.fishso it survives PTY destruction.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| roles/fish/files/fish/functions/tnotify.fish | Redirect notification escape output to a tmux client TTY instead of pane /dev/tty passthrough. |
| roles/fish/files/fish/functions/tnotify-watch.fish | Ensure PID cleanup runs on SIGHUP in addition to INT/TERM/process-exit. |
| roles/fish/files/fish/config.fish | Launch watcher under nohup to avoid SIGHUP termination when the spawning PTY disappears. |
馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
馃挕 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
#{client_tty}) instead of DCS passthrough to/dev/tty, so notification delivery isn't tied to the pane that spawned the watcherHUPto the signal cleanup handler so the PID file is removed if the watcher receives SIGHUPnohupto survive PTY destructionContext
Notifications would stop delivering over SSH and then burst all at once when opening a new tmux pane. Root cause: the watcher process died from SIGHUP (when its originating pane's PTY was destroyed), left a stale PID file, and notifications queued up until a new pane triggered a watcher restart.
Test plan
~/.cache/tnotify.pid