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

Remove appended version information from window title? #735

Closed
ransagy opened this issue Jan 30, 2020 · 3 comments
Closed

Remove appended version information from window title? #735

ransagy opened this issue Jan 30, 2020 · 3 comments

Comments

@ransagy
Copy link

ransagy commented Jan 30, 2020

System Details

  • posh-git version/path: 1.0.0.0 beta3x C:\Code\posh-git\src
  • PowerShell version: 6.2.4
  • git version 2.25.0.windows.1
  • OS: Microsoft Windows NT 10.0.18363.0

Issue Description

Adding posh-git to my profile makes the window title for Powershell windows end in the "Powershell 6.2.4 64-bit (PROCESS_ID_HERE)" suffix. I tried investigating a little inside the scripts but didn't find anything specific. Is this known/on purpose? is there a way to remove it? It makes the titles very long which is a bit of a problem in some scenarios (tab titles in Windows Terminal, for example).

@rkeithhill
Copy link
Collaborator

rkeithhill commented Jan 30, 2020

You can customize the title bar setting in several ways. To disable posh-git changing it:

$global:GitPromptSettings.WindowTitle = $false

or to modify it:

$global:GitPromptSettings.WindowTitle = {
    param($GitStatus, [bool]$IsAdmin)
    "PS $($PSVersionTable.PSVersion.Major).$($PSVersionTable.PSVersion.Minor)"
}

Put either one of those in your profile script after posh-git is imported.

Also, if you're using the latest Windows Terminal with tabWidthMode set to equal the long titles won't make the tab excessively wide and you can still see the title by hovering over it. Or by executing $host.UI.RawUI.WindowTitle.

The purpose for the change is to show posh status info in the title bar when in a Git dir.

@ransagy
Copy link
Author

ransagy commented Jan 30, 2020

Ah! I swear i looked for those strings and somehow missed them.
I'll just redefine the function without the version/bitness info and leave the rest as-is.
Thanks!

@ransagy ransagy closed this as completed Jan 30, 2020
@dahlbyk
Copy link
Owner

dahlbyk commented Mar 15, 2020

Note the default title is shorter as of #707

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

No branches or pull requests

3 participants