fix: rename underscore-prefixed shell functions to avoid Claude shell snapshot filtering - #5
Open
bloatfan wants to merge 1 commit into
Open
fix: rename underscore-prefixed shell functions to avoid Claude shell snapshot filtering#5bloatfan wants to merge 1 commit into
bloatfan wants to merge 1 commit into
Conversation
…tering
Shell integration functions prefixed with `_` (zsh/bash) or `__` (fish)
are filtered out by Claude shell's environment snapshot mechanism, which
treats underscore-prefixed functions as private/zsh-completion internals.
Rename all internal helpers to remove the leading underscores:
zsh: _hitch_prompt_segment -> hitch_prompt_segment
_hitch_precmd -> hitch_precmd
_hitch_run -> hitch_dispatch
bash: _hitch_prompt_segment -> hitch_prompt_segment
_hitch_prompt_command -> hitch_prompt_command
_hitch_run -> hitch_dispatch
fish: __hitch_original_fish_prompt -> hitch_original_fish_prompt
__hitch_run -> hitch_dispatch
Local variables (_hitch_* / __hitch_*) are updated for consistency.
The upsert_marked_block mechanism ensures existing users get the new
names on the next `hitch setup` run — no manual migration needed.
User-facing commands (hitch, hitch-dev, unhitch) and the p10k
prompt_hitch() function are unchanged.
Co-Authored-By: Claude <noreply@anthropic.com>
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
Shell integration functions prefixed with
_(zsh/bash) or__(fish) are filtered out by Claude shell's environment snapshot mechanism. Claude shell treats underscore-prefixed functions as private/zsh-completion internals and excludes them from snapshots, which means hitch's internal helpers are invisible to the AI agent during a session.Solution
Rename all internal shell helpers to remove the leading underscores:
_hitch_prompt_segmenthitch_prompt_segment_hitch_precmdhitch_precmd_hitch_runhitch_dispatch_hitch_prompt_segmenthitch_prompt_segment_hitch_prompt_commandhitch_prompt_command_hitch_runhitch_dispatch__hitch_original_fish_prompthitch_original_fish_prompt__hitch_runhitch_dispatchLocal variables (
_hitch_*/__hitch_*) are also renamed tohitch_*for consistency.What stays unchanged
hitch,hitch-dev,unhitchprompt_hitch()Migration
No manual migration needed. The
upsert_marked_blockmechanism replaces the entire hitch block in the user's RC file on the nexthitch setuprun, so existing users get the new names automatically.🤖 Generated with Claude Code