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

Consider shorter WindowTitle for when we get a tabbed console in Windows 10 1809 #565

Closed
rkeithhill opened this issue Apr 19, 2018 · 3 comments

Comments

@rkeithhill
Copy link
Collaborator

rkeithhill commented Apr 19, 2018

With a tabbed console coming:

image

We should rethink our WindowTitle in 1.0.0 a bit:

image

I like that we put the PowerShell version/arch/pid info to the right. Folks should be able to hover over the tab and get a tooltip with that info. However the posh~git ~ will take up valuable, visible tab space. We should think about nuking that prefix and go with just:

image

Another thought - with a tabbed interface like this it might be handy to display the current working dir in the title but only when not in a repo e.g.:

image

Finally, I've been thinking about tweaking the Get-PromptPath function so that when DefaultPromptAbbreviateHomeDirectory is $true and you are in your home dir, you get the full path e.g. C:\Users\Keith. It is only when you go down a level that you get the ~ e.g. ~\GitHub\dahlbyk\posh-git. That would turn this somewhat odd looking prompt:

~
04-18 21:17:58 33ms 9>

into

C:\Users\Keith
04-18 21:17:58 33ms 9>

but still give me a shortened path in this case:

~\GitHub\dahlbyk\posh-git\src
04-18 21:17:58 33ms 9>
@dahlbyk
Copy link
Owner

dahlbyk commented Apr 19, 2018

However the posh~git ~ will take up valuable, visible tab space. We should think about nuking that prefix and go with just:

Agreed. Let's just drop it. (cc #538)

with a tabbed interface like this it might be handy to display the current working dir in the title but only when not in a repo

Even without a tabbed interface this seems useful.

Finally, I've been thinking about tweaking the Get-PromptPath function so that when DefaultPromptAbbreviateHomeDirectory is $true and you are in your home dir, you get the full path e.g. C:\Users\Keith. It is only when you go down a level that you get the ~ e.g. ~\GitHub\dahlbyk\posh-git.

Agree that just ~ is an odd prompt. It would make sense to switch to ~/... once you navigate into a subfolder, or we could switch to a length limit to condense the path name (e.g. #58). I could see the logic working something like...

  • If current folder is too long, show …\long-project-name
  • If path is too long and inside $Home, swap in ~
  • If path is still too long, include as many full directories as possible (…\dahlbyk\posh-git)

rkeithhill added a commit that referenced this issue Apr 20, 2018
Modify Get-PromptPath to return full dir when path is equal to $Home.
It will use ~ when path is in a subdir *under* $HOME.

This does not address other path shortening techniques.
We could do those in this PR or another one.

Fixes #565
@rkeithhill
Copy link
Collaborator Author

rkeithhill commented Apr 20, 2018

@dahlbyk PR #567 addresses the primary issue here. Do you want to tackle the modification to Get-PromptPath to elide paths? If you don't have time, I'll take a crack at it in a separate PR.

@dahlbyk
Copy link
Owner

dahlbyk commented Apr 20, 2018

Separate PR is fine, whoever gets there first. Good TDD exercise. 😁

rkeithhill added a commit that referenced this issue Apr 20, 2018
Modify Get-PromptPath to return full dir when path is equal to $Home.
It will use ~ when path is in a subdir *under* $HOME.

This does not address other path shortening techniques.
We could do those in this PR or another one.

Fixes #565
dahlbyk pushed a commit that referenced this issue Apr 20, 2018
Modify Get-PromptPath to return full dir when path is equal to $Home.
It will use ~ when path is in a subdir *under* $HOME.

This does not address other path shortening techniques.
We could do those in this PR or another one.

Fixes #565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants