2020-11-25 20:41:40 +03:00
|
|
|
_tide_detect_os
|
|
|
|
_tide_git_prompt_set_vars
|
|
|
|
|
2020-12-18 02:31:52 +03:00
|
|
|
# Set things that wont change
|
2020-12-08 02:15:29 +03:00
|
|
|
set -g _tide_left_prompt_display_var _tide_left_prompt_display_$fish_pid
|
|
|
|
|
|
|
|
set -gx _tide_fish_pid $fish_pid
|
|
|
|
set -x fish_term24bit $fish_term24bit
|
|
|
|
|
2020-11-25 07:54:49 +03:00
|
|
|
function fish_prompt
|
2020-11-25 22:54:17 +03:00
|
|
|
set -lx _tide_last_pipestatus $pipestatus
|
|
|
|
set -lx _tide_jobs_number (jobs --pid | count)
|
|
|
|
|
2020-11-25 20:22:35 +03:00
|
|
|
fish --command "
|
|
|
|
set CMD_DURATION $CMD_DURATION
|
2020-11-27 19:12:14 +03:00
|
|
|
set COLUMNS $COLUMNS
|
2020-11-25 22:57:45 +03:00
|
|
|
set fish_bind_mode $fish_bind_mode
|
2020-04-21 22:15:05 +03:00
|
|
|
|
2020-11-25 20:22:35 +03:00
|
|
|
command kill $_tide_last_pid 2>/dev/null
|
2021-01-05 02:16:47 +03:00
|
|
|
set -U _tide_left_prompt_display_$fish_pid (_tide_prompt)
|
|
|
|
" >&- & # >&- closes stdout. See https://github.com/fish-shell/fish-shell/issues/7559
|
2020-11-25 01:21:22 +03:00
|
|
|
|
2020-11-25 09:13:05 +03:00
|
|
|
set -g _tide_last_pid (jobs --last --pid)
|
2020-11-25 20:41:40 +03:00
|
|
|
disown $_tide_last_pid 2>/dev/null
|
2020-04-21 22:15:05 +03:00
|
|
|
|
2020-12-08 02:15:29 +03:00
|
|
|
string unescape $$_tide_left_prompt_display_var
|
2020-09-07 22:00:54 +03:00
|
|
|
end
|
2020-11-21 01:04:04 +03:00
|
|
|
|
2020-12-24 01:15:36 +03:00
|
|
|
function _tide_refresh_prompt --on-variable _tide_left_prompt_display_$fish_pid --on-variable _tide_right_prompt_display_$fish_pid
|
2020-12-18 02:31:52 +03:00
|
|
|
commandline --function force-repaint
|
2020-11-25 06:30:59 +03:00
|
|
|
end
|
|
|
|
|
2021-01-06 05:07:56 +03:00
|
|
|
# Double underscores to avoid erasing this function on uninstall
|
|
|
|
function __tide_on_fish_exit --on-event fish_exit
|
2020-11-25 06:30:59 +03:00
|
|
|
set -e _tide_left_prompt_display_$fish_pid
|
|
|
|
set -e _tide_right_prompt_display_$fish_pid
|
2020-11-21 01:04:04 +03:00
|
|
|
end
|