Skip to content

fix(cli): restore zsh tab completion after installation - #337

Merged
shihuili1218 merged 2 commits into
mainfrom
fix/cli-zsh-completions
Nov 13, 2026
Merged

shihuili1218 merged 2 commits into
mainfrom
fix/cli-zsh-completions

Conversation

@shihuili1218

@shihuili1218 shihuili1218 commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Fresh zsh sessions could not complete even rssh <Tab> after CLI installation: the installer wrote _rssh but never loaded it. The dynamic registration script also skipped completion on the first Tab when loaded through fpath.

Initialize completion when needed and source the installed script from an idempotent .zshrc block. Preserve existing configuration and resolve the effective ZDOTDIR through zsh's .zshenv, including GUI launches without that environment variable. Report installation failures, while allowing successful shell startup diagnostics. Make the generated script support both sourcing and first-call autoload completion using the existing Clap callback.

Add real zsh regression coverage and install zsh in the PR and release test jobs so those tests execute in CI. Isolate test fpath to stock zsh functions and private nested fixture directories, preserving compaudit permission checks without depending on runner-specific site-functions or shared /tmp permissions.

Entry points

  • Desktop GUI: Install/Reinstall configures zsh completion automatically; existing terminal sessions need to reload .zshrc or open a new shell.
  • Mobile GUI: N/A; this change concerns the desktop CLI installer and host shell configuration.
  • CLI: rssh completions zsh supports both source and fpath loading, reusing existing dynamic candidates.
  • Headless / JetBrains: the same CLI-generated script can be loaded by the host shell. Installation remains host-managed; no command or event contract changes.

Validation

  • Independent review completed; fixed the successful-startup stderr handling found during review.
  • npm test: 1,402 tests passed; npm run build passed.
  • cargo fmt --all --check and cargo test --workspace --all-features: 1,011 tests passed, one existing doctest ignored.
  • CLI, Tauri, and standalone headless server feature checks passed.
  • Interactive macOS zsh: rssh <Tab> listed subcommands and rssh prof<Tab> completed to rssh profile.
  • Isolated zsh tests cover first autoload, sourcing, existing compinit, repeated installation, custom ZDOTDIR, startup diagnostics, and failure propagation.

Copilot AI balanced review requested due to automatic review settings November 13, 2026 14:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T15:13:59.510407Z b9f7072 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@shihuili1218
shihuili1218 merged commit 1974d12 into main Nov 13, 2026
2 checks passed
@shihuili1218
shihuili1218 deleted the fix/cli-zsh-completions branch November 13, 2026 15:25
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.

2 participants