Skip to content

Conversation

@max-sixty
Copy link
Owner

Summary

  • Add escape_path_for_shell() helper that uses ~ for home directory paths in copy-pasteable commands
  • Only uses ~ when no shell escaping is needed; falls back to quoted absolute paths for paths with spaces/special chars
  • Handles both Unix (~/) and Windows (~\) path separators

Examples:

Path Output
/Users/alex/repo ~/repo
/Users/alex/my repo '/Users/alex/my repo'

Test plan

  • Unit tests for escape_path_for_shell() covering home/non-home paths, with/without spaces
  • Updated snapshot tests for error messages
  • cargo test passes
  • pre-commit run --all-files passes

🤖 Generated with Claude Code

Co-Authored-By: Claude noreply@anthropic.com

max-sixty and others added 5 commits January 18, 2026 01:04
Add `escape_path_for_shell()` that shows `~` for home directory paths
in copy-pasteable commands, but only when no shell escaping is needed.
Falls back to quoted absolute paths when the path contains spaces or
special characters (to avoid the "tilde in quotes won't expand" issue).

Examples:
- `/Users/alex/repo` → `~/repo`
- `/Users/alex/my repo` → `'/Users/alex/my repo'`

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
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