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

Blank VIM window from Windows Command Prompt #711

Closed
TaleTN opened this issue Mar 30, 2016 · 26 comments
Closed

Blank VIM window from Windows Command Prompt #711

TaleTN opened this issue Mar 30, 2016 · 26 comments

Comments

@TaleTN
Copy link

TaleTN commented Mar 30, 2016

After updating to v2.8.0 64-bit (git version 2.8.0.windows.1) VIM doesn't seem to work anymore from the Windows Command Prompt. If I e.g. try to edit a commit message I just get a blank (black) terminal window. Pressing Esc a couple of times seems to make it display a single line at the bottom of the window saying something like:

"C:/foo/.git/COMMIT_EDITGMSG" [converted][unix] 14L, 280C

Sometimes (I am not sure how/why) the VIM commit editor window does appear, but without the usual syntax highlighting, and it doesn't seem to respond to any of the usual keyboard commands.

Note that from the Git Bash terminal everything seems to work fine. Rolling back to Git v2.7.4 also seems to fix the issue, but if I then reinstall v2.8.0 the issue returns.

I am running Win10 Pro x64. I haven't installed any additional components, I use Git from the Windows Command Prompt, for Git Bash I use MinTTY, and I haven't enabled file system caching nor Git Credential Manager.

@nguymin4
Copy link

@TaleTN Same issue on Window 10 x64.

I found out that, vim run smoothly when starting it with git-bash.exe. But with bash.exe, it starts really slowly and usually breaks.

@dscho
Copy link
Member

dscho commented Mar 30, 2016

Could you test whether this problem occurs also with MSYS2?

@TaleTN
Copy link
Author

TaleTN commented Mar 30, 2016

Sure. Well, at least I can try... I have just installed msys2-i686-20160205.exe, and then reinstalled Git v2.8.0. Basically this seems to work i.e. I see a commit message with correct syntax highighting, but I can't save my message or quit VIM (the Insert key doesn't seem to work, :x doesn't seem to work, etc.). But I also get this with Git v2.7.4 in the MSYS2 Shell, so I guess I simply don't know how VIM works under MSYS2.

@chriscollinsboxuk
Copy link

I've just updated to 2.8 and I'm seeing the same issue.

I see a blank window when running git commit from a:

  • cmd prompt
  • cmd prompt inside ConEmu
  • git bash prompt inside ConEmu
  • MinGW prompt

I see the VIM interface as normal when starting Git bash from the start menu. I'm on Windows 10 64 bit.

@lennylxx
Copy link

+1, using Windows 10 64 bit, version 1511, build 10586.164.
I replaced the vim binaries of older version, but it's doesn't work.
Downgraded to 2.7.4.

@dscho
Copy link
Member

dscho commented Mar 30, 2016

Sure. Well, at least I can try... I have just installed msys2-i686-20160205.exe, and then reinstalled Git v2.8.0.

@TaleTN well, what I meant is: does vim work in MSYS2. I.e. when you installed MSYS2 and ran pacman -Syu vim and then ran C:\msys64\usr\bin\bash.exe -l -i, does vim still freeze? (Of course I could test this myself, but my plate is real full...)

@TaleTN
Copy link
Author

TaleTN commented Mar 30, 2016

