Merge branch 'fish-osc-133' of https://github.com/krobelus/kitty

This commit is contained in:
Kovid Goyal
2024-04-07 15:15:04 +05:30
3 changed files with 26 additions and 18 deletions

View File

@@ -52,6 +52,7 @@ In addition to kitty, this protocol is also implemented in:
* The `yazi file manager <https://github.com/sxyazi/yazi>`__ * The `yazi file manager <https://github.com/sxyazi/yazi>`__
* The `awrit web browser <https://github.com/chase/awrit>`__ * The `awrit web browser <https://github.com/chase/awrit>`__
* The `nushell shell <https://github.com/nushell/nushell/pull/10540>`__ * The `nushell shell <https://github.com/nushell/nushell/pull/10540>`__
* The `fish shell <https://github.com/fish-shell/fish-shell/commit/8bf8b10f685d964101f491b9cc3da04117a308b4>`__
.. versionadded:: 0.20.0 .. versionadded:: 0.20.0

View File

@@ -85,6 +85,8 @@ no-cwd
no-prompt-mark no-prompt-mark
Turn off marking of prompts. This disables jumping to prompt, browsing Turn off marking of prompts. This disables jumping to prompt, browsing
output of last command and click to move cursor functionality. output of last command and click to move cursor functionality.
Note that for the fish shell this does not take effect, since fish always
marks prompts.
no-complete no-complete
Turn off completion for the kitty command. Turn off completion for the kitty command.

View File

@@ -71,6 +71,9 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after
# Enable prompt marking with OSC 133 # Enable prompt marking with OSC 133
if not contains "no-prompt-mark" $_ksi and not set -q __ksi_prompt_state if not contains "no-prompt-mark" $_ksi and not set -q __ksi_prompt_state
# fish 3.8 emits prompt markers, so we don't need to.
# Cheesily detect that version by probing for another feature.
if not bind --function-names | string match -q forward-char-passive
function __ksi_mark_prompt_start --on-event fish_prompt --on-event fish_cancel --on-event fish_posterror function __ksi_mark_prompt_start --on-event fish_prompt --on-event fish_cancel --on-event fish_posterror
test "$__ksi_prompt_state" != prompt-start test "$__ksi_prompt_state" != prompt-start
and echo -en "\e]133;D\a" and echo -en "\e]133;D\a"
@@ -92,6 +95,8 @@ function __ksi_schedule --on-event fish_prompt -d "Setup kitty integration after
# With prompt marking, kitty clears the current prompt on resize, # With prompt marking, kitty clears the current prompt on resize,
# so we need fish to redraw it. # so we need fish to redraw it.
set --global fish_handle_reflow 1 set --global fish_handle_reflow 1
end
# Binding for special key to move cursor on mouse click without triggering any # Binding for special key to move cursor on mouse click without triggering any
# autocompletion or other effects # autocompletion or other effects
set --local suffix '' set --local suffix ''