Cygwin Application initialization failed: no display name and no $DISPLAY environment

     使用新版本的Cygwin,安装时出现很多问题。------------------留作参考----------------------

     首先从官网下载setup.exe后运行安装,选择需要的包。

     在终端输入gitk后出现错误:

      Application initialization failed: no display name and no $DISPLAY environment variable

    解决方案:http://stackoverflow.com/questions/9393462/cannot-launch-git-gui-using-cygwin-on-windows

     

As of a recent Tcl/Tk update, Cygwin now uses X11 instead of GDI. In short, 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 back up and running:

  1. Run the Cygwin installer again (download setup.exe again if you need to).
  2. At the package list, select to install "xinit" and "X-start-menu-icons"; both are 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).

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

       也就是说新版本的Cygwin需要X11了,所以要装上xinit" and "X-start-menu-icons";

另外,运行的时候:

1. 运行cygwin的安装程序,安装 Xorg Server 和Xinit

2. 运行cygwin,输入startx

 

3. 运行gitk或者git gui

转载于:https://www.cnblogs.com/allenzhaox/archive/2012/12/28/3201759.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值