fix(init): Change Nushell init for nu 0.60 (#3773)

This commit is contained in:
David Knaack
2022-03-24 20:06:24 +01:00
committed by GitHub
parent 1f22f76a81
commit c9b75fe115
10 changed files with 52 additions and 60 deletions
+12 -3
View File
@@ -1,8 +1,17 @@
let-env STARSHIP_SHELL = "nu"
let-env STARSHIP_SESSION_KEY = (random chars -l 16)
let-env PROMPT_MULTILINE_INDICATOR = (^::STARSHIP:: prompt --continuation)
def starship_prompt [] {
# Does not play well with default character module.
# TODO: Also Use starship vi mode indicators?
let-env PROMPT_INDICATOR = ""
let-env PROMPT_COMMAND = {
# jobs are not supported
# status is not supported
^::STARSHIP:: prompt --cmd-duration $nu.env.CMD_DURATION_MS
^::STARSHIP:: prompt --cmd-duration $env.CMD_DURATION_MS --status $env.LAST_EXIT_CODE
}
# Not well-suited for `starship prompt --right`.
# Built-in right prompt is equivalent to $fill$right_format in the first prompt line.
# Thus does not play well with default `add_newline = True`.
let-env PROMPT_COMMAND_RIGHT = {''}