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

VI/VIM very unresponsive after upgrading to Git 2.8.0.windows.1 #618

Closed
angularsen opened this issue Apr 1, 2016 · 10 comments
Closed

VI/VIM very unresponsive after upgrading to Git 2.8.0.windows.1 #618

angularsen opened this issue Apr 1, 2016 · 10 comments

Comments

@angularsen
Copy link

Git version before upgrade: Not sure, likely around 2.6.x
ConEmu versions tried: 1508??g (stable), 160301 (preview), 160329 (alpha)

Repro:

  1. It takes many seconds for the initial VIM help menu to show, it takes many seconds to respond to :q or keypresses in general, and sometimes does not seem to respond at all. Have to close tab in ConEmu and create a new tab to "fix it", but same problem occurs when entering vi/vim next time.
  2. Seeing the same with Real Console enabled.
  3. vi/vim is fast when run in Git Bash application, outside ConEmu

In animation I create a new git bash tab, open vim, then after a few seconds I hit ctrl+C and a few other key presses to try to get it to show vim info screen. Then I try to insert text, but it really does not respond after a number of i key presses and trying to type anything.

Any ideas? What else can I provide you with? Logs, dumps etc.

image

@Maximus5
Copy link
Owner

Maximus5 commented Apr 1, 2016

The only idea - I can't fix bugs of third-party applications. Why you all, folks, feel certain that ConEmu is responsible for all third-party problems and bugs???

https://conemu.github.io/en/ThirdPartyProblems.html

Just run from Win+R the following

git-cmd.exe --no-cd --command=usr/bin/bash.exe -l -i

Run vim, and say "Thanks for regression".

This issue tracker is absolutely wrong place to report that!

@angularsen
Copy link
Author

I understand your frustration, really, but the reason I went here is that I could only reproduce this in ConEmu, as per my bullet point 3. Please understand that many of us users of ConEmu have very little knowledge of how everything works together. I did read that link you posted, prior to creating the issue, but still didn't realize this was not a ConEmu issue for sure. Just trying to explain my point of view, no criticism intended.

@angularsen
Copy link
Author

Thank you for the command to try out, that really highlights where the problem lies.

@Maximus5
Copy link
Owner

Maximus5 commented Apr 1, 2016

I understand that. But how and where can I explain the fact?

https://conemu.github.io/en/ThirdPartyProblems.html#mintty

@angularsen
Copy link
Author

You have documented things well and it was very helpful to have a contribution guideline, but I did experience it a bit too much information and effort in the context of just reporting a bug, so I wound up skimming the information and failed to recognize that my problem was outside of ConEmu. I do take blame for not reading everything properly, but I also think the information can be improved a bit to make it easier to understand this scenario for other users reporting similar bugs in the future.

Here are some changes that might have helped me pick up on things earlier:

Contribution guideline article

Very good, I did skim through this and found the Third Party article that way, but still didn't fully grasp Git Bash application vs. Mintty vs Standard Windows Terminal vs ConEmu. Especially terms like terminal and mintty have confused me a lot earlier, but have not had much incentive to learn more about them until now so I failed to see how they were relevant.

Under Reporting issues, I think the single sentence and link to Third Party software could be improved. It seems a bit unimportant the way it is written, and I also first thought it was about plugins and such.

Here is what I propose:
Add Verify issue really originates from ConEmu as the first sub-section under Reporting Issues

  • Short description of how 90% of reported bugs are really a bug in the console application
  • List 2-3 relevant examples that you frequently see, such as what console app was run, what was the symptom, and what command could they run to verify the problem was outside ConEmu.

To me at least, it would be very relevant to see the Git for Windows example listed here, as well as the command to reproduce c:\Program Files\Git\git-cmd.exe --no-cd --command=usr/bin/bash.exe -l -i.

Hope this helps. Thanks for the awesome software!

@Maximus5
Copy link
Owner

Maximus5 commented Apr 2, 2016

How about this?

  • Verify issue really originates from ConEmu!

    If you catch a bug in the Adobe Reader you would not report it
    on Microsoft Connect because you run Reader in Windows, would you?

    ConEmu is terminal,
    if console application
    (bash, vim, cmd, whatever) gives out broken output, ConEmu can't
    magically correct this broken output.

    Do not compare you console application behavior with mintty!
    A lot of users say ‘It works in cygwin’ or ‘It works in git bash’.
    Wrong! Both are just a software packages, and you run console utilities
    (bash, vim, git) in the POSIX compatible
    terminal mintty. Bad news though, mintty is not compatible with
    Windows console API.

    So, each cygwin or msys (git-bash) console application has two branches of code,
    and obviously, they behaves differently when they were started from mintty
    and from standard Windows console.

    Of course, if the branch of code, which utilizes Windows console API,
    has bugs, they would not be observed in mintty. So, run your console
    tool from Win+R directly, without mintty wrapper.

    Read more information in the article:
    third-party software.

@angularsen
Copy link
Author

This is good. Here are some additional suggestions:

TLDR; Run the exact same console application and arguments as in your ConEmu task to reproduce outside ConEmu. If you are able to reproduce, then the problem is NOT with ConEmu.
Having problems with vim in Git bash? Go to settings, find {Bash::Git bash} task and find the command: "%ConEmuDir%\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i, then run this in Win + R and then run vim from there.

If you catch a bug in the Adobe Reader you would not report it
on Microsoft Connect because you run Reader in Windows, would you?

ConEmu is a terminal (console window), so if a console application (bash, vim, cmd, ...) gives broken output or interaction, ConEmu can't magically correct this.

A lot of users say ‘It works in cygwin’ or ‘It works in git bash’.
Wrong! Both are just a software packages, and you run console utilities
(bash, vim, git) in the POSIX compatible
terminal mintty. Bad news though, mintty is not compatible with
Windows console API.

Here is a table that illustrates how for example running Windows shortcuts for Git Bash or Git CMD differs from running Git bash and other tasks in ConEmu:

What Terminal / Console window Console application CLI command
dir in ConEmu {cmd} ConEmu.exe cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd" dir
ls in ConEmu {PowerShell} ConEmu.exe powershell.exe ls
ls in ConEmu {Git bash} ConEmu.exe "%ConEmuDir%\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i ls
dir in Git for Windows git-cmd.exe "C:\Program Files\Git\git-cmd.exe" --cd-to-home dir
ls in Git for Windows mintty.exe "C:\Program Files\Git\git-bash.exe" --cd-to-home ls
Example: #618 VI/VIM very unresponsive after upgrading to Git 2.8.0.windows.1
  • vim was reported to run just fine in Git Bash shortcut, so the user reasoned the bug must be related to ConEmu
  • Author explained that running Git Bash shortcut is not sufficient to reproduce outside ConEmu. You need to run the exact same command as ConEmu does, by looking at the {Bash::Git bash} task.

Processes as seen in task manager:

What Name Description Command line
Git Bash shortcut mintty.exe Terminal usr\bin\mintty.exe -o AppID=GitForWindows.Bash -o RelaunchCommand="C:\Program Files\Git\git-bash.exe" -o RelaunchDisplayName="Git Bash" -i /mingw64/share/git/git-for-windows.ico /usr/bin/bash --login -i
{Git Bash} in ConEmu git-cmd.exe Git for Windows "C:\Program Files\ConEmu\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i
Git CMD shortcut git-cmd.exe Git for Windows "C:\Program Files\Git\git-cmd.exe" --cd-to-home
{cmd} in ConEmu git-cmd.exe Git for Windows "C:\Program Files\ConEmu\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i

Do not compare you console application behavior with mintty!
A lot of users say ‘It works in cygwin’ or ‘It works in git bash’.
Wrong! Both are just a software packages, and you run console utilities
(bash, vim, git) in the POSIX compatible
terminal mintty. Bad news though, mintty is not compatible with
Windows console API. [... rest of your text... ]

Read more:
https://conemu.github.io/en/ThirdPartyProblems.html
https://conemu.github.io/en/ConsoleApplication.html
https://conemu.github.io/en/TerminalVsShell.html

@Maximus5
Copy link
Owner

Maximus5 commented Apr 2, 2016

