2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-28 16:20:54 +00:00

Restore cursor position explicitly

This allows full redraw of whitespace and very precisely
restores the position of the cursor to the right place.
This commit is contained in:
Jarrod Johnson
2017-03-16 11:27:30 -04:00
parent 639a7352ad
commit 79474ea9fb
+2 -2
View File
@@ -486,8 +486,8 @@ class ConsoleHandler(object):
else:
pendingbl += nline + '\r\n'
retdata = retdata[:-2] # remove the last \r\n
#TODO: have pyte tell us cursor position and use that?
retdata = retdata.rstrip()
retdata += b'\x1b[{0};{1}H'.format(self.buffer.cursor.y + 1,
self.buffer.cursor.x + 1)
if self.shiftin is not None: # detected that terminal requested a
# shiftin character set, relay that to the terminal that cannected
retdata += '\x1b)' + self.shiftin