Skip to content

Commit ada2b93

Browse files
authored
Fix blocking of pty_read when there isn't pty data ready to read (#107)
1 parent 946e077 commit ada2b93

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

terminado/management.py

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import signal
1515
import codecs
1616
import warnings
17+
import select
1718

1819
try:
1920
from ptyprocess import PtyProcessUnicode
@@ -205,6 +206,9 @@ def on_eof(self, ptywclients):
205206

206207
def pty_read(self, fd, events=None):
207208
"""Called by the event loop when there is pty data ready to read."""
209+
r, _, _ = select.select([fd], [], [], .1)
210+
if not r:
211+
return
208212
ptywclients = self.ptys_by_fd[fd]
209213
try:
210214
s = ptywclients.ptyproc.read(65536)

0 commit comments

Comments
 (0)