Skip to content

fix: Windows Git Bash shell integration path handling - #398

Merged
max-sixty merged 1 commit into
mainfrom
windows
Jan 3, 2026
Merged

max-sixty merged 1 commit into
mainfrom
windows

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Summary

  • Fix Windows Git Bash shell integration not recognizing $SHELL paths like C:\Program Files\Git\usr\bin\bash.exe
  • Use std::path::Path::file_name() for platform-native path handling instead of rsplit('/')
  • Add case-insensitive .exe stripping for Windows executables
  • Make pager detection (delta, bat) case-insensitive for Windows command names

Fixes #348

Test plan

  • All existing tests pass (565 lib + 376 bin + 681 integration)
  • New tests for mixed-case .exe variants (.Exe, .EXE, .eXe)
  • Platform-specific path tests (Unix on Unix, Windows on Windows)
  • Case-insensitive pager detection tests
  • Windows CI validates the fix on actual Windows platform

This was written by Claude Code on behalf of @max-sixty

🤖 Generated with Claude Code

Use `std::path::Path::file_name()` for platform-native path handling when
extracting shell names from `$SHELL`. This fixes Windows Git Bash where
`$SHELL` contains Windows-style paths like `C:\Program Files\Git\usr\bin\bash.exe`.

Changes:
- Add `extract_filename_from_path()` helper with case-insensitive `.exe` stripping
- Extract `shell_from_name()` for better testability
- Update pager detection to use case-insensitive matching for Windows commands
- Add tests for mixed-case `.exe` variants and platform-specific paths

Fixes #348

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@max-sixty
max-sixty merged commit 81077c3 into main Jan 3, 2026
@max-sixty
max-sixty deleted the windows branch January 3, 2026 21:44
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.

Unable to change directory on Windows GitBash with chell integration enabled

1 participant