1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-07 02:50:47 +00:00
starship/src/init/starship.ion
2019-12-11 15:31:30 -05:00

16 lines
875 B
Plaintext

# The PROMPT function is called whenever a prompt needs to be drawn. Docs: https://doc.redox-os.org/ion-manual/html/misc/06-prompt_fn.html
fn PROMPT
# Save the status immediately, since the status is also updated after variable assignment, etc.
let STARSHIP_ION_STATUS = $?
# Save the ION_CMD_DURATION before running any other commands, but after the status since the
# duration is not updated during variable assignment
let STARSHIP_ION_CMD_DURATION = $ION_CMD_DURATION
# The STARSHIP between the colons will be replaced with the actual path to the starship executable.
# The jobs command outputs to stderr, therefore we need to pipe stderr to `wc -l`.
::STARSHIP:: prompt --status $STARSHIP_ION_STATUS --jobs $(jobs ^| wc -l) --cmd-duration $STARSHIP_ION_CMD_DURATION
end
# Export the correct name of the shell
export STARSHIP_SHELL="ion"