Skip to content
This repository has been archived by the owner on Jan 14, 2024. It is now read-only.

Commit

Permalink
#57: Do not copy terminal size if the console is non-interactive to a…
Browse files Browse the repository at this point in the history
…void exception

```
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.8/site-packages/rkd/process.py", line 105, in push_output
    copy_terminal_size(sys.stdout, primary_fd)
  File "/usr/lib/python3.8/site-packages/rkd/process.py", line 149, in copy_terminal_size
    col, row, x_pixels, y_pixels = get_terminal_size(fd_from)
  File "/usr/lib/python3.8/site-packages/rkd/process.py", line 166, in get_terminal_size
    x = fcntl.ioctl(fd.fileno(), termios.TIOCGWINSZ, s)
OSError: [Errno 25] Inappropriate ioctl for device
```
  • Loading branch information
blackandred committed Nov 11, 2020
1 parent 866e0d5 commit c8e4eac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rkd/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ def push_output(process, primary_fd, out_buffer: TextBuffer, process_state: Proc
# terminal window size updating
terminal_update_time = 3 # 3 seconds
last_terminal_update = time()
copy_terminal_size(sys.stdout, primary_fd)

if is_interactive_session:
copy_terminal_size(sys.stdout, primary_fd)
to_select = [sys.stdin] + to_select

while process.poll() is None:
Expand Down

0 comments on commit c8e4eac

Please sign in to comment.