Git Product home page Git Product logo

Comments (4)

Jaykul avatar Jaykul commented on June 12, 2024 1

I believe you can achieve this now with:

# Don't use a character as a separator at all
[PoshCode.Pansies.Entities]::ExtendedCharacters["ColorSeparator"]=""
# Set Colors to an array of more than two $null (and at least as many items as there are prompt scriptblocks)...
Set-PowerLinePrompt -Prompt {""},{ $pwd }, {"`n" }, { "╰>" } -Colors @(@($null) * 4)

But this is (as always) not well documented.

from powerline.

Riiskyy avatar Riiskyy commented on June 12, 2024

Thanks Jaykul that's done the trick. Although it has now opened up something else (again probable more related to my specific use of this module. But the text that goes on to a newline is i different colour to the rest of the prompt e.g.

image

This is the current contents of C:\Users\<Username>\AppData\Roaming\powershell\HuddledMasses.org\PowerLine\Configuration.psd1

@{
  EscapeSequences    = @{
    Esc    = '�['
    Store  = '�[s'
    Recall = '�[u'
    Clear  = '�[0m'
  }
  ExtendedCharacters = @{
    ColorSeparator        = ' '
    ReverseColorSeparator = ' '
    Separator             = ' '
    ReverseSeparator      = '|'
    Branch                = ''
    Lock                  = ''
    Gear                  = '⛯'
    Power                 = '⚡'
  }
  PowerLineConfig    = @{
    Prompt                 = @(
      (ScriptBlock 'New-PromptText {"╭"} -ErrorForegroundColor Red; if(Write-VcsStatus) {New-PromptText {""} -ForegroundColor Green -ErrorForegroundColor Red}'),
      (ScriptBlock '$executionContext.SessionState.Path.CurrentLocation'),
      (ScriptBlock 'New-PromptText {"|"} -ErrorForegroundColor Red'),
      (ScriptBlock 'Get-Elapsed -Format "{0:mm\:ss\.f}"; if(Get-Elapsed){ New-PromptText {"|"} -ErrorForegroundColor Red}'),
      (ScriptBlock 'Get-Date -f "dd-MMM HH:mm UTCz"'),
      (ScriptBlock '"`n"'),
      (ScriptBlock 'if(-not (Write-VcsStatus)) {New-PromptText {"╰>"} -ErrorForegroundColor Red} else{New-PromptText {"╰"} -ErrorForegroundColor Red; Write-VcsStatus; New-PromptText {">"} -ErrorForegroundColor Red}')
    )
    DefaultAddIndex        = -1
    RestoreVirtualTerminal = $True
    Title                  = (ScriptBlock '"PowerShell"')
    FullColor              = $True
    Colors                 = @(@($null) * 4)
  }
}

from powerline.

Jaykul avatar Jaykul commented on June 12, 2024

I can't tell why the color changed there ... this seems to work for me:

$CFG = @{
    Prompt                 = @(
      {New-PromptText {""} -ErrorForegroundColor Red; if(Write-VcsStatus) {New-PromptText {""} -ForegroundColor Green -ErrorForegroundColor Red}}
      {$executionContext.SessionState.Path.CurrentLocation}
      { New-PromptText {"|"} -ErrorForegroundColor Red }
      { Get-Elapsed -Format "{0:mm\:ss\.f}"; if(Get-Elapsed){ New-PromptText {"|"} -ErrorForegroundColor Red} }
      { Get-Date -f "dd-MMM HH:mm UTCz" }
      {"`n"},
      {
      if(-not (Write-VcsStatus)) {
         New-PromptText {"╰>"} -ErrorForegroundColor Red
      } else { 
         New-PromptText {""} -ErrorForegroundColor Red
         Write-VcsStatus; 
         New-PromptText {">"} -ErrorForegroundColor Red
      }
      }
    )
    RestoreVirtualTerminal = $True
    Title                  = {"PowerShell"}
    FullColor              = $True
    Colors                 = @(@($null) * 3)
}
Set-PowerLinePrompt @CFG
[PoshCode.Pansies.Entities]::ExtendedCharacters["ColorSeparator"]=""

image

from powerline.

Riiskyy avatar Riiskyy commented on June 12, 2024

Ok it must be something on my side then. I'll consider this closed, thank you

from powerline.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.