Source

evolve-keyboard-layout / termctrl.py

from atexit import register
from sys import stdout
CSI = u'\x1b['
def write(unicode):
    home()
    stdout.write(unicode)
def control(unicode):
    stdout.write(CSI+unicode)
    stdout.flush()
def erase():
    control(u'2K')
def home():
    control(u'G')
def priorline():
    control(u'A')
def hide():
    control(u'?25l')
def show():
    control(u'?25h')
hide()
register(show)