From 0da9213de62960916981ae293dad3eded536abc8 Mon Sep 17 00:00:00 2001 From: Michael Rutter <1534676+m-rutter@users.noreply.github.com> Date: Tue, 1 Mar 2022 23:38:35 +0000 Subject: [PATCH] document environment variable for starship prompt (#4691) It would appear that starship needs an environment variable set to output the prompt correctly on a per shell basis. --- docs/3rd_Party_Prompts.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/3rd_Party_Prompts.md b/docs/3rd_Party_Prompts.md index 65f6f951d9..eb2373b955 100644 --- a/docs/3rd_Party_Prompts.md +++ b/docs/3rd_Party_Prompts.md @@ -32,10 +32,11 @@ let-env PROMPT_COMMAND = { oh-my-posh --config ~/.poshthemes/M365Princess.omp.js 1. Follow the links above and install starship. 2. Install nerdfonts depending on your preferences. -3. If you want the default ticking clock with date & time on the right prompt execut this command `hide PROMPT_COMMAND_RIGHT` -4. If you don't want the default indicator, you can run this command `let-env PROMPT_INDICATOR = " "` -5. Set starship as your left prompt with this command `let-env PROMPT_COMMAND = { starship prompt --cmd-duration $env.CMD_DURATION_MS --status $env.LAST_EXIT_CODE | str trim }`. Note that you may not have to use `str trim` in the nushell prompt if you disable starship's default newline setting with this entry in the starship.toml file `add_newline = false`. There have been reports that this might not play nice with nushell prompts. We're still testing. -6. Since nushell supports a right prompt you can also play around with starship's ability to set a right prompt. Setting the right prompt in nushell is identical to setting the left prompt however you use `PROMPT_COMMAND_RIGHT`. +3. Set the starship shell environment variable to `nu` by running this commend `let-env STARSHIP_SHELL = "nu"` +4. If you want the default ticking clock with date & time on the right prompt execut this command `hide PROMPT_COMMAND_RIGHT` +5. If you don't want the default indicator, you can run this command `let-env PROMPT_INDICATOR = " "` +6. Set starship as your left prompt with this command `let-env PROMPT_COMMAND = { starship prompt --cmd-duration $env.CMD_DURATION_MS --status $env.LAST_EXIT_CODE | str trim }`. Note that you may not have to use `str trim` in the nushell prompt if you disable starship's default newline setting with this entry in the starship.toml file `add_newline = false`. There have been reports that this might not play nice with nushell prompts. We're still testing. +7. Since nushell supports a right prompt you can also play around with starship's ability to set a right prompt. Setting the right prompt in nushell is identical to setting the left prompt however you use `PROMPT_COMMAND_RIGHT`. ## Purs