Skip to content

fix: enable CD behavior for all shortcut styles#80

Merged
avihut merged 1 commit intomasterfrom
daft-79/fix-post-install-issues-v2
Jan 24, 2026
Merged

fix: enable CD behavior for all shortcut styles#80
avihut merged 1 commit intomasterfrom
daft-79/fix-post-install-issues-v2

Conversation

@avihut
Copy link
Owner

@avihut avihut commented Jan 24, 2026

Summary

  • Add shell wrapper functions for all shortcuts (git, shell, legacy styles) to daft shell-init output
  • Automatically install git-style shortcuts during daft setup
  • Show hint about switching to other shortcut styles

Problem

When using shortcut symlinks (gwtco, gwtcb, etc.), the CD behavior didn't work because symlinks bypass the shell wrapper functions that handle the __DAFT_CD__ marker.

Solution

  1. Shell wrappers for all shortcuts: Shell functions take precedence over symlinks. By defining wrapper functions for all shortcuts in daft shell-init, CD behavior now works regardless of how commands are invoked.

  2. Auto-install shortcuts: daft setup now automatically installs git-style shortcuts, so users get a complete setup in one command.

  3. Hint about alternatives: After setup, users see how to switch to other shortcut styles if they prefer.

What users see after daft setup

Done! Shell integration added to /Users/user/.zshrc
      Git-style shortcuts installed (gwtco, gwtcb, etc.)

To activate, either:
  1. Restart your terminal, or
  2. Run: source /Users/user/.zshrc

To use different shortcut styles:
  daft setup shortcuts only shell   # gwco, gwcob, gwcobd
  daft setup shortcuts only legacy  # gclone, gcw, gcbw, ...

Test plan

  • cargo clippy -- -D warnings passes
  • cargo fmt -- --check passes
  • just test-unit passes (97 tests)
  • Manual test: run daft setup, verify shortcuts installed and CD works

Related

🤖 Generated with Claude Code

- Add shell wrapper functions for all shortcuts (git, shell, legacy styles)
  to shell-init output, ensuring CD behavior works regardless of whether
  users invoke commands via symlinks or shell functions
- Automatically install git-style shortcuts during `daft setup`
- Show hint about switching to other shortcut styles (shell, legacy)

Fixes #79

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@avihut avihut self-assigned this Jan 24, 2026
@avihut avihut added the bug Something isn't working label Jan 24, 2026
@avihut avihut merged commit 6d91c23 into master Jan 24, 2026
4 checks passed
@avihut avihut deleted the daft-79/fix-post-install-issues-v2 branch January 24, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant