Skip to content

Add watch keys to switch the inner target - #14

Merged
richardcocks merged 3 commits into
mainfrom
watch-target-keys
Aug 22, 2026
Merged

richardcocks merged 3 commits into
mainfrom
watch-target-keys

Conversation

@richardcocks

Copy link
Copy Markdown
Owner

While watching, j reruns on JavaScript, l on Erlang and k toggles between the two. The watcher already passed --target to every inner run explicitly and read nothing target-specific back, so the target becomes loop state: inner_args is split into parse_watch_args and build_inner (and kept as their composition for the existing tests), and wait_for_change returns the target the next cycle should use. The run banner names the target and the status line lists the keys.

On the JavaScript host the keys are single keypresses through the existing key worker (commands 4/5/6). The Erlang host gains a real key channel for them: the line-based quit listener now knows the watcher's pid and posts {vouch_watch_key, N} for j/l/k + Enter, which take_pending_key/0 drains with a zero-timeout receive, so on the BEAM they work like q + Enter does.

While watching, `j` reruns on JavaScript, `l` on Erlang and `k` toggles
between the two. The watcher already passed `--target` to every inner
run explicitly and read nothing target-specific back, so the target
becomes loop state: `inner_args` is split into `parse_watch_args` and
`build_inner` (and kept as their composition for the existing tests),
and `wait_for_change` returns the target the next cycle should use. The
run banner names the target and the status line lists the keys.

On the JavaScript host the keys are single keypresses through the
existing key worker (commands 4/5/6). The Erlang host gains a real key
channel for them: the line-based quit listener now knows the watcher's
pid and posts `{vouch_watch_key, N}` for `j`/`l`/`k` + Enter, which
`take_pending_key/0` drains with a zero-timeout receive, so on the BEAM
they work like `q` + Enter does.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@richardcocks
richardcocks merged commit 100df66 into main Aug 22, 2026
3 checks passed
@richardcocks
richardcocks deleted the watch-target-keys branch August 22, 2026 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant