You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to suggest a feature for Cmder Powershell story:
profile.ps1 is doing prompt tuning by defining function global:prompt which is a normal powershell way of tuning prompts. Unfortunately there is no extension points added to a current fine-tuned prompt.
So if user wants to add extra customization or some hooks to their prompt via user-profile.ps1 (like persistent history and other neat tricks) - it's impossible as the only thing one can do is to override global:prompt and loose all cmder neat customization.
I'd like to provide few simple function hooks - which user can define in user-profile.ps1 but they will be executed in each prompt call.
I'm using this technique for awhile and found it pretty convenient, as well as nice performing -
Invoke-Expression doesn't add much overhead compared to the direct function call. I quickly smoke measured it with Measure-Command before PR and saw that it adds about
0.001 to 0.003 secs compared to direct invocation of the function which measured, with an empty function, to ~0.008)
So in overall this technique adds from 0.003 to 0.009 sec overhead (3 to 9 milliseconds) which is unnoticeable by a normal user.
The text was updated successfully, but these errors were encountered:
I'd like to suggest a feature for Cmder Powershell story:
profile.ps1
is doing prompt tuning by definingfunction global:prompt
which is a normal powershell way of tuning prompts. Unfortunately there is no extension points added to a current fine-tuned prompt.So if user wants to add extra customization or some hooks to their prompt via
user-profile.ps1
(like persistent history and other neat tricks) - it's impossible as the only thing one can do is to overrideglobal:prompt
and loose all cmder neat customization.I'd like to provide few simple function hooks - which user can define in
user-profile.ps1
but they will be executed in each prompt call.I'm using this technique for awhile and found it pretty convenient, as well as nice performing -
Invoke-Expression doesn't add much overhead compared to the direct function call. I quickly smoke measured it with Measure-Command before PR and saw that it adds about
0.001 to 0.003 secs compared to direct invocation of the function which measured, with an empty function, to ~0.008)
So in overall this technique adds from 0.003 to 0.009 sec overhead (3 to 9 milliseconds) which is unnoticeable by a normal user.
The text was updated successfully, but these errors were encountered: