mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 16:58:09 +02:00
A facility to easily have child programs print to kitty stdout
Works better than the kitty-print DCS escape code as that tends to get interleaved with other writes to the tty since the loop infrastructure writes in a separate I/O thread.
This commit is contained in:
@@ -3082,6 +3082,16 @@ work. Changing this option by reloading the config will only affect newly
|
||||
created windows.
|
||||
'''
|
||||
)
|
||||
|
||||
opt('forward_stdio', 'no', option_type='to_bool', long_text='''
|
||||
Forward STDOUT and STDERR of the kitty process to child processes
|
||||
as file descriptors 3 and 4. This is useful for debugging as it
|
||||
allows child processes to print to kitty's STDOUT directly. For example,
|
||||
:code:`echo hello world >&3` in a shell will print to the parent kitty's
|
||||
STDOUT. When enabled, this also sets the :code:`KITTY_STDIO_FORWARDED=3`
|
||||
environment variable so child processes know about the forwarding.
|
||||
''')
|
||||
|
||||
egr() # }}}
|
||||
|
||||
|
||||
|
||||
3
kitty/options/parse.py
generated
3
kitty/options/parse.py
generated
@@ -990,6 +990,9 @@ class Parser:
|
||||
def foreground(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
|
||||
ans['foreground'] = to_color(val)
|
||||
|
||||
def forward_stdio(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
|
||||
ans['forward_stdio'] = to_bool(val)
|
||||
|
||||
def hide_window_decorations(self, val: str, ans: typing.Dict[str, typing.Any]) -> None:
|
||||
ans['hide_window_decorations'] = hide_window_decorations(val)
|
||||
|
||||
|
||||
2
kitty/options/types.py
generated
2
kitty/options/types.py
generated
@@ -365,6 +365,7 @@ option_names = ( # {{{
|
||||
'font_size',
|
||||
'force_ltr',
|
||||
'foreground',
|
||||
'forward_stdio',
|
||||
'hide_window_decorations',
|
||||
'inactive_border_color',
|
||||
'inactive_tab_background',
|
||||
@@ -526,6 +527,7 @@ class Options:
|
||||
font_size: float = 11.0
|
||||
force_ltr: bool = False
|
||||
foreground: Color = Color(221, 221, 221)
|
||||
forward_stdio: bool = False
|
||||
hide_window_decorations: int = 0
|
||||
inactive_border_color: Color = Color(204, 204, 204)
|
||||
inactive_tab_background: Color = Color(153, 153, 153)
|
||||
|
||||
Reference in New Issue
Block a user