broot
broot copied to clipboard
Backslashes are treated as escape characters
Environment
- Git Bash version: 5.2.15
- Operating System: Windows 11
- Broot version: 1.53.0
What happened
~/.bashrc :
source C:\Users\me\...\bash\br
treated as
source C:Usersme...bashbr
~\...\dystroy\broot\config\launcher\bash :
cd C:\Users\me\...\directory
treated as
cd C:Usersme...directory
Fix that works for me
function br {
local cmd cmd_file code
cmd_file=$(mktemp)
if broot --outcmd "$cmd_file" "$@"; then
cmd=$(sed 's/\\/\\\\/g' "$cmd_file") # Only Changed here
command rm -f "$cmd_file"
eval "$cmd"
else
code=$?
command rm -f "$cmd_file"
return "$code"
fi
}
I'd like somebody else on Windows to check this.