Oh I see... I have just reinstalled MSYS2 (64-bit this time), and then did as you said, and I think it works as expected (i.e. I see a text file, and I can exit using :x, but I can't seem to switch to insert mode; PEBKAC I guess).

@dscho
Copy link
Member

dscho commented Mar 30, 2016

@TaleTN okay, what if you replace usr\bin\msys-2.0.dll in Git for Windows with MSYS2's version? Does it fix the problem?

@TaleTN
Copy link
Author

TaleTN commented Mar 30, 2016

@dscho No, it does not.

@koraktor
Copy link

I’m having the same problem on Windows 7 (64 bit) as well since upgrading to 2.8.0.windows.1.
I’m usually using it in combination with ConEmu and Bash, but the problem is also occurring in cmd.exe.
The only option that worked for me is using the plain git-bash.exe. The only difference I can tell is that it’s not sourcing .profile et al. Disabling those configs for my normal setup does not work, though.

According to this Git mailing list posting the problem seems to be fixed when using a default vim.exe from vim.org. I didn’t try that, yet.

@csmager
Copy link

csmager commented Mar 31, 2016

I'm also having the same issue (Windows 10 x64, Git for Windows 2.8.0).

I can confirm that overwriting vim.exe in Program Files\Git\usr\bin with the one included in the latest vim 7.4 package as suggested in the message linked to by @koraktor does resolve the problem.

I also noticed in my trials and error that removing set nocompatible from vimrc in Program Files\Git\etc does allow it to start and behave (reasonably) normally.

@dscho
Copy link
Member

dscho commented Mar 31, 2016

I also noticed in my trials and error that removing set nocompatible from vimrc in Program Files\Git\etc does allow it to start and behave (reasonably) normally.

Thanks for this hint. Unfortunately, it does not fix it in my case...

@dscho
Copy link
Member

dscho commented Mar 31, 2016

So far, I only found that recompiling vim does not change a thing (not very surprising, given that the vim of Git for Windows v2.7.4 still worked, and it is exactly the same vim version as v2.8.0 ships).

However, replacing msys-2.0.dll with the version from 2.7.4 does fix the problem.

@jfcherng
Copy link

Sadly, replacing msys-2.0.dll from Git-2.7.4-32-bit.exe gives me a start-able vim but not a usable vim. It responses pretty slowly.

@dscho
Copy link
Member

dscho commented Mar 31, 2016

@jfcherng Replacing msys-2.0.dll breaks many more things than just some aspects of vim.exe (and for future record, your statement is awfully vague, you might want to step up the precision and detail in future comments). For example, ls.exe exits with exit code 127, indicating a DLL problem (indeed, a symbol expected by ls.exe is not found in that version). The point of my remark was to indicate that the problem was not introduced by vim, but by an upgrade in the msys2-runtime. And while we are speaking, I am bisecting the issue to get closer to the root cause. I am keeping you updated as a matter of courtesy.

@brezanac
Copy link

Windows 8.1 x64. Git for Windows 2.8.0 breaks Vim (7.4.1468) when used with cmder (ConEmu) but it does work fine with Mintty. Running vim just opens a blank screen initially and it takes some time and a couple of keypresses for vim to actually appear. Exiting is however impossible.

@dscho
Copy link
Member

dscho commented Mar 31, 2016

Git for Windows 2.8.0 breaks Vim (7.4.168)

Did you mean 7.4.1_4_68?

@brezanac
Copy link

Did you mean 7.4.1468?

Yes, my bad. A typo. It's vim 7.4.1468.

@dscho
Copy link
Member

dscho commented Mar 31, 2016

Progress: turns out that git-for-windows/msys2-runtime@7346568 might be the problematic change.

@dscho
Copy link
Member

dscho commented Mar 31, 2016

Indeed, the culprit is git-for-windows/msys2-runtime@7346568 and reverting it fixes the issue. Will continue tomorrow.

@TaleTN
Copy link
Author

TaleTN commented Mar 31, 2016

@dscho That sounds very promising. Thanks!

@dscho
Copy link
Member

dscho commented Apr 1, 2016

Uploaded into the Pacman repository of the Git for Windows SDK.

You can fix it locally by downloading https://dl.bintray.com/git-for-windows/pacman/x86_64/msys2-runtime-2.4.1.34115.1ca92fa-1-x86_64.pkg.tar.xz and extracting usr\bin\msys-2.0.dll into your existing Git for Windows.

[EDIT: fixed the link as pointed out by @mmalolepszy; Thanks!]

@mmalolepszy
Copy link

The link above doesn't work. This one should: https://dl.bintray.com/git-for-windows/pacman/x86_64/msys2-runtime-2.4.1.34115.1ca92fa-1-x86_64.pkg.tar.xz

@moosekaka
Copy link

I can confirm that it fixes the issue after running pacman -Syuu. Thank you!

dscho added a commit to dscho/msys2-runtime that referenced this issue Apr 5, 2016
In 7346568 (Make requested console reports work, 2016-03-16), code was
introduced to report the current cursor position. It works by using a
pointer that either points to the next byte in the readahead buffer, or
to a NUL byte if the buffer is depleted, or the pointer is NULL.

These conditions are heeded in the fhandler_console::read() method, but
the condition that the pointer can point at the end of the readahead
buffer was not handled properly in the get_cons_readahead_valid()
method.

This poses a problem e.g. in Git for Windows (which uses a slightly
modified MSYS2 runtime which is in turn a slightly modified Cygwin
runtime) when vim queries the cursor position and immediately goes on to
read console input, erroneously thinking that the readahead buffer is
valid when it is already depleted instead. This condition results in an
apparent freeze that can be helped only by pressing keys repeatedly.

The full Git for Windows bug report is here:

	git-for-windows/git#711

Let's just teach the get_cons_readahead_valid() method to handle a
depleted readahead buffer correctly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Apr 5, 2016
This fixes git-for-windows/git#711

This reverts commit 7346568.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Apr 5, 2016
This is the proper fix for

	git-for-windows/git#711

It is actually a real bug fix that will be submitted to Cygwin
momentarily.

Revert "Revert "Make requested console reports work""

This reverts commit a08308b.
dscho added a commit to git-for-windows/msys2-runtime that referenced this issue Apr 5, 2016
In 7346568 (Make requested console reports work, 2016-03-16), code was
introduced to report the current cursor position. It works by using a
pointer that either points to the next byte in the readahead buffer, or
to a NUL byte if the buffer is depleted, or the pointer is NULL.

These conditions are heeded in the fhandler_console::read() method, but
the condition that the pointer can point at the end of the readahead
buffer was not handled properly in the get_cons_readahead_valid()
method.

This poses a problem e.g. in Git for Windows (which uses a slightly
modified MSYS2 runtime which is in turn a slightly modified Cygwin
runtime) when vim queries the cursor position and immediately goes on to
read console input, erroneously thinking that the readahead buffer is
valid when it is already depleted instead. This condition results in an
apparent freeze that can be helped only by pressing keys repeatedly.

The full Git for Windows bug report is here:

        git-for-windows/git#711

Let's just teach the get_cons_readahead_valid() method to handle a
depleted readahead buffer correctly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
MXEBot pushed a commit to mirror/newlib-cygwin that referenced this issue Apr 6, 2016
In 7346568 (Make requested console reports work, 2016-03-16), code was
introduced to report the current cursor position. It works by using a
pointer that either points to the next byte in the readahead buffer, or
to a NUL byte if the buffer is depleted, or the pointer is NULL.

These conditions are heeded in the fhandler_console::read() method, but
the condition that the pointer can point at the end of the readahead
buffer was not handled properly in the get_cons_readahead_valid()
method.

This poses a problem e.g. in Git for Windows (which uses a slightly
modified MSYS2 runtime which is in turn a slightly modified Cygwin
runtime) when vim queries the cursor position and immediately goes on to
read console input, erroneously thinking that the readahead buffer is
valid when it is already depleted instead. This condition results in an
apparent freeze that can be helped only by pressing keys repeatedly.

The full Git for Windows bug report is here:

	git-for-windows/git#711

Let's just teach the get_cons_readahead_valid() method to handle a
depleted readahead buffer correctly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@seanzer
Copy link

seanzer commented May 30, 2017

Is this fix released in git 2.13.0? I'm still having problems

@TaleTN
Copy link
Author

TaleTN commented May 30, 2017

I am on 2.13.0 also, and everything seems fine here. BTW, I think this specific issue was fixed in 2.8.1, and I haven't seen the issue again since, so maybe what you are seeing is another issue?

@seanzer seanzer mentioned this issue May 30, 2017
1 task
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