2021-03-01 03:47:07 +03:00
|
|
|
function fish_prompt
|
2021-04-10 18:56:38 +03:00
|
|
|
end
|
|
|
|
|
|
|
|
status is-interactive || exit
|
|
|
|
|
|
|
|
_tide_remove_unusable_items
|
|
|
|
|
|
|
|
set -g _tide_left_prompt_display_var _tide_left_prompt_display_$fish_pid
|
|
|
|
set -gx _tide_right_prompt_display_var _tide_right_prompt_display_$fish_pid
|
|
|
|
|
|
|
|
function _tide_refresh_prompt --on-variable $_tide_left_prompt_display_var --on-variable $_tide_right_prompt_display_var
|
|
|
|
set -g _tide_self_repainting # prevents us from creating a second background job
|
|
|
|
commandline --function repaint
|
|
|
|
end
|
|
|
|
|
|
|
|
function fish_prompt
|
2021-05-05 20:10:07 +03:00
|
|
|
_tide_last_status=$status _tide_last_pipestatus=$pipestatus if not set -e _tide_self_repainting
|
2021-06-08 23:21:49 +03:00
|
|
|
_tide_jobs=(jobs --pid) fish --command "
|
2021-06-24 22:58:13 +03:00
|
|
|
CMD_DURATION=$CMD_DURATION COLUMNS=$COLUMNS fish_bind_mode=$fish_bind_mode \
|
2021-04-10 18:56:38 +03:00
|
|
|
set -U $_tide_left_prompt_display_var (_tide_prompt)" &
|
2021-06-28 19:43:25 +03:00
|
|
|
builtin disown
|
2021-04-10 18:56:38 +03:00
|
|
|
|
|
|
|
command kill $_tide_last_pid 2>/dev/null
|
2021-06-28 19:43:25 +03:00
|
|
|
set -g _tide_last_pid $last_pid
|
2021-04-10 18:56:38 +03:00
|
|
|
end
|
|
|
|
|
2021-03-01 03:47:07 +03:00
|
|
|
string unescape $$_tide_left_prompt_display_var
|
|
|
|
end
|
2021-04-10 18:56:38 +03:00
|
|
|
|
|
|
|
# Double underscores to avoid erasing this function on uninstall
|
|
|
|
function __tide_on_fish_exit --on-event fish_exit
|
|
|
|
set -e $_tide_left_prompt_display_var $_tide_right_prompt_display_var
|
|
|
|
end
|