关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。
我们不允许在 Stack Overflow 上提出有关通用计算硬件和软件的问题。您可以编辑问题,使其成为 on-topic对于堆栈溢出。
2年前关闭。
Improve this question
我在我的 Windows 10 机器上使用 Ubuntu 18.04 作为 Linux 的 Windows 子系统。
我已经安装了gedit
没有任何错误或警告。
但是每当我尝试使用命令 gedit something
(这里的东西是一个文件名)
我收到此错误:
Unable to init server: Could not connect: Connection refused
(gedit:48): Gtk-WARNING **: 21:03:26.729: cannot open display:
最佳答案
您需要 X 服务器来运行图形应用程序,如 gedit
.
我用 VcXsrv或 Xming在我的 Windows 桌面上,两者都非常小且易于安装,
但还有其他服务器,如 Cygwin/X .
VcXsrv/Xming 的简短说明:
export DISPLAY=0:0
gedit
我的问题是 gedit 首选项中的某些复选框不起作用(dconf 错误,我不在乎),但除此之外编辑器可用。
有关的:
关于linux - WSL - GEDIT 无法初始化服务器 : Could not connect: Connection refused,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60284542/