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

Added Setting to change Admin text in window title. #538

Merged
merged 1 commit into from
Apr 20, 2018

Conversation

nebosite
Copy link

@nebosite nebosite commented Jan 18, 2018

Also moved the logic for this into write-gitstatus, so all of the title logic is together

Closes #537

Copy link
Owner

@dahlbyk dahlbyk left a 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.

@@ -112,10 +113,6 @@ $global:GitPromptSettings = [pscustomobject]@{
TruncatedBranchSuffix = '...'
}

$isAdminProcess = Test-Administrator
Copy link
Owner

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.

Copy link
Owner

@dahlbyk dahlbyk left a 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)

$isAdminProcess = Test-Administrator

$adminHeader = if ($isAdminProcess) { 'Administrator: ' } else { '' }
$isAdminProcess = Test-Administrator
Copy link
Owner

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.

@rkeithhill
Copy link
Collaborator

@nebosite Which version of PowerShell are you using? You can check with $PSVersionTable.PSVersion. If you are on v5 or higher, would you be interested in moving to posh-git 1.0.0 (currently in beta) to get this feature?

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.

@rkeithhill
Copy link
Collaborator

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.

@dahlbyk
Copy link
Owner

dahlbyk commented Apr 20, 2018

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
@dahlbyk dahlbyk added this to the v0.7.2 milestone Apr 20, 2018
@dahlbyk dahlbyk merged commit db46cdb into dahlbyk:master Apr 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants