-
-
Notifications
You must be signed in to change notification settings - Fork 801
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
Added Setting to change Admin text in window title. #538
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than reusing $isAdminProcess
, this looks good.
src/GitPrompt.ps1
Outdated
@@ -112,10 +113,6 @@ $global:GitPromptSettings = [pscustomobject]@{ | |||
TruncatedBranchSuffix = '...' | |||
} | |||
|
|||
$isAdminProcess = Test-Administrator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value can't change in the context of a host instance, so let's keep this cached here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good, but I'm pondering if a bigger change to how we handle titles is appropriate: #537 (comment)
src/GitPrompt.ps1
Outdated
$isAdminProcess = Test-Administrator | ||
|
||
$adminHeader = if ($isAdminProcess) { 'Administrator: ' } else { '' } | ||
$isAdminProcess = Test-Administrator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing space! Feel free to fix and squash into a single commit.
@nebosite Which version of PowerShell are you using? You can check with I'm just wondering if the fix that is on the v1 branch is worth porting to v0.7x. If you could move to v1, then I recommend we skip applying this fix to v0.7x (in which case we can close this issue as fixed by PR #541) . Part of the point of v1 is to provide richer prompt customization. |
If we merge this into the 0.x branch we should not merge that to 1.x branch. We have a different mechanism in 1.x that accomplishes the same goal. |
This setting will disappear as part of resolving the merge conflict. |
Also move the logic for this into write-gitstatus, so all of the title logic is together
Also moved the logic for this into write-gitstatus, so all of the title logic is together
Closes #537