From 9804aa31ff8b50cc674ebb4c054aacb1d887626d Mon Sep 17 00:00:00 2001 From: Daniel Kempkens Date: Tue, 20 Dec 2022 17:56:47 +0100 Subject: [PATCH] fish: Add OSC133 script --- home/config/fish/osc133.fish | 23 +++++++++++++++++++++++ home/programs/fish.nix | 5 +++++ 2 files changed, 28 insertions(+) create mode 100644 home/config/fish/osc133.fish diff --git a/home/config/fish/osc133.fish b/home/config/fish/osc133.fish new file mode 100644 index 0000000..a9ea26b --- /dev/null +++ b/home/config/fish/osc133.fish @@ -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 diff --git a/home/programs/fish.nix b/home/programs/fish.nix index 4d68260..e64e57f 100644 --- a/home/programs/fish.nix +++ b/home/programs/fish.nix @@ -182,4 +182,9 @@ end ''; }; + + xdg.configFile."fish/conf.d" = { + source = ../config/fish; + recursive = true; + }; }