File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -265,13 +265,15 @@ def __init__(
265265 if in_stream is None :
266266 in_stream = sys .__stdin__
267267 self .in_stream = in_stream
268+ # whether we can use blessed to handle some operations
269+ self ._use_blessed = (
270+ self .out_stream == sys .__stdout__ and self .in_stream == sys .__stdin__
271+ )
268272 self ._last_cursor_column : Optional [int ] = None
269273 self ._last_cursor_row : Optional [int ] = None
270274 self .keep_last_line = keep_last_line
271275 self .cbreak = (
272- Cbreak (self .in_stream )
273- if in_stream != sys .__stdin__ and out_stream != sys .__stdout__
274- else self .t .cbreak ()
276+ Cbreak (self .in_stream ) if not self ._use_blessed else self .t .cbreak ()
275277 )
276278 self .extra_bytes_callback = extra_bytes_callback
277279
You can’t perform that action at this time.
0 commit comments