Skip to content

fix: show folder name instead of full path on MINGW (Windows)#19

Merged
glauberlima merged 1 commit intomainfrom
fix/mingw-windows-path-dirname
Feb 23, 2026
Merged

fix: show folder name instead of full path on MINGW (Windows)#19
glauberlima merged 1 commit intomainfrom
fix/mingw-windows-path-dirname

Conversation

@glauberlima
Copy link
Copy Markdown
Owner

Summary

  • On MINGW/Git Bash (Windows), workspace.current_dir arrives as a native Windows path with backslashes (e.g. C:\projetos\meu-projeto)
  • get_dirname() used ${1##*/} which only strips up to the last / — with no / present, the full path was returned unchanged
  • Fix normalizes \/ before extracting the basename, making it work on all platforms with zero impact on Linux/macOS paths

Test plan

  • get_dirname unix path/home/user/my-projectmy-project
  • get_dirname windows path (MINGW)C:\projetos\meu-projetomeu-projeto
  • get_dirname windows forward slashesC:/projetos/meu-projetomeu-projeto
  • All existing tests pass
  • shellcheck passes with zero warnings

…ility

On MINGW, Claude Code sends workspace.current_dir as a native Windows
path (e.g. C:\projetos\meu-projeto). The previous ##*/ expansion only
strips up to the last forward slash, leaving the full path unchanged.

Normalize backslashes to forward slashes before extracting the basename
so the directory component shows only the folder name on all platforms.
@glauberlima glauberlima merged commit 85cd69c into main Feb 23, 2026
1 check passed
@glauberlima glauberlima deleted the fix/mingw-windows-path-dirname branch March 6, 2026 11:10
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.

1 participant