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

ConEmu long delay on Ctrl+C with GitBash #402

Closed
raulmatei opened this issue Oct 31, 2015 · 43 comments
Closed

ConEmu long delay on Ctrl+C with GitBash #402

raulmatei opened this issue Oct 31, 2015 · 43 comments

Comments

@raulmatei
Copy link

I have recently updated to latest versions of ConEmu & Git for Windows. I noticed that Ctrl+C keyboard shortcut is freezing the console for a while, and then suddenly it stops the current process. I usually use it for running NPM/Node.js related tools.

Using GitBash outside of ConEmu, Ctrl+C works as expected. It also works with CMD or PowerShell.

I have uploaded logs here

@Maximus5
Copy link
Owner

Compare the behavior with previous ConEmu build.

@raulmatei
Copy link
Author

I have build 140814 on my laptop and it stops the process instantly with the same version of mintty (that comes with latest Git for Windows). Do you have a specific build in mind?

@Maximus5
Copy link
Owner

There is no version 814.
Please go to release archives and check which breaks the behavior.
Of course, it must be done on the same machine with same config.

@raulmatei
Copy link
Author

I mean https://github.com/Maximus5/ConEmu/releases/tag/v14.08.14 - I never updated it on my laptop so that's why it's so old.

Ok, I'll try with every build until I find one that works. Thanks!

@Maximus5
Copy link
Owner

I see... Try to jump by month

@raulmatei
Copy link
Author

I'm back, 150908 seems to be working fine. It only froze once after a restart. Here you can find logs for three different version including 150908.

Thanks.

@Maximus5
Copy link
Owner

Why do you mention mintty in the subject?

@raulmatei
Copy link
Author

Because I thought that that's the terminal emulator which is being used, but I see now that the command points to bash "%ConEmuDir%\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i

@raulmatei raulmatei changed the title ConEmu long delay on Ctrl+C with GitBash (mintty 2.0.3) ConEmu long delay on Ctrl+C with GitBash Oct 31, 2015
@raulmatei
Copy link
Author

I edited the title to remove any haziness for other users.

@Maximus5
Copy link
Owner

Maximus5 commented Nov 1, 2015

It's unclear, what is the problem - freezes, stops, smth else? May you create a short video?

Can you confirm that build 150908 is OK, and 151006 introduced the problem?

@raulmatei
Copy link
Author

Hi, sorry if I was unclear but I'll try to explain as thorough as I can:

