def _dsr_get_cursor_position(self):
"""
Returns the current cursor positition as a DSR response in the form of::
'\x1b<self.cursorY>;<self.cursorX>R'
Also executes CALLBACK_DSR with the same output as the first argument.
Example::
self.callbacks[CALLBACK_DSR]('\x1b20;123R')
"""
esc_cursor_pos = '\x1b%s;%sR' % (self.cursorY, self.cursorX)
try:
for callback in self.callbacks[CALLBACK_DSR].values():
callback(esc_cursor_pos)
except TypeError:
pass
return esc_cursor_pos
评论列表
文章目录