1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-11-17 10:35:15 +00:00
starship/src/init/starship.fish
Tilmann Meyer 2233683410
feat: add error messaging (#1576)
This creates a custom logger for the log crate which logs everything to a file (/tmp/starship/session_$STARSHIP_SESSION_KEY.log) and it logs everything above Warn to stderr, but only if the log file does not contain the line that should be logged resulting in an error or warning to be only logged at the first starship invocation after opening the shell.
2020-09-28 16:38:50 -04:00

22 lines
736 B
Fish

function fish_prompt
switch "$fish_key_bindings"
case fish_hybrid_key_bindings fish_vi_key_bindings
set keymap "$fish_bind_mode"
case '*'
set keymap insert
end
set -l exit_code $status
# Account for changes in variable name between v2.7 and v3.0
set -l starship_duration "$CMD_DURATION$cmd_duration"
::STARSHIP:: prompt --status=$exit_code --keymap=$keymap --cmd-duration=$starship_duration --jobs=(count (jobs -p))
end
# disable virtualenv prompt, it breaks starship
set VIRTUAL_ENV_DISABLE_PROMPT 1
function fish_mode_prompt; end
export STARSHIP_SHELL="fish"
# Set up the session key that will be used to store logs
export STARSHIP_SESSION_KEY=(::STARSHIP:: session)