mottosso / bleeding-rez

Rez - Reproducible software environments for Windows, Linux and MacOS
GNU Lesser General Public License v3.0
72 stars 10 forks source link

Powershell prompt is very limited #94

Closed salvaom closed 4 years ago

salvaom commented 4 years ago

Issue

Currently PowerShell's prompt has hard-coded " on the code (self._addline('Function prompt {"%s"}' % self.settings.prompt)) which prevents more advanced prompt commands to be used, for example:

(from https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_prompts?view=powershell-7)

function prompt {
    $(if (Test-Path variable:/PSDebugContext) { '[DBG]: ' }
      else { '' }) + 'PS ' + $(Get-Location) +
        $(if ($NestedPromptLevel -ge 1) { '>>' }) + '> '
}

Solution (?)

Add a configuration value to determine whether to add " to the PS prompt function contents, this way maintains compatibility with previous configurations but users that want more out of the default prompt can customize it further.

mottosso commented 4 years ago

Have a look at $profile, which is the startup script for Powershell prompts.