@ -1102,3 +1102,14 @@ def set_active_tty(ttynum):
chvt = getProgPath("/usr/bin/chvt")
if chvt:
os.system('chvt %d &>/dev/null' % ttynum)
def get_active_tty():
"""
Получить активный терминал
getvt = getProgPath("/usr/bin/fgconsole")
if getvt:
p = process(getvt)
if p.success():
return p.read().strip()
return None