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

WIP allow prompt char > to reflect nesting level. #363

Merged
merged 1 commit into from
Jan 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GitPrompt.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ $global:GitPromptSettings = New-Object PSObject -Property @{

EnableWindowTitle = 'posh~git ~ '

PromptSuffix = '> '
PromptDebugSuffix = ' [DBG]>> '
PromptSuffix = '$(''>'' * ($nestedPromptLevel + 1)) '
PromptDebugSuffix = ' [DBG]$(''>'' * ($nestedPromptLevel + 1)) '

Debug = $false

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ This gives us a prompt with a current path that is never greater than 40 charact
[rkeithhill/more-readme-tweaks +0 ~1 -0 | +0 ~1 -0 !] ...sers\Keith\GitHub\rkeithhill\posh-git
> _
```
For more in-depth information on PowerShell prompts, see the online PowerShell help topic [about_prompts](https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.core/about/about_prompts).

## Git Status Summary Information
The Git status summary information provides a wealth of "Git status" information at a glance, all the time in your prompt.
Expand Down
4 changes: 2 additions & 2 deletions posh-git.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ $poshGitPromptScriptBlock = $null

$currentPromptDef = if ($funcInfo = Get-Command prompt -ErrorAction SilentlyContinue) { $funcInfo.Definition }

# HACK: If prompt is missing, create a global one we can overwrite with Set-Item
# HACK: If prompt is missing, create a global one we can overwrite with Set-Item
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sometimes GitHub diff gets a little whacked. I didn't change that line at all.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently I committed a LF here instead of CRLF:
notepad _2017-01-08_00-32-42

VS Code is fixing it. #336 will prevent this type of change in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I was a bit puzzled on that one.

if (!$currentPromptDef) {
function global:prompt { ' ' }
}
Expand Down Expand Up @@ -85,7 +85,7 @@ if (!$currentPromptDef -or ($currentPromptDef -eq $defaultPromptDef)) {
}

$global:LASTEXITCODE = $origLastExitCode
$promptSuffix
$ExecutionContext.SessionState.InvokeCommand.ExpandString($promptSuffix)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL

I probably would have done something way more involved like check if $promptSuffix was a [ScriptBlock] to execute every time.

'@)

# Set the posh-git prompt as the default prompt
Expand Down