Repository navigation
fix(shell): guard fish lazy-load wrapper against completion-mode recursion - #3250
Merged
Merged
Conversation
…rsion The fish lazy-load stub (`functions/wt.fish`) re-sources the full integration on every call and self-invokes `wt $argv`, with no guard for completion mode. #3241 fixed the completions wt itself writes to resolve the binary, but the stub stays vulnerable to a stale third-party completion that calls the bare `wt` command with COMPLETE set (e.g. an old Homebrew `vendor_completions.d/wt.fish` left on disk before an upgrade): that re-enters the stub and recurses to fish's call-stack limit. Add the same `COMPLETE` short-circuit bash/zsh already use, so the stub delegates to the binary in completion mode regardless of which completion file is active. Co-Authored-By: Claude Opus 4.8 <[email protected]>
The lazy-load wrapper stub gained an 8-line COMPLETE guard, shifting the `command wt config shell init fish | source` marker from line 7 to line 15. config_show renders that line number, so config_show_fish_with_completions and config_show_fish_without_completions need regenerating alongside the configure_shell_fish_dry_run snapshot already updated in this PR. Co-Authored-By: Claude <[email protected]>
Collaborator
Author
|
Heads-up on the red Windows checks — this is the known unrelated PTY flake, not a regression from this change. Both Windows legs ( I've re-run the two failed Windows legs. |
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.
Follow-up to #3241, requested in #3240.
#3241 made the completion files wt itself writes resolve the binary, so they no longer re-enter the fish lazy-load stub. But the stub (
functions/wt.fish) is still unguarded, leaving one narrow residual case: a stale third-party completion that calls the barewtcommand withCOMPLETEset — e.g. an old Homebrewvendor_completions.d/wt.fishleft on disk from before an upgrade — re-enters the stub and recurses to fish's call-stack limit until the package is rebuilt.This adds the same
COMPLETEshort-circuit that bash and zsh already use, so the stub delegates straight to the binary in completion mode regardless of which completion file is active:This makes fish immune to stale third-party completions, matching bash/zsh.
Changes
templates/fish_wrapper.fish— add theCOMPLETEguard to the lazy-load stub.src/shell/mod.rs—test_fish_wrapper_guards_completion_moderegression test (Bug: fish completion infinitely recurses through the lazy-load wt function #3240).configure_shell_fish_dry_runsnapshot.Closes #3240.
🤖 Generated with Claude Code