From 2d93a011df970252aaa1cb5ae4ae67cdcf564844 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 15 Jul 2021 10:20:46 +0530 Subject: [PATCH] Option to control shell integration --- kitty/options/definition.py | 8 ++++++++ kitty/options/parse.py | 3 +++ kitty/options/types.py | 2 ++ 3 files changed, 13 insertions(+) diff --git a/kitty/options/definition.py b/kitty/options/definition.py index b5563fc0c..5bc6654f6 100644 --- a/kitty/options/definition.py +++ b/kitty/options/definition.py @@ -2560,6 +2560,14 @@ holding down ctrl+shift and clicking with the mouse. The special value of ''' ) +opt('shell_integration', 'enabled', + long_text=''' +Enable shell integration on supported shells. This enables features such as +jumping to previous prompts, browsing the output of the previous command in a +pager, etc. on supported shells. Set to ``disabled`` to turn off shell +integration, completely. See :ref:`shell_integration` for details. +''') + opt('term', 'xterm-kitty', long_text=''' The value of the TERM environment variable to set. Changing this can break many diff --git a/kitty/options/parse.py b/kitty/options/parse.py index 63cd7f01e..759a0552f 100644 --- a/kitty/options/parse.py +++ b/kitty/options/parse.py @@ -1128,6 +1128,9 @@ class Parser: def shell(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['shell'] = str(val) + def shell_integration(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: + ans['shell_integration'] = str(val) + def single_window_margin_width(self, val: str, ans: typing.Dict[str, typing.Any]) -> None: ans['single_window_margin_width'] = optional_edge_width(val) diff --git a/kitty/options/types.py b/kitty/options/types.py index 540ef7964..af0af9cdb 100644 --- a/kitty/options/types.py +++ b/kitty/options/types.py @@ -400,6 +400,7 @@ option_names = ( # {{{ 'selection_background', 'selection_foreground', 'shell', + 'shell_integration', 'single_window_margin_width', 'startup_session', 'strip_trailing_spaces', @@ -534,6 +535,7 @@ class Options: selection_background: Color = Color(red=255, green=250, blue=205) selection_foreground: typing.Optional[kitty.rgb.Color] = Color(red=0, green=0, blue=0) shell: str = '.' + shell_integration: str = 'enabled' single_window_margin_width: FloatEdges = FloatEdges(left=-1.0, top=-1.0, right=-1.0, bottom=-1.0) startup_session: typing.Optional[str] = None strip_trailing_spaces: choices_for_strip_trailing_spaces = 'never'