fish: Add OSC133 script
This commit is contained in:
parent
03c6d3165f
commit
9804aa31ff
2 changed files with 28 additions and 0 deletions
23
home/config/fish/osc133.fish
Normal file
23
home/config/fish/osc133.fish
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
# (Partially) Copied from: https://github.com/kovidgoyal/kitty/blob/v0.26.5/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish
|
||||||
|
|
||||||
|
if not set -q __nifoc_prompt_state
|
||||||
|
function __nifoc_mark_prompt_start --on-event fish_prompt --on-event fish_cancel --on-event fish_posterror
|
||||||
|
test "$__nifoc_prompt_state" != prompt-start
|
||||||
|
and echo -en "\e]133;D\a"
|
||||||
|
set --global __nifoc_prompt_state prompt-start
|
||||||
|
echo -en "\e]133;A\a"
|
||||||
|
end
|
||||||
|
__nifoc_mark_prompt_start
|
||||||
|
|
||||||
|
function __nifoc_mark_output_start --on-event fish_preexec
|
||||||
|
set --global __nifoc_prompt_state pre-exec
|
||||||
|
echo -en "\e]133;C\a"
|
||||||
|
end
|
||||||
|
|
||||||
|
function __nifoc_mark_output_end --on-event fish_postexec
|
||||||
|
set --global __nifoc_prompt_state post-exec
|
||||||
|
echo -en "\e]133;D;$status\a"
|
||||||
|
end
|
||||||
|
|
||||||
|
set --global fish_handle_reflow 1
|
||||||
|
end
|
|
@ -182,4 +182,9 @@
|
||||||
end
|
end
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
xdg.configFile."fish/conf.d" = {
|
||||||
|
source = ../config/fish;
|
||||||
|
recursive = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue