File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -367,7 +367,7 @@ def __init__(
367367 self ._current_line = ""
368368
369369 # current line of output - stdout and stdin go here
370- self .current_stdouterr_line = ""
370+ self .current_stdouterr_line = "" # Union[str, FmtStr]
371371
372372 # this is every line that's been displayed (input and output)
373373 # as with formatting applied. Logical lines that exceeded the terminal width
@@ -1582,8 +1582,18 @@ def move_screen_up(current_line_start_row):
15821582 current_line_height = current_line_end_row - current_line_start_row
15831583
15841584 if self .stdin .has_focus :
1585+ logger .debug (
1586+ "stdouterr when self.stdin has focus: %r %r" ,
1587+ type (self .current_stdouterr_line ),
1588+ self .current_stdouterr_line ,
1589+ )
1590+ stdouterr_width = (
1591+ self .current_stdouterr_line .width
1592+ if isinstance (self .current_stdouterr_line , FmtStr )
1593+ else wcswidth (self .current_stdouterr_line )
1594+ )
15851595 cursor_row , cursor_column = divmod (
1586- wcswidth ( self . current_stdouterr_line )
1596+ stdouterr_width
15871597 + wcswidth (
15881598 self .stdin .current_line , max (0 , self .stdin .cursor_offset )
15891599 ),
You can’t perform that action at this time.
0 commit comments