How can I get MinTTY (Cygwin terminal) to open gvim in a new window?

I installed mintty. After that I can not open gvim. As suggested in the same question for emacs, I use: 1) mintty gvim

a new window opens with the message:

E233: unable to open displayE852: child process could not start GUI Press ENTER or enter a command to continue

I also set: export DISPLAY = ": 0"

what am I doing wrong

+4
source share
4 answers

You probably don't have an X server. Look here for instructions on setting it up. Personally, it’s easier for me to simply uninstall the gvim cygwin version and use the Windows version instead.

+4
source

I had the same problem when starting gvim and I got an error message as above.

My default DISPLAY setting: 0.0

However, I noticed in the output of my startxwin that he said

"" Rules = "base" Model = "pc105" Layout = "us" Variant = "none" Options = "none" winMultiWindowXMsgProc - DISPLAY =: 2.0 winInitMultiWindowWM - DISPLAY =: 2.0 winProcEstablishConnection - winInitClipboard is returned. ""

I set my display to: 2.0, and now it works. those. export DISPLAY =: 2.0

Hope this helps.

[In addition, the script seems to check /tmp/.X11-unix/Xn, where n in Xn is a number. It seems I already had X0 and X1, probably left from the old bad closure. Removing this seems to bring it back to use: 0.0]

+1
source

For me, gvim was compiled from / usr / bin / gvim. I installed gvim as a Windows application and then brought it out of my window directly as

[cygwin$] /cygdrive/C/Program\ Files\ \(x86\)/Vim/vim74/gvim 

And it worked.

0
source

Like user 2250246, I simply lashed out at trying to get cygwin gvim to start working again, but I didn’t want to enter either the alias gvim. (Which I probably should have done. An alias is simpler.)

I added the path to gvim for Windows to my Windows environment variables:

  • Get the path to gvim by finding its icon in the Start menu and right-clicking on it, and then open Properties. Find the Target link and copy everything except the final "gvim.exe".
  • Go to Control Panel β†’ System β†’ Advanced System Settings β†’ Environment Variables β†’ System Variables. Select "Path." Click "Edit." Insert this path at the beginning. Click OK. Click OK.

Cygwin will then put your Windows gvim in its own path, but it will put / usr / bin in front of it in its own path. So

  1. mv / usr / bin / gvim / usr / bin / gvim-screwed-up

    mv / usr / bin / gvimdiff / usr / bin / gvimdiff-screwed-up

and your cygwin will find and run gvim installed on Windows with or without cygwin X server.

Unfortunately, it will no longer load your cygwin.vimrc! You will have to fix it yourself.

0
source

Source: https://habr.com/ru/post/1434282/


All Articles