Canop/broot

Backslashes are treated as escape characters

开放

#1,100 创建于 2025年11月15日

 (4 条评论) (0 个反应) (0 位负责人)Rust (213 个派生)batch import
bughelp wantedwindows

仓库指标

星标
 (9,383 个星标)
PR 合并指标
 (平均合并 53分钟) (30 天内合并 1 个 PR)

描述

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
}

贡献者指南