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

It should be easier to specify bold in various path parts #650

Closed
lzybkr opened this issue Dec 13, 2018 · 3 comments
Closed

It should be easier to specify bold in various path parts #650

lzybkr opened this issue Dec 13, 2018 · 3 comments

Comments

@lzybkr
Copy link
Collaborator

lzybkr commented Dec 13, 2018

System Details

  • posh-git version/path: 1.0.0-beta2
  • PowerShell version: 5.1
  • Git version: not relevant
  • Operating system name and version: Windows 10 1809

Issue Description

It should be easy to specify that parts of my prompt (e.g. the path) are in bold. In some consoles like http://github.com/jwilm/alacritty - bold looks really nice.

I noticed CustomAnsi is an option and it works, but it is less friendly.

For some motivation, Here is a side by side comparison of the differences:

image

The left side (11-15) is conhost, the right side (39-42) shows alacritty as well as the settings. Both windows are using roughly the same font (Fira Code, but different sizes - as similar as I could make it look.)

At any rate, the point is that bold might not be that interesting for conhost, but it is definitely interesting for other consoles.

@rkeithhill
Copy link
Collaborator

We are actually in the process of dropping CustomAnsi and allowing you to specify VT seqs in the Text, FG and BG fields e.g..:

$GitPromptSettings.DefaultPromptPath.ForegroundColor = "`e[1;96m"

Or you could do this:

$GitPromptSettings.DefaultPromptPath.Text = "`e[1;96m" + $GitPromptSettings.DefaultPromptPath.Text

It felt more flexible to allow putting VT seqs in the Text field as this gives you even more color control:

function Test-Administrator { $true }

$GitPromptSettings.DefaultPromptPrefix.Text =
    "`$(if (global:Test-Administrator) {`"$([char]27)[37m^`"})" +
    "$([char]27)[33m`${env:USERNAME}@$([char]27)[95m`${env:COMPUTERNAME}$([char]27)[90m:" +
    "$([char]27)[94m`$(Get-PromptPath)$([char]27)[90m:" +
    "$([char]27)[35m`$(Get-Date -Format `"d-MMM HH:mm:ss`")$([char]27)[90m:"

@lzybkr
Copy link
Collaborator Author

lzybkr commented Dec 14, 2018

Ah, that's the reasoning I used in PSReadLine colors too - dropping the Foreground/Background options.

Feel free to close, just make sure to call out the breaking change between beta releases because at you now know at least 1 person is using CustomAnsi.

@dahlbyk
Copy link
Owner

dahlbyk commented Dec 17, 2018

It would be interesting to have a PowerShell module for constructing VT sequences (e.g. chalk), rather than add more formatting smarts to posh-git.

I'm going to go ahead and close this, since #616 (removing CustomAnsi) would compose well with such a helper.

@dahlbyk dahlbyk closed this as completed Dec 17, 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

No branches or pull requests

3 participants