Beyond Compare and WSL
-
Posting this since it's not so easy to find online. But, if you find yourself using WSL _and_ use Beyond Compare (outside of git) on the Windows side, here's a doodle to make your life easier. In your bash or zsh resource file, add this function and re-source it or logout and back in.
function bcomp() {
local path='/mnt/c/Progra~1/Beyond~1/BComp.exe'
"$path \"$(wslpath -aw "$1")\" \"$(wslpath -aw "$2")\""
}Now, in your Linux install you can simply do `bcomp file1 file2` anywhere and have BC pop up with the diff on your Windows machine. Tada! Edit: Here's a git config for using BC in WSL for poops and giggles too. So you can use `difftool` inside WSL and have it pop up in BC on Windows.
[user]
name = Bro Dude
email = brod@dude.com
[diff]
tool = bc
[difftool "bc"]
cmd = /mnt/c/Progra~1/Beyond~1/BComp.exe "$(wslpath -aw \"$REMOTE\")" "$(wslpath -aw \"$LOCAL\")"
path = /mnt/c/Progra~1/Beyond~1/BComp.exe
trustExitCode = true
[merge]
tool = bc
[mergetool "bc"]
cmd = /mnt/c/Progra~1/Beyond~1/BComp.exe "$(wslpath -aw \"$REMOTE\")" "$(wslpath -aw \"$LOCAL\")" "$(wslpath -aw \"$BASE\")" "$(wslpath -aw \"$MERGED\")"
path = /mnt/c/Progra~1/Beyond~1/BComp.exe
trustExitCode = true
[difftool]
prompt = false
[mergetool]
prompt = falseJeremy Falcon