Open gglanzani opened 7 years ago
There are a couple of similar issues around in github https://github.com/Microsoft/BashOnWindows/issues/2011
Likely some code is trying to figure out its current directory and having issues with the unexpected path and/or environment vars.
I wonder if setting $CD to a valid path works around it?
No, setting $CD
doesn't help unfortunately :(
I was trying to make a shell script that changes folder to a Windows folder and then calls win32yank.exe, but I don't have much luck: the -o option pastes twice for example.
@gglanzani trying to reproduce this on Windows, but I do not get that message with any of the following
win32yank.exe -o
win32yank.exe -o --lf
I just updated windows so that might be the cause winver.exe reports OS build 15063.250
It seems this only happens when using a symlink to the actual binary, like the example in the neovim wiki.
Installing Xming for Windows, and then making sure to run export DISPLAY=:0
on the shell fixed this for me on neovim.
It's not a symlink issue and there's no straight-forward fix for this - it's an error generated by the WSL subsystem when cwd is inside the lxsys filesystem which isn't accessible from win32.
The fix is to call win32yank.exe via a Linux-side program/script which will filter that.
Here's my solution:
cat win32yank.exe
#!/bin/bash
win32yank.exe "$@" 2> >(sed -e '1h;2,$H;$!d;g' -r -e 's/Unable to translate[^\n]*\n//' 1>&2)
Calling win32yank on WSL prints to stdout (before the clipboard is printed) the following line
The tool is basically working when calling it from neovim inside Windows Subsystem from Linux. However that line gets printed everywhere, which is annoying :)
I've looked at the code, but there were no mentions of this so maybe it's rust doing this