-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Lag returning to prompt (especially) in git repo #447
Comments
This is some problem with git, with that in mind could you just try to use some git command from a shell that isn't cmder/conemu. Just maybe commands like If git runs that fast it must be something in cmders prompt function trying to write the status line before returning. I've found having the git status line in the prompt does have a performance hit in the tenth of a second order you describe. Any prompt function that is not just a cmder thing. |
Hey Jack, thanks for the response. I opened Cmder and a standard windows Command Prompt and navigated to the same directory, results as follows: Windows Cmd: ~1 second delay before git status output appears, prompt reappears immediately This is consistent with the |
When the git prompt adds to the end of that line the branch / numbers e.g From what you describe I think you've got a slow git repository. You'd best find out how you could speed it up. I could just be sheer size. I'm sure there's some tweaks to make windows faster with git. To immediately speed that up you could remove the git parts of the prompt function cmder is calling. |
Learning some new stuff myself here, This first answer seems like some solid advice. Check the git manual first though to see what these commands really do to your repo. http://stackoverflow.com/questions/4485059/git-bash-is-extremely-slow-in-windows-7-x64 |
Thanks Jack, that is indeed the issue - applying the 3 settings mentioned in that SO question improved it quite a bit (I'd estimate the delay is down to 300-400ms from 1-1.5 seconds). I might look into removing the "git status" part of the prompt, as it is much more usable now, 300-400ms is still a bit much. Do you know if a setting exists for that? Or will I have to edit the source? Anyways, marking this as closed, as the call to git status explains the issue. Thanks! |
@Keilan you can try to replace |
I will try to add some kind of setting to flip this in the powershell side of the console for a future release. Probably not the next release though. At least git is faster now. |
I'd like to have an option to disable git showing anything on the prompt. It still slow on some occasions. |
I'd also like a way to disable git looking at my current repo as it gives me 30+ sec delay. It's a massive repo. I really don't care about it telling me i'm in the master branch. How can I disable any git stuff. I just want a command prompt. |
I'm in the same boat as @xseneque. I have a large repo where I'd really like to disable git integration. Is there any simple workaround for now, or do we have to wait for a release? |
After some searching, I've been able to remove git integration in the prompt, resulting in no lag when inputting commands in a git repo! The following modifications must be done to your On line 41, remove local cmder_prompt = "\x1b[1;32;40m{cwd}\n\x1b[1;30;40m{lamb} \x1b[0m" Comment out lines 266-267 to prevent git and mercurial plugins from running every time you press enter: --clink.prompt.register_filter(hg_prompt_filter, 50)
--clink.prompt.register_filter(git_prompt_filter, 50) As a note, you may want to back up this Hope this helps! |
@justaniles Awesome, that's exactly what I was looking for, thanks for the help! |
So what should the actual solution be here? If it should be per repo, we need to write something to the So something like this:
|
Thanks @justaniles ; works like a charm!! |
Hi guys, I have same problem... every git command spend a lot of seconds to end and return to input. I come back to windows cmd for now... I'm waiting for update. |
Is this post still the most up to date advice for this? Is there a configuration option to remove the SCM details from the prompt? |
In the traditional cmd with clink, there are two
So, instead of disabling git information in the prompt completely, some may prefer to just get rid of the detailed/coloured status, keeping the current branch info:
Kudos to #447 (comment) for inspiration. |
Note that this issue seems to be just as much of a problem for Mercurial as for git. Probably the above workaround (#447 (comment)) indicates why. |
Are there a different set of instructions for disabling the git status in a PowerShell prompt? Find myself using PS more than cmd.exe, but the fix provided in #447 doesn't seem to work for PS. |
@DGalt Try this
|
@mloskot perfect, thank you! |
Can the dev re-open this issue? It's still a problem and all 'fixes' here are overwritten on an update. This belongs somewhere in settings than hardcoded in a |
Just discovered cmder today and downloaded to try it out. Ran into this issue in a large git repo (not all repo's do this). Every command is slow returning to the lambda prompt in the repo not just git commands. Tried all these fixes to no avail. Other terminal types (::bash ::mintty ::Powershell) don't have this issue. Very frustrating, feel like I'm being trolled by the terminal. Otherwise very useful program (love the fact there's no install and its portable). |
@mloskot Solution works for me. Great thanks man. |
For me, commenting the
|
Yes, that snippet above needs refinement. Here is the current version I use:
The whole idea is to avoid the heavy call to |
The earlier tweak does not work for Cmder 1.3.11, but it should be easy to adjust the new versions of the For large repos with lots of submodules, like https://github.com/boostorg/boost/, these two tweaks are sufficient for me to greatly speed the git prompt: Simply, add Lines 221 to 222 in 89499f2
Lines 236 to 237 in 89499f2
|
Sorry guys, For sure |
Just to summarize the quick solution in 2019, this definitely solved my complaint with Cmder, that it took over 8 seconds every time I issued a command!
Now commands are responsive! Instantaneous! Thank you to: |
Re: @rohitkrishna094 's #447 (comment) This is certainly not a competition but that comment may leave one quite confused. AFAICT, the patch I presented in #447 (comment) produces this code
which, clearly, is the equivalent code to the code @TimRudy presented in #447 (comment)
@rohitkrishna094 I'd suggest you analyse the snippets more carefully, then you should avoid any disappointments. |
My bad, the diff had me confused. Would've been better if you included the output without diff in the first place. Either way thanks. And apologies. Have a nice day. |
@daxgames and @Stanzilla : Can you re-open this issue to fix the lag issue bug in cmder? Guessing most folks have switched to the new Windows Terminal app but folks still seem to be tripping over this 4 year old issue. Seems silly to block the prompt(=UI) over a long running task. Quickest solution would be to make git status opt-in by default instead of opt-out by kludgy .lua hacks. Even better, put long running tasks on a background thread. Blocking the UI is ... so 90s. |
@SidShetye is this related #2178. I have never actually seen this issue. |
@daxgames I doubt its related. This issue is specifically about You need sufficiently large repo to suffer from it. |
I can confirm that this will happen whenever GIT is slow, for whatever reason, not just big repositories. In my scenario, its a brand new repo with only 2 branches and 3 commits. Have you considered: https://github.com/romkatv/gitstatus ? Also for anyone else new to LUA, when I made a copy of my clink.lua file, at first I didn't change the file extension, and it seems it still got picked up and executed, meaning nothing got better at first! |
@mloskot please read carefully my issue, git + all other Linux cmds ({GIT path}/usr/bin) since cmder is using these cmds if git pre-exists. |
@hackhowtofaq I did read it and I keep my point that #2178 has nothing to do with the slowness of I have two different sets of Unix commands in my environment: Git's and GnuWin32. The |
@mloskot just clarifying. Disabling git status in clink somehow fixes external git in Powershell loaded in Cmder? Or any git, internal or external, in any shell loaded in cmder? |
@daxgames Disabling My apologies, I wasn't clear. In my earlier comment, I just wanted to explain that I don't see any connection To summarise, the problem we are discussing here is related to
|
@mloskot Thanks, thats what I thought.. Just wanted it to be clear. |
When using cmder with git (where it shows the name of my currently checked out branch next to the location), I'm finding that my commands are executed quickly but there is a major delay returning to the prompt so I can enter in another command. I notice this to some extent when I'm not in a git repo, but then the delay is almost not noticeable (100-200ms I'd guess), as opposed to 1-2 seconds in a repo.
To give further details, in my repo if I type
ls
, the file list comes up immediately, then the current tab changes from saying "cmd.exe" to "git.exe", and only after 1-2 seconds do I get a lambda prompt again where I can enter further commands.I'm running Windows 8.1 and cmder.exe is installed in Program Files. Let me know if any more details would be helpful.
The text was updated successfully, but these errors were encountered: