Avoid needing to exec kitty to get manual shell integration
This commit is contained in:
parent
4841502959
commit
0c160eab7b
@ -116,6 +116,11 @@ Variables that kitty sets when running child programs
|
|||||||
Path to a directory containing the kitty terminfo database.
|
Path to a directory containing the kitty terminfo database.
|
||||||
|
|
||||||
|
|
||||||
|
.. envvar:: KITTY_INSTALLATION_DIR
|
||||||
|
|
||||||
|
Path to the kitty installation directory.
|
||||||
|
|
||||||
|
|
||||||
.. envvar:: COLORTERM
|
.. envvar:: COLORTERM
|
||||||
|
|
||||||
Set to the value ``truecolor`` to indicate that kitty supports 16 million
|
Set to the value ``truecolor`` to indicate that kitty supports 16 million
|
||||||
@ -152,4 +157,5 @@ Variables that kitty sets when running child programs
|
|||||||
|
|
||||||
.. envvar:: KITTY_SHELL_INTEGRATION
|
.. envvar:: KITTY_SHELL_INTEGRATION
|
||||||
|
|
||||||
Set when enabling :ref:`shell_integration`.
|
Set when enabling :ref:`shell_integration`. It is automatically removed by
|
||||||
|
the shell integration scripts.
|
||||||
|
|||||||
@ -140,31 +140,29 @@ want to setup shell integration for a remote system over SSH, in
|
|||||||
|
|
||||||
Then in your shell's rc file, add the lines:
|
Then in your shell's rc file, add the lines:
|
||||||
|
|
||||||
.. tab:: bash/zsh
|
.. tab:: bash
|
||||||
|
|
||||||
.. code-block:: sh
|
.. code-block:: sh
|
||||||
|
|
||||||
export KITTY_SHELL_INTEGRATION="enabled"
|
export KITTY_SHELL_INTEGRATION="enabled"
|
||||||
source $(kitty +runpy "from kitty.shell_integration import script_path; print(script_path())")
|
source "$KITTY_INSTALLATION_DIR/shell-integration/kitty.bash"
|
||||||
|
|
||||||
|
.. tab:: zsh
|
||||||
|
|
||||||
|
.. code-block:: sh
|
||||||
|
|
||||||
|
export KITTY_SHELL_INTEGRATION="enabled"
|
||||||
|
source "$KITTY_INSTALLATION_DIR/shell-integration/kitty.zsh"
|
||||||
|
|
||||||
.. tab:: fish
|
.. tab:: fish
|
||||||
|
|
||||||
.. code-block:: fish
|
.. code-block:: fish
|
||||||
|
|
||||||
set --global KITTY_SHELL_INTEGRATION enabled
|
set --global KITTY_SHELL_INTEGRATION enabled
|
||||||
set --path --local kitty_paths (kitty +runpy 'from kitty.shell_integration import print_fish_paths; print_fish_paths()')
|
source "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_conf.d/kitty-shell-integration.fish"
|
||||||
source kitty_paths[2]
|
set --prepend fish_complete_path "$KITTY_INSTALLATION_DIR/shell-integration/fish/vendor_completions.d"
|
||||||
set --prepend fish_complete_path kitty_paths[1]
|
|
||||||
set --erase kitty_paths
|
|
||||||
|
|
||||||
|
|
||||||
You can get the path to the directory containing the various shell integration
|
|
||||||
scripts by looking at the directory displayed by:
|
|
||||||
|
|
||||||
.. code-block:: sh
|
|
||||||
|
|
||||||
kitty +runpy "from kitty.constants import *; print(shell_integration_dir)"
|
|
||||||
|
|
||||||
The value of :envvar:`KITTY_SHELL_INTEGRATION` is the same as that for
|
The value of :envvar:`KITTY_SHELL_INTEGRATION` is the same as that for
|
||||||
:opt:`shell_integration`, except if you want to disable shell integration
|
:opt:`shell_integration`, except if you want to disable shell integration
|
||||||
completely, in which case simply do not set the
|
completely, in which case simply do not set the
|
||||||
|
|||||||
@ -12,7 +12,7 @@ from typing import (
|
|||||||
|
|
||||||
import kitty.fast_data_types as fast_data_types
|
import kitty.fast_data_types as fast_data_types
|
||||||
|
|
||||||
from .constants import is_macos, shell_path, terminfo_dir
|
from .constants import is_macos, kitty_base_dir, shell_path, terminfo_dir
|
||||||
from .types import run_once
|
from .types import run_once
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -229,6 +229,7 @@ class Child:
|
|||||||
tdir = checked_terminfo_dir()
|
tdir = checked_terminfo_dir()
|
||||||
if tdir:
|
if tdir:
|
||||||
env['TERMINFO'] = tdir
|
env['TERMINFO'] = tdir
|
||||||
|
env['KITTY_INSTALLATION_DIR'] = kitty_base_dir
|
||||||
opts = fast_data_types.get_options()
|
opts = fast_data_types.get_options()
|
||||||
if opts.shell_integration != 'disabled':
|
if opts.shell_integration != 'disabled':
|
||||||
from .shell_integration import modify_shell_environ
|
from .shell_integration import modify_shell_environ
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user