Repository navigation
Simplify shell integration detection to known setup lines - #4595
Merged
Merged
Conversation
worktrunk-bot
left a comment
Collaborator
There was a problem hiding this comment.
The fallback hint treats unrelated wt references as customized initialization; the inline suggestion keeps the advice accurate for those cases.
worktrunk-bot
approved these changes
Oct 26, 2026
1 task
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.
Shell integration detection used partial shell-syntax heuristics to decide whether an entire rc-file line belonged to Worktrunk. An alias quoting initialization, or an initialization followed by another command, could therefore be removed by uninstall.
Recognize complete generated, documented, and historical setup forms instead. Current installer lines come directly from the generator; install, diagnostics, and uninstall share the matcher, which also supplies the shell identity. Preserve custom command names,
.exenames, Git dispatch, and older installer forms without adding a parser dependency. Remove the syntax-variation heuristics and their tests.Customized shell expressions remain user-managed: uninstall leaves them alone, diagnostics explain that boundary, and installing over such a setup may append the standard initialization line. Regression coverage checks install idempotency and preservation of quoted aliases and compound statements.
Validation: shell unit and install/uninstall integration tests, independent CLI lifecycle probes, help snapshots, documentation sync/build, doctests, and all pre-commit checks pass. The full local gate ran 5,430 tests with 5,422 passing. Its documentation-sync failure was resolved by regeneration and a passing repeat; remaining failures were an unchanged startup test, two process-discovery preconditions, and four PowerShell-related failures. The installed
pwshalso stack-overflows on standalone1 + 1, independently of Worktrunk. CI must pass before merge.Closes #4106.