2021-03-14 23:59:32 +03:00
|
|
|
status is-interactive || exit
|
|
|
|
|
|
|
|
# Set things that wont change
|
2021-03-18 00:30:04 +03:00
|
|
|
_tide_remove_unusable_items
|
|
|
|
_tide_detect_os
|
|
|
|
|
2021-03-14 23:59:32 +03:00
|
|
|
set -g _tide_left_prompt_display_var _tide_left_prompt_display_$fish_pid
|
2021-03-22 07:39:14 +03:00
|
|
|
set -gx _tide_right_prompt_display_var _tide_right_prompt_display_$fish_pid
|
2021-03-14 23:59:32 +03:00
|
|
|
|
2021-03-17 00:09:30 +03:00
|
|
|
function _tide_background_job --on-event fish_prompt --on-variable fish_bind_mode
|
2021-03-26 17:33:52 +03:00
|
|
|
_tide_last_status=$status _tide_last_pipestatus=$pipestatus _tide_jobs_number=(jobs --pid | count) fish --command "
|
2021-03-27 22:58:51 +03:00
|
|
|
set -g CMD_DURATION $CMD_DURATION
|
|
|
|
set -g COLUMNS $COLUMNS
|
|
|
|
set -g fish_bind_mode $fish_bind_mode
|
|
|
|
set -g fish_term24bit $fish_term24bit
|
2021-03-26 21:27:08 +03:00
|
|
|
set -U $_tide_left_prompt_display_var (_tide_prompt)" </dev/null &
|
|
|
|
# Remove </dev/null in Fish 3.3.0, see https://github.com/fish-shell/fish-shell/issues/7842
|
|
|
|
|
2021-03-14 23:59:32 +03:00
|
|
|
command kill $_tide_last_pid 2>/dev/null
|
2021-03-27 22:58:51 +03:00
|
|
|
set -g _tide_last_pid (jobs --last --pid) # Replace with $last_pid in Fish 3.3.0
|
2021-03-27 23:05:33 +03:00
|
|
|
builtin disown $_tide_last_pid 2>/dev/null
|
2021-03-14 23:59:32 +03:00
|
|
|
end
|
|
|
|
|
2021-03-22 07:39:14 +03:00
|
|
|
function _tide_refresh_prompt --on-variable $_tide_left_prompt_display_var --on-variable $_tide_right_prompt_display_var
|
2021-03-14 23:59:32 +03:00
|
|
|
commandline --function repaint
|
|
|
|
end
|
|
|
|
|
|
|
|
# Double underscores to avoid erasing this function on uninstall
|
|
|
|
function __tide_on_fish_exit --on-event fish_exit
|
2021-03-22 07:39:14 +03:00
|
|
|
set -e $_tide_left_prompt_display_var $_tide_right_prompt_display_var
|
2021-03-14 23:59:32 +03:00
|
|
|
end
|