Skip to content

Simplify shell integration detection to known setup lines - #4595

Merged
max-sixty merged 3 commits into
mainfrom
codex/simplify-shell-detection
Oct 26, 2026
Merged

max-sixty merged 3 commits into
mainfrom
codex/simplify-shell-detection

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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, .exe names, 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 pwsh also stack-overflows on standalone 1 + 1, independently of Worktrunk. CI must pass before merge.

Closes #4106.

This was written by Codex on behalf of max-sixty

@worktrunk-bot worktrunk-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fallback hint treats unrelated wt references as customized initialization; the inline suggestion keeps the advice accurate for those cases.

Comment thread src/commands/config/show.rs Resolved
@max-sixty
max-sixty merged commit bb25aea into main Oct 26, 2026
40 checks passed
@max-sixty
max-sixty deleted the codex/simplify-shell-detection branch October 26, 2026 07:14
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.

Delegate hand-maintained knowledge of other tools' conventions to libraries where possible

2 participants