...
This commit is contained in:
parent
45eb4a0760
commit
19fdcec358
@ -3768,18 +3768,21 @@ This will send "Special text" when you press the :kbd:`ctrl+alt+a` key
|
|||||||
combination. The text to be sent is a python string literal so you can use
|
combination. The text to be sent is a python string literal so you can use
|
||||||
escapes like :code:`\\x1b` to send control codes or :code:`\\u21fb` to send
|
escapes like :code:`\\x1b` to send control codes or :code:`\\u21fb` to send
|
||||||
unicode characters (or you can just input the unicode characters directly as
|
unicode characters (or you can just input the unicode characters directly as
|
||||||
UTF-8 text). The first argument to :code:`send_text` is the keyboard modes in which to
|
UTF-8 text). You can use the show_key kitten :code:`kitty +kitten show_key` to
|
||||||
activate the shortcut. The possible values are :code:`normal` or :code:`application` or :code:`kitty`
|
get the key escape codes you want to emulate. The first argument to
|
||||||
or a comma separated combination of them. The special keyword :code:`all` means all
|
:code:`send_text` is the keyboard modes in which to activate the shortcut. The
|
||||||
modes. The modes :code:`normal` and :code:`application` refer to the DECCKM cursor key mode for
|
possible values are :code:`normal` or :code:`application` or :code:`kitty` or a
|
||||||
terminals, and :code:`kitty` refers to the special kitty extended keyboard protocol.
|
comma separated combination of them. The special keyword :code:`all` means all
|
||||||
|
modes. The modes :code:`normal` and :code:`application` refer to the DECCKM
|
||||||
|
cursor key mode forterminals, and :code:`kitty` refers to the special kitty
|
||||||
|
extended keyboard protocol.
|
||||||
|
|
||||||
Some more examples::
|
Some more examples::
|
||||||
|
|
||||||
# Output a word and move the cursor ro the start of the line (like typing and pressing Home)
|
# Output a word and move the cursor to the start of the line (like typing and pressing Home)
|
||||||
map ctrl+alt+a send_text normal Word\\x1b[H
|
map ctrl+alt+a send_text normal Word\\x1b[H
|
||||||
map ctrl+alt+a send_text application Word\\x1bOH
|
map ctrl+alt+a send_text application Word\\x1bOH
|
||||||
# Run a command at a shell prompt (like typing the command and pressing enter)
|
# Run a command at a shell prompt (like typing the command and pressing Enter)
|
||||||
map ctrl+alt+a send_text normal,application some command with arguments\r
|
map ctrl+alt+a send_text normal,application some command with arguments\r
|
||||||
'''
|
'''
|
||||||
)
|
)
|
||||||
|
|||||||
@ -215,7 +215,7 @@ _ksi_main() {
|
|||||||
builtin let limit=1+$COMP_CWORD
|
builtin let limit=1+$COMP_CWORD
|
||||||
src=$(builtin printf "%s\n" "${COMP_WORDS[@]:0:$limit}" | builtin command kitty +complete bash)
|
src=$(builtin printf "%s\n" "${COMP_WORDS[@]:0:$limit}" | builtin command kitty +complete bash)
|
||||||
if [[ $? == 0 ]]; then
|
if [[ $? == 0 ]]; then
|
||||||
builtin eval ${src}
|
builtin eval "${src}"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
builtin complete -o nospace -F _ksi_completions kitty
|
builtin complete -o nospace -F _ksi_completions kitty
|
||||||
@ -273,13 +273,13 @@ _ksi_main() {
|
|||||||
if _ksi_s_is_ok "venv" && [ -n "${VIRTUAL_ENV}" -a -r "$venv" ]; then
|
if _ksi_s_is_ok "venv" && [ -n "${VIRTUAL_ENV}" -a -r "$venv" ]; then
|
||||||
sourced="y"
|
sourced="y"
|
||||||
builtin unset VIRTUAL_ENV
|
builtin unset VIRTUAL_ENV
|
||||||
. "$venv"
|
builtin source "$venv"
|
||||||
fi; if _ksi_s_is_ok "conda" && [ -n "${CONDA_DEFAULT_ENV}" ] && builtin command -v conda >/dev/null 2>/dev/null && [ "${CONDA_DEFAULT_ENV}" != "$orig_conda_env" ]; then
|
fi; if _ksi_s_is_ok "conda" && [ -n "${CONDA_DEFAULT_ENV}" ] && builtin command -v conda >/dev/null 2>/dev/null && [ "${CONDA_DEFAULT_ENV}" != "$orig_conda_env" ]; then
|
||||||
sourced="y"
|
sourced="y"
|
||||||
conda activate "${CONDA_DEFAULT_ENV}"
|
conda activate "${CONDA_DEFAULT_ENV}"
|
||||||
fi; if _ksi_s_is_ok "env_var" && [[ -n "${KITTY_CLONE_SOURCE_CODE}" ]]; then
|
fi; if _ksi_s_is_ok "env_var" && [[ -n "${KITTY_CLONE_SOURCE_CODE}" ]]; then
|
||||||
sourced="y"
|
sourced="y"
|
||||||
eval "${KITTY_CLONE_SOURCE_CODE}"
|
builtin eval "${KITTY_CLONE_SOURCE_CODE}"
|
||||||
fi; if _ksi_s_is_ok "path" && [[ -r "${KITTY_CLONE_SOURCE_PATH}" ]]; then
|
fi; if _ksi_s_is_ok "path" && [[ -r "${KITTY_CLONE_SOURCE_PATH}" ]]; then
|
||||||
sourced="y"
|
sourced="y"
|
||||||
builtin source "${KITTY_CLONE_SOURCE_PATH}"
|
builtin source "${KITTY_CLONE_SOURCE_PATH}"
|
||||||
|
|||||||
@ -369,7 +369,7 @@ _ksi_deferred_init() {
|
|||||||
conda activate "${CONDA_DEFAULT_ENV}"
|
conda activate "${CONDA_DEFAULT_ENV}"
|
||||||
fi; if _ksi_s_is_ok "env_var" && [[ -n "${KITTY_CLONE_SOURCE_CODE}" ]]; then
|
fi; if _ksi_s_is_ok "env_var" && [[ -n "${KITTY_CLONE_SOURCE_CODE}" ]]; then
|
||||||
sourced="y"
|
sourced="y"
|
||||||
eval "${KITTY_CLONE_SOURCE_CODE}"
|
builtin eval "${KITTY_CLONE_SOURCE_CODE}"
|
||||||
fi; if _ksi_s_is_ok "path" && [[ -r "${KITTY_CLONE_SOURCE_PATH}" ]]; then
|
fi; if _ksi_s_is_ok "path" && [[ -r "${KITTY_CLONE_SOURCE_PATH}" ]]; then
|
||||||
sourced="y"
|
sourced="y"
|
||||||
builtin source "${KITTY_CLONE_SOURCE_PATH}"
|
builtin source "${KITTY_CLONE_SOURCE_PATH}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user