Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

已经安装了 xclip 还是提示:You need to install xclip command first. #130

Open
wangdeer opened this issue Apr 1, 2024 · 10 comments

Comments

@wangdeer
Copy link

wangdeer commented Apr 1, 2024

RT:
已经安装了 xclip 还是提示:You need to install xclip command first.

重装了插件,重启了系统还是不行。

image

OS: Ubuntu 22.04.4 LTS x86_64
Kernel: 6.1.0-1036-oem
DE: GNOME 42.9
Windowing System:x11

:~$ command -v xclip
/usr/bin/xclip
@Rvn0xsy
Copy link

Rvn0xsy commented Sep 21, 2024

我也遇到了相同的问题 🤔

@imlinhanchao
Copy link
Owner

试试下载 https://github.com/imlinhanchao/vsc-markdown-image/blob/master/asserts/linux.sh 然后执行 linux.sh output.png

@Rvn0xsy
Copy link

Rvn0xsy commented Sep 23, 2024

试试下载 https://github.com/imlinhanchao/vsc-markdown-image/blob/master/asserts/linux.sh 然后执行 linux.sh output.png

image
能够正常输出截图文件

很明显,我的机器上是存在xclip的:

╭─arch@archlinux ~
╰─$ command -v xclip
/usr/bin/xclip

并且我看启动xclip是使用的sh,切换到sh也是可以找到这个命令的:

╭─arch@archlinux ~
╰─$ sh
sh-5.2$ whereis xclip
xclip: /usr/bin/xclip /usr/share/man/man1/xclip.1.gz
sh-5.2$

@FogSalary
Copy link

我也一样,有解决方案了吗 😄

@urldecode
Copy link

我也是提示这个, 切换为使用v1.1.42版本 就正常

RT: 已经安装了 xclip 还是提示:You need to install xclip command first.

重装了插件,重启了系统还是不行。

image

OS: Ubuntu 22.04.4 LTS x86_64 Kernel: 6.1.0-1036-oem DE: GNOME 42.9 Windowing System:x11

:~$ command -v xclip
/usr/bin/xclip

@imlinhanchao
Copy link
Owner

我也是提示这个, 切换为使用v1.1.42版本 就正常

RT: 已经安装了 xclip 还是提示:You need to install xclip command first.
重装了插件,重启了系统还是不行。
image
OS: Ubuntu 22.04.4 LTS x86_64 Kernel: 6.1.0-1036-oem DE: GNOME 42.9 Windowing System:x11

:~$ command -v xclip
/usr/bin/xclip

感谢你的提醒,应该是从 Windows 发布 git 将 linux脚本的 LF 改成 CR LF 导致的。可以先手动在 VSCode 打开 ~/.vscode/extensions/hancel.markdown-image-1.1.43/asserts/linux.sh,修改 CR LF 为 LF 来临时解决。我再看看怎么避免以后又被修改。明明已经配置了 autocrlf = false。😂

@urldecode
Copy link

urldecode commented Nov 11, 2024

image
经过对比,问题出在文件存在 windows 换行
替换换行符号为linux的lf即可

  • 方法1 :从1.1.42 复制 asserts/linux.sh 到 1.1.43替换
  • 方法2:cd .vscode/extensions/hancel.markdown-image-1.1.43/asserts && tr -d '\r' < linux.sh > temp_file && mv temp_file linux.sh

@nosuz
Copy link
Contributor

nosuz commented Dec 3, 2024

Hi, I met the same error.

I am using Ubuntu 24.10 and installed xclip by apt command. The Markdown Image
is v1.1.43. But the error message to install xclip appeared when I tried to paste a picture.

I fixed this problem by 方法2.

The output of 'cat -A linux.sh' was

Screenshot From 2024-12-03 20-50-03

@urldecode
Copy link

Hi, I met the same error.

I am using Ubuntu 24.10 and installed xclip by apt command. The Markdown Image is v1.1.43. But the error message to install xclip appeared when I tried to paste a picture.

I fixed this problem by 方法2.

The output of 'cat -A linux.sh' was

Screenshot From 2024-12-03 20-50-03

test this

tr -d '\r' < linux.sh  | cat -A
tr -d '\r' < linux.sh > temp_file && mv temp_file linux.sh

@nosuz
Copy link
Contributor

nosuz commented Dec 3, 2024

Thank you for your advice.

The result of tr -d '\r' < linux.sh | cat -A is following image and '^M' is removed as expected.

Screenshot from 2024-12-04 05-24-25

And triming '^M' was fixed my error as you adviced.

I also downloaded linux.sh from this GitHub repository and checked '^M' is exist. However, there isn't it.
So, I downloaded your package in vscode market place and checked whether '^M' exist. The linux.sh in that zipped vsix file contains '^M' and I think this is the cause of the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants