Windows Subsystem for Linux git mergetool meld UnicodeDecodeError
Asked Answered
J

2

8

I'm WSL (Windows Subsystem for Linux) user. I use WSL to simply rsync source code between my host and remote compiling machine (RedHat). I found such a article:

https://www.deptagency.com/en-gb/story/using-meld-as-a-git-merge-tool-on-windows/

which triggers and run GUI windows meld from WSL.

But after following steps from this article, I'm getting this err msg (I've checked if windows EoL were passed):

Traceback (most recent call last): File "bin/meld", line 328, in structured_log_adapter UnicodeDecodeError: 'utf-8' codec can't decode byte 0x93 in position 103: invalid start byte

Do you have any ideas?

Thanks in advance, BR

Jollity answered 1/8, 2018 at 21:50 Comment(1)
A bug report here:Meld Windows shows error when git external call it (#222) · Issues · GNOME / meld · GitLab, and it looks like a binding error.Fogle
C
8

Have you tried the current version of Meld https://meldmerge.org/. I have followed the provided link https://www.deptagency.com/en-gb/story/using-meld-as-a-git-merge-tool-on-windows/ without any issues.

Steps in detail

Download and Install meld on Windows 10 from https://meldmerge.org/

Navigate to your wsl terminal Create a script to pass things over to meld

nano meld
#!/bin/bash

/mnt/c/Program\ Files\ \(x86\)/Meld/Meld.exe $@

Make the script executable

sudo chmod +x meld

Move the script to /usr/bin

sudo mv meld /usr/bin

Then, in ~/.gitconfig add/edit the following

[merge]
    tool = meld
[mergetool "meld"]
    cmd = meld --diff \"$BASE\" \"$LOCAL\" \"$REMOTE\" --output \"$MERGED\"

Navigate to git directory that has merge conflicts

Run

git mergetool

Enjoy!

Catchweight answered 16/4, 2020 at 5:19 Comment(0)
S
7

I am not sure if it would answer this question, but I needed to run meld within WSL2. Tried apt install meld but since that it's Windows, it doesn't run GTK app. So what I have done was to simply use symbolic link between Windows version of Meld:

ln -s /mnt/c/Program\ Files\ \(x86\)/Meld/Meld.exe /usr/local/bin/meld

And voila!

Species answered 4/8, 2020 at 13:14 Comment(2)
Works great. Exactly what I needed for WSL2 on Win10.Embryogeny
If I do this, Meld.exe cannot open the files since they start from /mnt/e, instead of E:\. How did you overcome this?Spectacled

© 2022 - 2024 — McMap. All rights reserved.