Skip to content

feat(shell): add safe opt-in native Tab cycling - #517

Merged
primetimetank21 merged 3 commits into
developfrom
feat/516-opt-in-tab-completion
Oct 4, 2026
Merged

primetimetank21 merged 3 commits into
developfrom
feat/516-opt-in-tab-completion

Conversation

@primetimetank21

@primetimetank21 primetimetank21 commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Summary

Add explicit, native Tab cycling for Bash/Zsh without rerunning the general dotfile installer or silently opting existing users in. A dedicated completion-only command adds separate hooks; unrelated rc content and the existing DevSetup managed block stay intact.

Changes

  • bash config/dotfiles/install-completion.sh opts in both shells. Supports validation-only --dry-run, feature-only --uninstall, unique backups, stable hooks and a checkout-linked helper.
  • DEV_SETUP_COMPLETION=0 before the hook preserves prior bindings in a fresh shell. Only Tab/Shift+Tab in insertion keymaps are intentionally overridden after opt-in; modes, vi command maps and unrelated bindings remain unchanged.
  • Modern Bash and Zsh support both directions. Bash 3.2/older Readline supports forward Tab only; existing Shift+Tab is preserved. No private escape sequence or macro fallback.
  • Strict preflight rejects modified/duplicate hooks, ambiguous symlink paths and conflicting helper ownership before mutation. Uninstall preserves later additions and necessary line boundaries without restoring entire backups.
  • Zsh uses native widgets without rerunning compinit or altering its audit behavior. Documented framework ordering, effective ZDOTDIR, login-shell/provider limitations and recovery boundaries.
  • Ordinary setup.sh, general dotfile installation, startup templates, PowerShell and global configuration are unchanged.

Test plan

Passed locally on Linux, Bash 5.1.16 and explicitly unpacked Zsh 5.8.1:

  • 279 isolated lifecycle assertions, independently rerun by coordinator and verifier.
  • 17 runtime/state/actual PTY scenarios, independently rerun.
  • Independent review/reproduction: original symlink trailing-slash finding fixed; 32 path variants rejected mutation-free. Earlier uninstall line-fusion issue also fixed with executable regression cases.
  • Four actual fresh-startup PTY recordings (Bash/Zsh enabled/disabled), 18 per-key transitions, raw-output/cast equality and source-hash verification. Media is local-only, not part of this PR.
  • Bash/Zsh syntax, ShellCheck 0.8.0, workflow parsing and whitespace checks passed. Real user startup files remained unchanged, confirmed by metadata/hash baselines.

Commands:

/bin/bash tests/test_completion_install.sh
/bin/bash tests/test_completion_runtime.sh --bash /bin/bash --zsh /bin/zsh

The local unpacked Zsh run used the documented test-only --zsh-init adapter. Final native Linux/macOS completion CI passed 279 lifecycle assertions and 17 runtime scenarios on each OS: Linux Bash 5.2.21/Zsh 5.9, macOS Bash 3.2.57/Zsh 5.9. Both use OS shells without adapters. Native macOS confirms forward-only Bash 3.2 behavior and preserved Shift+Tab. All 12 final PR checks pass: Validate Setup Script, 8/8 and E2E Install Smoke Test, 4/4, including Windows. Final head: fa3769e4fb25c06eaab86d9d85b7bc21629e6620.

The first CI style finding was corrected without disabling ShellCheck. Zsh provider tests now copy native function sources into private fixtures instead of depending on insecure ambient runner paths. Both reuse cases prove an injected insecure path is rejected, then initialize over isolated inputs; the dedicated security-abort scenario remains. No compinit audit bypass or host permission changes.

Limits: no physical-terminal/deployed acceptance or multi-file transaction/race guarantee. The maintained runtime harness manually sources isolated rc fixtures; independent Linux recordings additionally verify normal fresh startup. General uninstaller remains separate; completion removal is explicitly documented.

Related

Closes #516

Hygiene checklist

  • Changed .yml content is ASCII-only; no PowerShell changes
  • Conventional Commits format
  • Exactly one mandatory Copilot coauthor trailer
  • Branch forked from current develop

primetimetank21 and others added 3 commits October 4, 2026 00:33
Add a completion-only installer with validated rc hooks, backups, dry-run and feature-only removal. Preserve unrelated configuration and ordinary setup behavior. Keep older Readline Shift+Tab unchanged when no native backward widget exists.

Closes #516

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Satisfy SC2004 in the newer Linux/macOS CI ShellCheck without changing binding or installer behavior.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Copy native function sources into private fixtures instead of inheriting hosted-runner vendor paths. Exercise rejection of insecure ambient paths without bypassing compinit audits or modifying host permissions.

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
@primetimetank21
primetimetank21 marked this pull request as ready for review October 4, 2026 04:55
@primetimetank21
primetimetank21 merged commit 41298de into develop Oct 4, 2026
12 checks passed
@primetimetank21
primetimetank21 deleted the feat/516-opt-in-tab-completion branch October 4, 2026 05:03
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.

feat(shell): add opt-in Tab cycling without replacing existing config

1 participant