From c8be993dd64134a93eecdfff176df21a3c5cb4f6 Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 29 Jul 2019 15:56:29 -0400 Subject: [PATCH] TTY info added to cursor_position. --- src/fenrirscreenreader/commands/commands/cursor_position.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/fenrirscreenreader/commands/commands/cursor_position.py b/src/fenrirscreenreader/commands/commands/cursor_position.py index bbb1208f..c85e167e 100644 --- a/src/fenrirscreenreader/commands/commands/cursor_position.py +++ b/src/fenrirscreenreader/commands/commands/cursor_position.py @@ -5,6 +5,8 @@ # By Chrys, Storm Dragon, and contributers. from fenrirscreenreader.core import debug +import os +import sys class command(): def __init__(self): @@ -14,13 +16,13 @@ class command(): def shutdown(self): pass def getDescription(self): - return _('displays the position of the review cursor') + return _('displays the position of the review cursor and current TTY') def run(self): # Prefer review cursor over text cursor cursorPos = self.env['runtime']['cursorManager'].getReviewOrTextCursor() - self.env['runtime']['outputManager'].presentText(_("line {0}, column {1}").format(cursorPos['y']+1, cursorPos['x']+1), interrupt=True) + self.env['runtime']['outputManager'].presentText(_("line {0}, column {1}, " + str(os.ttyname(sys.stdout.fileno()))[5:].replace("/", "")).format(cursorPos['y']+1, cursorPos['x']+1), interrupt=True) def setCallback(self, callback): pass