Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix blocking of pty_read when there isn't pty data ready to read #107

Merged
merged 1 commit into from
Jun 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions terminado/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import signal
import codecs
import warnings
import select

try:
from ptyprocess import PtyProcessUnicode
Expand Down Expand Up @@ -205,6 +206,9 @@ def on_eof(self, ptywclients):

def pty_read(self, fd, events=None):
"""Called by the event loop when there is pty data ready to read."""
r, _, _ = select.select([fd], [], [], .1)
if not r:
return
ptywclients = self.ptys_by_fd[fd]
try:
s = ptywclients.ptyproc.read(65536)
Expand Down