Skip to content

Commit 977ffa6

Browse files
authored
panache-git: exclude prompt indicator so user can choose their own (#1012)
Previously, panache-git included a prompt indicator (`> `) out of the box, and the advice for the user was to remove Nushell's own configurable prompt indicator by setting it to the empty string. However, this conflicted with some of Nushell's intended functionality, such as the ability to use a different prompt indicator in each vi mode. With this change, panache-git does not include a prompt indicator. The advice is for the user to use the prompt indicator they like, but to reset the color so it better matches panache-git's colors. This is something of a breaking change, in that users who update to the latest panache-git.nu without making corresponding changes to their Nushell config might see two prompt indicators (`> > `), but my hope is that giving users (especially vi mode users) more flexibility with their prompt indicators will be worth any temporary confusion.
1 parent 059d74e commit 977ffa6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

modules/prompt/panache-git.nu

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
# - In your Nushell config:
77
# - Import the main command from the panache-git.nu module file
88
# - Set panache-git as your prompt command
9-
# - Disable the separate prompt indicator by setting it to an empty string
9+
# - (optional) Reset the text color for your prompt indicator
1010
# - For example, with this file in your home directory:
1111
# use ~/panache-git.nu main
1212
# $env.PROMPT_COMMAND = {|| panache-git }
13-
# $env.PROMPT_INDICATOR = {|| "" }
13+
# $env.PROMPT_INDICATOR = {|| $"(ansi reset)> "}
14+
# $env.PROMPT_INDICATOR_VI_INSERT = {|| $"(ansi reset): " }
15+
# $env.PROMPT_INDICATOR_VI_NORMAL = {|| $"(ansi reset)> " }
1416
# - Restart Nushell
1517
#
1618
# For more documentation or to file an issue, see https://github.com/ehdevries/panache-git
@@ -19,7 +21,7 @@
1921
# An opinionated Git prompt for Nushell, styled after posh-git
2022
export def main [] {
2123
let prompt = ($'(current-dir) (repo-styled)' | str trim)
22-
$'($prompt)> '
24+
$prompt
2325
}
2426

2527
# Get the current directory with home abbreviated

0 commit comments

Comments
 (0)