I'm confused. Do you suggest to reject my version and write your text in CONTRIBUTING.md? What for was your table with dir and ls comparison?

Also, running the command from task in Win+R would do nothing in most of cases, because ConEmuDir is not declared in OS scope: "%ConEmuDir%\..\Git\git-cmd.exe" .... That also may confuse users...

@angularsen
Copy link
Author

I agree, reading back on it, it definitely does not simplify things. I started simple, then it grew overboard.

  1. The purpose of table 1 was to try to help understand why Git Bash shortcut differs from Git Bash in ConEmu, especially that mintty is used as terminal. But the point does not really come across well. I do think table 2 serves that purpose better, at least for me.

Here is an updated full text suggestion. I've skipped formatting and links as I was not able to copy that easily.

Verify issue really originates from ConEmu!

If you catch a bug in the Adobe Reader you would not report it on Microsoft Connect because you run Reader in Windows, would you?

A lot of users say ‘It works in cygwin’ or ‘It works in git bash’, but since both of them uses the mintty terminal, it can exhibit different behavior. Read more in Do not compare with Cygwin or Git Bash.

TLDR;

Run the exact same console application and arguments as in your ConEmu task to reproduce outside ConEmu. If you are able to reproduce, then the problem is NOT with ConEmu.

Understand how ConEmu works

ConEmu is just a terminal (also called console window) that runs console apps. Often these are CLI apps, such as CMD, Powershell, and Git Bash, but it can be any standard Windows console application.

ConEmu shows the output of console applications and passes keyboard/mouse events to the app. That is more or less it.

Do not compare with Cygwin or Git Bash

A frequent misunderstanding is seeing buggy behavior running Git Bash in ConEmu, then comparing that with either Cygwin or running Git Bash outside ConEmu. This is not the same thing!

Both are just a software packages, and you run console utilities (bash, vim, git) in the POSIX compatible terminal mintty, but mintty is not compatible with Windows console API.

So, each Cygwin or msys (git-bash) console application has two branches of code, and obviously, they behaves differently when they were started from mintty and from standard Windows console.

Of course, if the branch of code, which utilizes Windows console API, has bugs, they would not be observed in mintty. So, run your console tool from Win+R directly, without mintty wrapper.

Read more information in the article: third-party software

Example: #618 VI/VIM very unresponsive after upgrading to Git 2.8.0.windows.1
  • vim was unresponsive in ConEmu's Git Bash
  • vim worked just fine when running Git Bash shortcut, so the user reasoned the bug must be related to ConEmu
  • Author explained you need to run the exact same command as ConEmu does, to avoid running with the mintty wrapper.
  • In {Bash::Git bash} task: "%ConEmuDir%\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i, which typically equals "C:\Program Files\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i
  • User then ran this in Win + R and then ran vim from there, and saw the same behavior - outside of ConEmu
Processes as seen in task manager:

To illustrate how running the Git Bash shortcut differs from running Git Bash inside ConEmu, take a look at the output from task manager. As you can see, mintty.exe is used for the shortcuts, while git-cmd.exe is used by ConEmu, skipping the mintty wrapper.

What Name Description Command line
Git Bash shortcut mintty.exe Terminal usr\bin\mintty.exe -o AppID=GitForWindows.Bash -o RelaunchCommand="C:\Program Files\Git\git-bash.exe" -o RelaunchDisplayName="Git Bash" -i /mingw64/share/git/git-for-windows.ico /usr/bin/bash --login -i
{Git Bash} in ConEmu git-cmd.exe Git for Windows "C:\Program Files\ConEmu\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i
Git CMD shortcut git-cmd.exe Git for Windows "C:\Program Files\Git\git-cmd.exe" --cd-to-home
{cmd} in ConEmu git-cmd.exe Git for Windows "C:\Program Files\ConEmu\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i
Read more:

https://conemu.github.io/en/ThirdPartyProblems.html
https://conemu.github.io/en/ConsoleApplication.html
https://conemu.github.io/en/TerminalVsShell.html

@angularsen
Copy link
Author

FYI, this was fixed just now in Git for Windows 2.8.1.

git-for-windows/git#711
https://git-scm.com/downloads

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants