2023-12-05 12:24:48 -08:00
|
|
|
function __is_copy_function; functions $argv[1] | sed "s/^function $argv[1]/function $argv[2]/" | source; end
|
|
|
|
|
function __is_prompt_start; printf '\e]6973;PS\a'; end
|
|
|
|
|
function __is_prompt_end; printf '\e]6973;PE\a'; end
|
|
|
|
|
|
2023-12-14 14:53:12 -08:00
|
|
|
function __is_escape_value
|
|
|
|
|
echo $argv \
|
|
|
|
|
| string replace --all '\\' '\\\\' \
|
|
|
|
|
| string replace --all ';' '\\x3b' \
|
|
|
|
|
;
|
|
|
|
|
end
|
|
|
|
|
function __is_update_cwd --on-event fish_prompt; set __is_cwd (__is_escape_value "$PWD"); printf "\e]6973;CWD;$__is_cwd\a"; end
|
|
|
|
|
|
2023-12-05 12:24:48 -08:00
|
|
|
__is_copy_function fish_prompt is_user_prompt
|
2024-02-15 15:13:32 -05:00
|
|
|
|
2024-03-06 01:31:27 -05:00
|
|
|
if [ "$ISTERM_TESTING" = "1" ]
|
2024-02-15 15:13:32 -05:00
|
|
|
function is_user_prompt; printf '> '; end
|
|
|
|
|
end
|
|
|
|
|
|
2023-12-05 12:24:48 -08:00
|
|
|
function fish_prompt; printf (__is_prompt_start); printf (is_user_prompt); printf (__is_prompt_end); end
|