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
|
2021-08-22 01:05:08 +03:00
|
|
|
_tide_cache_variables
|
2021-04-10 18:56:38 +03:00
|
|
|
|
2021-08-14 01:45:58 +03:00
|
|
|
# The first element in $$_tide_prompt_var is right prompt
|
|
|
|
# All remaining ones are 'left' prompt (also upper right in 2-line prompts)
|
2021-08-13 14:28:09 +03:00
|
|
|
set -g _tide_prompt_var _tide_prompt_$fish_pid
|
2021-04-10 18:56:38 +03:00
|
|
|
|
2021-08-13 14:28:09 +03:00
|
|
|
function _tide_refresh_prompt --on-variable $_tide_prompt_var
|
2021-04-10 18:56:38 +03:00
|
|
|
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-07-08 19:43:41 +03:00
|
|
|
jobs --query
|
2021-07-18 00:34:36 +03:00
|
|
|
fish --command "_tide_jobs_status=$status CMD_DURATION=$CMD_DURATION COLUMNS=$COLUMNS \
|
2021-08-13 14:28:09 +03:00
|
|
|
fish_bind_mode=$fish_bind_mode set -U $_tide_prompt_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-08-22 01:05:08 +03:00
|
|
|
string unescape $_tide_add_newline $$_tide_prompt_var[1][2..]
|
2021-03-01 03:47:07 +03:00
|
|
|
end
|
2021-04-10 18:56:38 +03:00
|
|
|
|
2021-08-13 14:54:40 +03:00
|
|
|
function fish_right_prompt
|
2021-08-14 01:45:58 +03:00
|
|
|
string unescape $$_tide_prompt_var[1][1]
|
2021-08-13 14:54:40 +03:00
|
|
|
end
|
|
|
|
|
2021-07-25 21:15:45 +03:00
|
|
|
function _tide_on_fish_exit --on-event fish_exit
|
2021-08-13 14:49:48 +03:00
|
|
|
set -e $_tide_prompt_var
|
2021-04-10 18:56:38 +03:00
|
|
|
end
|