diff options
author | toonn <toonn@toonn.io> | 2019-12-19 23:32:07 +0100 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2019-12-19 23:32:07 +0100 |
commit | 0de267984a656b65317d3214a87d55449a162738 (patch) | |
tree | 2a06677ff9501d08b71ba3708805a5c8e930da1b | |
parent | 45224c204b6a0f370c7f78fca1a7841b4e53f0d0 (diff) | |
parent | f733a72d1e461a32405307a9aec7f6b4ecd708ff (diff) | |
download | ranger-0de267984a656b65317d3214a87d55449a162738.tar.gz |
Merge branch 'igoyak-1367_busyloop'
-rw-r--r-- | ranger/gui/ui.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 2874ee97..03a43c57 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -238,7 +238,7 @@ class UI( # pylint: disable=too-many-instance-attributes,too-many-public-method for key in keys: self.handle_key(key) - def handle_input(self): + def handle_input(self): # pylint: disable=too-many-branches key = self.win.getch() if key == curses.KEY_ENTER: key = ord('\n') @@ -277,6 +277,9 @@ class UI( # pylint: disable=too-many-instance-attributes,too-many-public-method else: if not self.fm.input_is_blocked(): self.handle_key(key) + elif key == -1 and not os.isatty(sys.stdin.fileno()): + # STDIN has been closed + self.fm.exit() def setup(self): """Build up the UI by initializing widgets.""" |