Steps:

  1. Open ConEmu
  2. Start a GitBash console (e.g. "%ConEmuDir%\..\Git\git-cmd.exe" --no-cd --command=usr/bin/bash.exe -l -i)
  3. run npm install command in a project with a large number of dependencies (you can find a open source project on GitHub - pick this one if you want: https://github.com/erikras/react-redux-universal-hot-example)
  4. while the process is running, try to stop it using Ctr+C keyboard shortcut

Expected result:

  • process stops and you can use the console to do other stuff

Actual result:

  • process stops but after a long delay and the current console is not usable

ConEmu 150908 [64] seems to work for me on multiple devices. The latest builds on which I can reproduce the issue were tested on all devices and the above problem was reproducible on all of them.

Thanks,
Raul.

@EvHaus
Copy link

EvHaus commented Nov 9, 2015

I have the same issue with Cygwin console. The delay is about 2 minutes from when I press Ctrl+C on my node.js app and when it quits.

@benjaminRomano
Copy link

I'm also having the same problem.
When using Con Emu, Git bash will occasionally hang for ~30 seconds after pressing Ctrl-C.

@Maximus5
Copy link
Owner

  1. Update to build 151109 at least, run ConEmu -log, reproduce the problem, and upload LogFiles.
  2. What do you mean by "hang" exactly? Screenshots or video may help.
  3. It would be nice to get MemoryDumps (mini at least) of all process tree at "hang" moment (ConEmu/ConEmuC/git/whatever).

@benjaminRomano
Copy link

I've been able to reproduce the problem consistently by holding down ctrl-c. However, there have been instances where just pressing ctrl-c once has caused this issue.

Logs:
ConEmu-gui-10340.txt
ConEmu-input-10320.txt
ConEmuC64-size-10320.txt

By hang, I mean the git bash instance will not take any input and the prompt doesn't appear until about 30 seconds after I've pressed ctrl-c.

The screenshot below shows that there is no prompt after pressing ctrl-c.
image

@raulmatei
Copy link
Author

Hi,

I have captured a video, you can find it here.
There are 2 annotations first one when I pres Ctrl+C and the second one when the process stops.

There are also two more attempts, the second time it looks like it worked instantly but then the third attempt it also takes some time to end the process.

Some dumps here ... I'm not good at debugging windows app, if they are not useful please let me know and I'll try again.

@Maximus5
Copy link
Owner

This complain must be addressed to NPM/Node.js authors.

I've examined the logs, your Ctrl+C events are successfully delivered to console processes, immediately.

However, there is action to "Terminate all but shell processes in the current console". Personally I set it to Ctrl+X and use it often. But it really terminates processes, they will not receive any signals.
https://conemu.github.io/en/SettingsHotkeys.html

@Maximus5 Maximus5 reopened this Nov 17, 2015
@Maximus5
Copy link
Owner

Or may be not... confused by different reporters and dumps.

  • Do you have option "Inject ConEmuHk" enabled?
  • Does active process stop by Ctrl+C immediately?
  • To be sure, I need full memory dumps (mini is not enough), LogFiles and screenshots (or with status bar.

@Maximus5
Copy link
Owner

Perhaps, something blocks your prompt, but I don't think it's a ConEmu problem. You may try to use ProcessMonitor to check console processes activities.

@benjaminRomano
Copy link

It looks like the reason why conemu hangs after using ctrl+c on some node commands is that a process will be blocking. In my case it was sh.exe that was still running. Using kill active process fixes that problem. So that's not a problem on your end.

However, in the case of just holding down ctrl+c on a blank prompt that still causes the git bash instance to hang. I have inject conemuHk enabled, and the status bar shows the active process is bash.exe.

@Maximus5
Copy link
Owner

So, pressing Ctrl+C in bash prompt may cause other processes spawning. That's because bash prompt may be very complex, especially if you show git properties there.
Anyway, It's hard to believe that this issues relates to ConEmu and can't be reproduced in the real Windows console

@Maximus5
Copy link
Owner

I propose to close the issue, because it's not related to ConEmu itself.
Also, there is cygwin connector nowadays.

@tshemsedinov
Copy link

npm install and npm publish hangs conemu without pressing Ctrl+C, just running those commands for any package in any case hangs current tab and I need to close tab. Problem is actulal for version 151210 but everything works fine in version 150813d.

@Maximus5
Copy link
Owner

Without exact dumps and screeshots "hangs" are not accepted.
Nobody can reproduce some abstract bug occured in abstract environment.
https://conemu.github.io/en/BadIssue.html

@tshemsedinov
Copy link

@Maximus5 I see, I'll try to provide instructions to reproduce it, that's why I did not create an issue and wrote just a comment in nearest one. But I think that npm started to use such esc sequences to draw progress bar which are not supported or so. Ctrl+C is not a reason of hanging. Those npm commands which do not display progress works fine for me.

@jeffijoe
Copy link

jeffijoe commented Mar 8, 2016

Same issues for me, at times Ctrl+C just refuses to work and I have to go Kill active process.

This happens both when running e.g. npm install, and when running tests/watchers - e.g. mocha or gulp.

@Maximus5
Copy link
Owner

Maximus5 commented Mar 8, 2016

@jeffijoe As I said before, that is NOT a ConEmu issue!
https://conemu.github.io/en/ThirdPartyProblems.html

@jeffijoe
Copy link

jeffijoe commented Mar 8, 2016

@Maximus5 When done through the actual git bash it works every time.

@Maximus5
Copy link
Owner

Maximus5 commented Mar 8, 2016

I do not believe in that. How exactly do you start that what you named "git bash"?

@jeffijoe
Copy link

jeffijoe commented Mar 8, 2016

It's C:\Program Files\Git\git-bash.exe for the regular one outside ConEmu, but my ConEmu task for Git Bash is:

""C:\Program Files\Git\bin\sh.exe" --login -i"

@Maximus5
Copy link
Owner

Maximus5 commented Mar 8, 2016

When you run git-bash.exe it starts mintty.exe. Of course this is not a standard Windows terminal, when you run bash in standard Windows terminal bash behaves differently. So, why do you think that ConEmu must fix bash bugs?
https://conemu.github.io/en/CygwinMsys.html

@raulmatei
Copy link
Author

@Maximus5 is right, if you run C:\Program Files\Git\bin\sh.exe" -l -i from Windows Run (Win+R), and you'll get the same behaviour. The only way to make it stop is to Kill active process. I've assigned it to a keyboard shortcut and that's it. Probably this issue needs to be closed, for sure there's nothing to be done on ConEmu side.

@Maximus5
Copy link
Owner

Maximus5 commented Mar 8, 2016

I added a paragraph for mintty
https://conemu.github.io/en/ThirdPartyProblems.html#mintty

@Maximus5 Maximus5 closed this as completed Mar 8, 2016
@raulmatei
Copy link
Author

Have a look on this: git-for-windows/git#227

@Maximus5
Copy link
Owner

Maximus5 commented Mar 8, 2016

Yeah. The problem comes from different implementations of Ctrl+C processing in cygwin/msys applications. POSIX applications are ready to process "signals" in most cases, but often ignores console events.

@jeffijoe
Copy link

jeffijoe commented Mar 8, 2016

@raulmatei How did you assign the keyboard shortcut? I can't seem to find the right command to "Kill active process", only to terminate the current console.

@xylographe
Copy link
Contributor

@jeffijoe I think you want "Terminate active process in the current console" in Settings > Keys&Macro

@jeffijoe
Copy link

jeffijoe commented Mar 8, 2016

@xylographe that will kill the console tab as well, and so is not acting like "Close or kill -> Kill active process" does.

@Maximus5
Copy link
Owner

Maximus5 commented Mar 8, 2016

@jeffijoe that will not. Why do you think so?

@jeffijoe
Copy link

jeffijoe commented Mar 8, 2016

@Maximus5 Ah, it seems I was too fast - it killed bash after it killed node, I was just too impatient for node to die and so I pressed it again, killing the console.

@raulmatei
Copy link
Author

@xylographe is right, the command is "Terminate active process in the current console"
image

It should work perfectly.

@jeffijoe
Copy link

jeffijoe commented Mar 9, 2016

Yes, got it, thanks!

@Maximus5 thank you for such a great app!

@adamchenwei
Copy link

adamchenwei commented Apr 5, 2020

I guess many of us (me) got too spoiled by Mac, which Ctrl + C worked perfectly. all the time. but Windows... another realm ha. That shortcut @raulmatei screenshotted worked perfectly.

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

8 participants