Use a single kitty invocation for manual shell integration

This commit is contained in:
Kovid Goyal 2021-11-08 11:27:10 +05:30
parent 8218df82f2
commit 4841502959
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 9 additions and 3 deletions

View File

@ -152,8 +152,10 @@ Then in your shell's rc file, add the lines:
.. code-block:: fish
set --global KITTY_SHELL_INTEGRATION enabled
source (kitty +runpy "from kitty.shell_integration import script_path; print(script_path('fish'))")
set --prepend fish_complete_path (kitty +runpy "from kitty.shell_integration import fish_completions_dir; print(fish_completions_dir)")
set --path --local kitty_paths (kitty +runpy 'from kitty.shell_integration import print_fish_paths; print_fish_paths()')
source kitty_paths[2]
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

View File

@ -149,3 +149,7 @@ def script_path(shell: str = '') -> str:
else:
f = f'kitty.{shell}'
return os.path.join(shell_integration_dir, f)
def print_fish_paths() -> None:
print(fish_completions_dir, script_path('fish'), sep=os.pathsep)

View File

@ -769,8 +769,8 @@ def is_kitty_gui_cmdline(*cmd: str) -> bool:
def reload_conf_in_all_kitties() -> None:
import signal
from kitty.child import cmdline_of_process
from kitty.child import cmdline_of_process # type: ignore
for pid in get_all_processes():
try:
cmd = cmdline_of_process(pid)