Print Page | Close Window

Get current cursor position on terminal screen?

Printed From: Rocket Software
Category: AccuTerm Knowledge Base (read only)
Forum Name: Scripting & Automation
Forum Description: Customize and control AccuTerm using scripts and automation
URL: https://forum.asent.com/forum_posts.asp?TID=2513
Printed Date: March 26 2026 at 8:51pm
Software Version: Web Wiz Forums 12.03 - http://www.webwizforums.com


Topic: Get current cursor position on terminal screen?
Posted By: accuterminal
Subject: Get current cursor position on terminal screen?
Date Posted: June 03 2015 at 7:37am
I'd like to grab data off the line where the user has the cursor



Replies:
Posted By: PSchellenbach
Date Posted: June 04 2015 at 9:58am
Hello -

Depending on the terminal emulation you are running you may be able to use an escape sequence to send the cursor line to the host. For example, Wyse 50/60 has an escape sequence to send the contents of the row where the cursor is positioned, from column 1 through the cursor location, back to the host with a CR at the end. This sequence is documented in the AccuTerm 7 Help, AccuTerm 7 Reference chapter, Wyse Programming topic, "Printer Control and Terminal Reports" section.

Otherwise you could use a script to read the screen text and send it back to the host. For example:
EQU ESC TO CHAR(27), STX TO CHAR(2), CR TO CHAR(13), EM TO CHAR(25)
PRINT @(5,5):
SLEEP 1
SCRIPT = 'InitSession.Output InitSession.GetText(0) & Chr(13)'
PRINT ESC:STX:'P':SCRIPT:CR:
ECHO OFF; PROMPT ''
INPUT STUFF
ECHO ON; PROMPT '?'

In the GetText() method, the "0" is the starting column. The other arguments are missing, using the defaults of "current row", "last column" and "all text".

Thanks,

Pete



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.03 - http://www.webwizforums.com
Copyright ©2001-2019 Web Wiz Ltd. - https://www.webwiz.net