diff --git a/docs/changelog.rst b/docs/changelog.rst index 27be6b045..3573b98b1 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -12,6 +12,8 @@ To update |kitty|, :doc:`follow the instructions `. - Document the kitty remote control protocol (:iss:`1646`) +- When piping data to a child in the pipe command do it in a thread so as not + to block the UI (:iss:`1708`) 0.14.2 [2019-06-09] --------------------- diff --git a/kitty/boss.py b/kitty/boss.py index b546b0812..62686aa46 100644 --- a/kitty/boss.py +++ b/kitty/boss.py @@ -6,10 +6,10 @@ import atexit import json import os import re +from contextlib import suppress from functools import partial from gettext import gettext as _ from weakref import WeakValueDictionary -from contextlib import suppress from .child import cached_process_data from .cli import create_opts, parse_args @@ -25,8 +25,8 @@ from .fast_data_types import ( change_os_window_state, create_os_window, current_os_window, destroy_global_data, get_clipboard_string, global_font_size, mark_os_window_for_close, os_window_font_size, patch_global_colors, - set_clipboard_string, set_in_sequence_mode, toggle_fullscreen, - toggle_maximized + set_clipboard_string, set_in_sequence_mode, thread_write, + toggle_fullscreen, toggle_maximized ) from .keys import get_shortcut, shortcut_matches from .layout import set_layout_options @@ -920,7 +920,7 @@ class Boss: env, stdin = self.process_stdin_source(stdin=source, window=window) if stdin: p = subprocess.Popen(cmd, env=env, stdin=subprocess.PIPE) - p.communicate(stdin) + thread_write(p.stdin.fileno(), stdin) else: subprocess.Popen(cmd)