-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
Skip the ConsoleMode hack for new Windows versions #637
Comments
That's a good idea. I'm looking into it. I wonder what happens if you run your console in legacy mode though. |
After pondering about this for a while I actually don't think that this is achievable by removing the But I found another way: I took the liberty to remove unused C# code and was thus able to remove more code than I added. |
That might be part of the solution but not the whole solution. Another option for creating a DLL would be to just do that as part of the module build process but I don't think we need to go there yet. I've got a PR planned for later tonight that should address this if one of my assumptions is correct. :-) |
On PS Core, do not set the console mode at all. PS Core, since the release of 6.0.0 has handled setting/resetting the console mode, so no need for posh-git to do this. This speeds up module import by ~.5 to .7 seconds on PSCore and by ~150-200 msecs on Windows PowerShell. Fix #637
…, do not set the console mode at all.PS Core, since the release of 6.0.0 has handled setting/resetting theconsole mode, so no need for posh-git to do this.This speeds up module import by ~.5 to .7 seconds on PSCore and by~150-200 msecs on Windows PowerShell.Fix #637
…, do not set the console mode at all.PS Core, since the release of 6.0.0 has handled setting/resetting theconsole mode, so no need for posh-git to do this.This speeds up module import by ~.5 to .7 seconds on PSCore and by~150-200 msecs on Windows PowerShell.Fix #637
System Details
Issue Description
Thank you for this wonderful project!
Sadly though I'm a bit dissatisfied with the startup speed (1000-1300ms) and tried improving the situation.
While doing so I realized that if I remove these 2 lines:
posh-git/src/posh-git.psm1
Line 5 in 653101c
posh-git/src/GitPrompt.ps1
Line 847 in 653101c
everything still works as it used to - including ANSI escape codes!
But now startup time is reduced by 30-50% down to around 500-600ms!
Could this be because in the newest Windows versions
HKCU:\Console\VirtualTerminalLevel
is1
by default now? Because I personally don't have that registry key set at all.If we could add some kind of check for this we could skip running the expensive ConsoleMode hack, no-op the
Set-ConsoleMode
function and thus significantly improve startup time.I'm fairly inexperienced in proper PowerShell scripting and thus I don't have a proper idea how we can do this in a backwards-compatible way, but I'm happy to help wherever I can. 🙂
The text was updated successfully, but these errors were encountered: