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

Strange Vim behaviour after Git for Windows upgrade #628

Closed
rmorrin opened this issue Sep 9, 2015 · 27 comments
Closed

Strange Vim behaviour after Git for Windows upgrade #628

rmorrin opened this issue Sep 9, 2015 · 27 comments
Labels
👆 Git Upstream issue in Git for Windows.

Comments

@rmorrin
Copy link
Contributor

rmorrin commented Sep 9, 2015

Upgrading the installed msysGit (1.9.5) to the newer Git for Windows (2.5.1) introduces a number of compatibility issues when the included Vim is used within Cmder.

Before (msysGit 1.9.5):
msysGit 1.9.5

After (Git for Windows 2.5.1):
Git for Windows 2.5.1

A couple things I've picked up on so far:

  • 256 colour themes don't seem to work. I use vim-hybrid but in theory, any similar theme shows the same result.
  • Occasional screen tearing/flickering when scrolling through files.
  • Some files show garbage (whitespace?) characters, e.g: ^M for Windows CRLF line-endings (I couldn't reproduce this consistently, though).
  • The white background shown above remains in the prompt after quitting Vim.

I do use a somewhat customised .vimrc (plugins, etc). I've managed to simplify it while still reproducing the issue here: https://gist.github.com/rmorrin/bdd79a716a9079060732

It's worth mentioning this occurs in both Windows cmd, as well as Git's included bash (both in Cmder). When using the Mintty terminal included with Git for Windows everything works as expected. My guess is that there is some difference between the Vim versions included within each Git installation.

@Stanzilla
Copy link
Member

Parts of this could be fixed by this git-for-windows/git#364

@erichiller
Copy link

When I issue vim --help in the console the output is briefly displayed and then immediately suppressed. Seems to be related.

@Stanzilla
Copy link
Member

Can you guys try https://github.com/Stanzilla/cmder/releases/tag/1.2.6 please, it has updated Git and ConEmu versions which both claim to have vim fixes.

@rmorrin
Copy link
Contributor Author

rmorrin commented Sep 28, 2015

@Stanzilla After a little fiddling around (it seems the newer vim loads files from .vim a la *nix systems instead of vimfiles) I managed to get your build set up.

Unfortunately the situation has not improved: the same configuration works fine with the vim included in msysGit 1.9.5, but fails on Git for Windows' vim.

Curiously, I tried running vim from git-bash.exe (included in vendor\git-for-windows) which worked nicely:

git-bash

Could this mean that the problem lies somewhere within ConEmu/Cmder?

@erichiller
Copy link

Ah yes, it most certainly does. I never updated! Vim works perfectly fine (at least for me). When ConEmuHk.dll is not loaded. You can unload this by ensuring that it is unchecked under Settings > Features

@Stanzilla
Copy link
Member

Nice investigation. Maybe @Maximus5 can chime in on this.

@Maximus5
Copy link
Contributor

Vim in git-for-windows v2.x do not post any ANSI sequences to WinApi (and ConEmu therefore). All ANSI codes are processed by msys2 kernel (same as cygwin's one) and all bugs, I believe, must be addressed to their maintainers.
https://conemu.github.io/en/CygwinAnsi.html

@ValYouW
Copy link

ValYouW commented Oct 1, 2015

Hi,

I have a strange behavior with vim also, after using vim the scrollbar disappear...
Before:
image

After:
image

Any ideas? thx.

@pavelkouril
Copy link

Another of the weird behavior (in PowerShell cmder) is after vim exits, it screws up the display of older entries and puts the input for new command at the top of terminal instead after last command (happens in like 80% of case).

@DanielGGordon
Copy link

I have this problem when using {cmd}, and I also had this problem before trying out version 1.26 (Stan's)

@erichiller
Copy link

Try the new conemu. It seems to have fixed everything for me at least.

@DanielGGordon
Copy link

@variab1e Which version? I am using the latest stable version. I am also having this problem when using my git bash task with the 1.4.1.1 build as well.

@Maximus5
Copy link
Contributor

There is no "latest stable" version at all, so you can't have it.
http://www.fosshub.com/ConEmu.html

@DanielGGordon
Copy link

@Maximus5 you are right. So I tried using the most recent alpha version with cmder 1.1.4.1 and 1.26. Right now on 1.1.4.1 Cmder works just fine. However when I open Git Bash (Git 2.5 something) as one of my tasks, I still have the same problem.

Should I use the latest 'preview' version instead?

@rmorrin
Copy link
Contributor Author

rmorrin commented Oct 12, 2015

@variab1e Can you confirm what was fixed for yourself? Are you seeing the correct colours within vim now? I've tried with the latest ConEmu 'alpha' build and still have the same issue.

@erichiller
Copy link

The appear to be right. As well as --help properly printing and not destroying previous output. I'm on git version 2.5.2.windows.2

Also though I upgraded vim independently as well if I remember right:
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Sep 11 2015 14:42:15)

ConEmu 151006

I did a few other things too, but I don't think that would have changed anything past base. I can make a full dump of everything if you think it'd help.

@Stanzilla Stanzilla added the 👆 Git Upstream issue in Git for Windows. label Oct 12, 2015
@rmorrin
Copy link
Contributor Author

rmorrin commented Oct 13, 2015

@variab1e Do you have everything as a portable Cmder install? It'd be awesome if you could post a version somewhere so I can test with my own vim configuration.

If not, I am happy to wait until Cmder updates to new releases of the relevant tools! 👍

@MartiUK
Copy link
Member

MartiUK commented Oct 13, 2015

@rmorrin We're working on it, watch this space.

@DanielGGordon
Copy link

So are we simply waiting for a Git update to fix this VIM issues, or is there something can be changed in Cmder/Conemu?

@MartiUK
Copy link
Member

MartiUK commented Oct 13, 2015

@DanielGGordon See @Maximus5's comment: #628 (comment)

@erichiller
Copy link

@rmorrin sorry for the delay, yep I am uploading my directory right now good idea anyways, because it took me about 2 weeks of tinkering to get it working the way I wanted it.

I re-wrote a bunch of the scripts around powershell and cmd.exe as well as ssh-agent.

Plus you'll probably find a bunch of ridiculous comments and backup files in there, sorry! It wasn't cleaned for public consumption. But if it helps it was worth it.

@rmorrin
Copy link
Contributor Author

rmorrin commented Nov 13, 2015

@variab1e Unfortunately I was still seeing the same problem with your modified Cmder install.

However, I have noticed that replacing the vim executable in vendor\git-for-windows\usr\bin with the 'Win32 console executable' from Vim's download page fixes the colours (but unfortunately introduces other issues). Presumably this is to do with the reason mentioned in Maximus5's comment.

@Maximus5
Copy link
Contributor

but unfortunately introduces other issues

What issues exactly?

@erichiller
Copy link

@rmorrin I would definitely recommend trying the updated repo I have, I've done 10-11 revisions since then. I believe I have that fixed pat.

@rmorrin
Copy link
Contributor Author

rmorrin commented Nov 17, 2015

@Maximus5 I only tested briefly, but noticed the following:

  • Cursor not displaying in both normal and insert mode
  • Ignoring syntax files in ~/vimfiles/syntax/ seems to be searching for them in the same folder as the executable (see below).
    Vim messages

@variab1e Thanks, I'll be sure to try it out!

@Maximus5
Copy link
Contributor

@rmorrin
Of course different builds of vim behaves differently. For example cygwin version requires \n as line delimiter, official one accepts \r\n. Paths and names of config files are affected to (.vimrc, _vimrc and so on).

As for cursor, show the StatusBar which cmder hides. (yeah, it takes so many space and user do not need to know what happens with their terminal, grrr).
StatusBar shows what happens with your cursor. I suppose, your vim is configured so the cursor is vanished from screen.

@erichiller
Copy link

@rmorrin Yes, I believe I have definitely fixed everything you are talking about. It is nothing with conemu - but rather settings and the associated suite of surrounding software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👆 Git Upstream issue in Git for Windows.
Projects
None yet
Development

No branches or pull requests

8 participants