不能在Windows上使用cygwin启动git gui [英] Cannot launch git gui using cygwin on windows

查看:333
本文介绍了不能在Windows上使用cygwin启动git gui的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾经在我的cygwin控制台启动git gui没有任何问题,但从我更新cygwin我有以下错误信息:

  $ git gui 
应用程序初始化失败:无显示名和$ DISPLAY环境变量
启动脚本中出错:无效的命令名tk_messageBox
执行
时 tk_messageBox -icon error -type ok -titlegit-gui:fatal error-message $ err

中调用if {[catch {package require Tcl 8.4} err]
|| [catch {package require Tk 8.4} err]
} {
catch {wm withdraw。}
tk_messageBox \
-icon error \
-typ ...
(文件/ usr / lib / git-core / git-gui第34行)


b $ b

谁知道如何解决这个问题?

解决方案

到目前为止2016年3月,重新命名的包等。



Cygwin的gitk和git gui需要X11。这意味着您需要安装一些Cygwin X11软件包,并将其设置为能够打开GUI。



这应该可以让您启动并运行:


  1. 再次运行Cygwin安装程序(下载相关的

  2. 在软件包列表中,选择在X11类别下安装xinit。

  3. 在Windows开始菜单中,您应该有一个新的组:Cygwin-X。

  4. 在您的Cygwin shell中,运行 export DISPLAY =:0.0

每次重新启动计算机时,您都需要重复步骤3,每次打开一个新的Cygwin shell(或只运行 echoexport DISPLAY =:0.0>>〜/ .profile ,使其在您创建新shell时自动运行)。



在评论中,似乎有些人收到错误,说明无法连接到显示:0.0'。如果你得到,鼠标在X应该已经出现在你的系统托盘(如果X图标被隐藏,你可能需要点击向上的图标);弹出的标题应该像Cygwin / X Server:1.0。使用:1.0(或任何你看到的)作为步骤4中 DISPLAY 的值,而不是:0.0,确保包含冒号。 p>

如果您在启动X服务器时遇到其他问题,您可能会发现您有一个名为〜/ .xsession-errors ;检查出的内容为什么出错了。还要检查是否有一个〜/ .startxwinrc 文件,并尝试删除它,看看是否解决了这个问题。



对于感兴趣的,X11软件包没有自动安装的原因是它们在技术上不需要:通过有些复杂的手段可能使用不同的X11服务器比Cygwin安装时安装xinit包。


I used to launch git gui within my cygwin console without any problems but since I updated cygwin I've got the following error message:

$ git gui
Application initialization failed: no display name and no $DISPLAY environment variable
Error in startup script: invalid command name "tk_messageBox"
    while executing
"tk_messageBox  -icon error  -type ok  -title "git-gui: fatal error"  -message $err"
    invoked from within
"if {[catch {package require Tcl 8.4} err]
 || [catch {package require Tk  8.4} err]
} {
        catch {wm withdraw .}
        tk_messageBox \
                -icon error \
                -typ..."
    (file "/usr/lib/git-core/git-gui" line 34)

Anyone who knows how to solve this?

解决方案

Edit: Brought up to date in March 2016 to account for renamed packages etc.

Cygwin's gitk and git gui require X11. This means you need to install some of the Cygwin X11 packages and set them up to be able to open the GUI.

This should get you up and running:

  1. Run the Cygwin installer again (download the relevant setup-*.exe again if you need to).
  2. At the package list, select to install "xinit" under the X11 category. Click next, accept all the dependencies, and install.
  3. In the Windows Start menu, you should have a new group: Cygwin-X. From there, run XWin Server.
  4. In your Cygwin shell, run export DISPLAY=:0.0.

You'll need to repeat step 3 every time you reboot your computer, and step 4 every time you open a new Cygwin shell (or just run echo "export DISPLAY=:0.0" >>~/.profile to have it run automatically whenever you create a new shell).

In the comments, it seems some people are getting errors stating 'couldn't connect to display ":0.0"'. If you get that, mouse over the X that should have appeared in your system tray (you may need to click the little up icon if the X icon has been hidden); the pop-up title should say something like "Cygwin/X Server:1.0". Use that ":1.0" (or whatever you see) as the value for DISPLAY in step 4, rather than ":0.0", making sure to include the colon.

If you have any other problems starting the X server, you will probably find you have a file called ~/.xsession-errors; check out the contents of that for what's going wrong. Also check whether you have a ~/.startxwinrc file, and try deleting it and seeing if that fixes the problem.

For the interested, the reason the X11 packages aren't installed automatically is that they're not technically needed: it's possible through somewhat convoluted means to use a different X11 server than the one Cygwin installs when you install the "xinit" package.

这篇关于不能在Windows上使用cygwin启动git gui的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