Repository navigation
fix(envtools): load custom aliases and functions in tmux and nested shells - #575
Merged
aversini merged 1 commit intoJun 27, 2026
Conversation
…hells Custom aliases and functions were silently missing in tmux panes (and ssh sessions and plain sub-shells). The "already loaded" guard tested the exported EVTLS_RUNTIME_DIR, which is inherited by child processes even though shell functions and aliases are not — so a fresh shell wrongly skipped setup. Key the guard off EVTLS_LOADED, a non-exported sentinel whose lifetime matches the functions/aliases (persists across same-shell re-sourcing, never inherited by children). This removes the need for the VSCode-specific carve-out. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mveq2CrwNUF1eW8CRezpjJ
aversini
deleted the
fix_envtools_load_custom_aliases_and_functions_in_tmux_and_nested_shells
branch
June 27, 2026 14:48
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Envtools' custom aliases and functions were silently missing in tmux panes — and, by the same mechanism, in ssh sessions and plain sub-shells.
The "already loaded" guard at the top of
load.shtested the exportedEVTLS_RUNTIME_DIR. Exported variables are inherited by child processes, but shell functions and aliases are not. So a fresh shell (tmux pane, etc.) saw the inherited env var, concluded Envtools was already loaded, and returned early — leaving none of the aliases/functions defined. This is the same issue theVSCODE_CLI/VSC_TERMINALcarve-out was patching for VSCode terminals.Fix
Key the guard off
EVTLS_LOADED, a plain non-exported sentinel set at the end of a successful load. A non-exported variable persists across re-sourcing within the same shell (sosource ~/.zshrcstill no-ops, no double banner) but is never inherited by child shells — matching the actual lifetime of the functions/aliases. Any new shell now re-loads cleanly, and the VSCode-specific carve-out is no longer needed.Verification
EVTLS_RUNTIME_DIR, pane sources the real~/.zshrc):llalias +reloadfunction present. ✅FAIL); fixed code passes. ✅reloadstill bypasses the guard. ✅shellcheckclean. ✅🤖 Generated with Claude Code