Skip to content

feat(wsl): advertise the binary path and hold the probe cache [1]#151

Open
AbysmalBiscuit wants to merge 2 commits into
mathix420:masterfrom
AbysmalBiscuit:fix/wsl-probe-cache-preserve
Open

feat(wsl): advertise the binary path and hold the probe cache [1]#151
AbysmalBiscuit wants to merge 2 commits into
mathix420:masterfrom
AbysmalBiscuit:fix/wsl-probe-cache-preserve

Conversation

@AbysmalBiscuit

Copy link
Copy Markdown
Contributor

Two independent fixes to the WSL boundary, both about a shell inside a distro
being able to talk back to the instance that spawned it.

fix(wsl): keep the last probe when the helper is briefly down

The probe poller collapsed three different outcomes into the same None:
a genuine "no foreground TUI", a missing client, and a transport error.
Any transient helper outage therefore blanked every session's cached
foreground command name, and while the helper sat in its respawn cooldown
the cache stayed blank — disabling FocusLeft/FocusRight passthrough for
a still-running nvim or tmux until the helper came back on its own.

The cache is now overwritten only on a definitive reply. A missing client or
a probe error leaves the last-known value in place. client() is still
called every tick, so a cooled-down helper keeps getting nudged back up.

feat(ipc): advertise the binary path to WSL shells

A shell inside a distro could already find a running instance through
ALACRITREE_SOCKET, but had no way to invoke the CLI: the Windows image is
reachable over interop yet is not on the distro's $PATH, so callers had to
hardcode a path or guess at one.

The running image is now exported as ALACRITREE_EXE and listed in WSLENV
with /p — the flag that has WSL rewrite the value into the distro's view of
the drive, honouring whatever automount root that distro uses instead of
assuming /mnt. It is the only one of the three exported variables that
carries a conversion flag; a pipe name and a session id are not paths. A user
who already lists ALACRITREE_EXE themselves keeps their own spelling.

Testing

cargo test -p alacritree — 477 pass. New coverage:

  • ipc::tests::wslenv_lists_the_exe_path_for_conversion — the /p flag is
    applied, and an existing user entry is left alone.
  • ipc::tests::a_client_reaches_the_listener_it_advertises now also asserts
    ALACRITREE_EXE matches current_exe().

The existing wslenv_gains_* tests were updated for the third variable.

AbysmalBiscuit and others added 2 commits July 23, 2026 17:43
The probe poller collapsed a missing client and a transport error into
the same None it writes for a genuine "no foreground TUI" reply, so any
transient helper outage blanked every session's cached foreground name.
While the helper sat in its respawn cooldown the cache stayed None,
disabling FocusLeft/FocusRight passthrough for a still-running nvim/tmux
until the helper came back.

Overwrite the cache only on a definitive reply; on a missing client or a
probe error, leave the last-known value. client() is still called every
tick, so a cooled-down helper keeps getting nudged back up.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
A shell inside a distro can already find a running instance through
ALACRITREE_SOCKET, but had no way to invoke the CLI: the Windows image is
reachable over interop yet is not on the distro's $PATH, so callers had
to hardcode a path or guess at one.

Export the running image as ALACRITREE_EXE and list it in WSLENV with
`/p` — the flag that has WSL rewrite the value into the distro's view of
the drive, honouring whatever automount root that distro uses instead of
assuming /mnt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@AbysmalBiscuit AbysmalBiscuit changed the title feat(wsl): advertise the binary path and hold the probe cache feat(wsl): advertise the binary path and hold the probe cache [1] Jul 25, 2026
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