Skip to content

Backslashes are treated as escape characters #1100

Description

@kabeep

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
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is neededwindowsWindows specific problem

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions