Operating System - HP-UX
1819695 Members
3683 Online
109605 Solutions
New Discussion юеВ

vt220/ANSI terminal programming

 
SOLVED
Go to solution
A. Daniel King_1
Super Advisor

vt220/ANSI terminal programming

I'm trying to use ansi escape sequences to save and restore cursor positions on a vt220 terminal. I understand that I get:

[s - for save
[u - for unsave (or restore)

For testing, I'm calling printf from the HP-UX command line like this:

$printf "\033[s\033[HTEST\033[u" > /dev/pts/tw

The TEST text comes through fine, the change to the home position works, but the save/restore fails me.

Ideas?

Thanks in advance!
Command-Line Junkie
2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: vt220/ANSI terminal programming

Hi:

Rather than rely on hardcoded terminal codes, you should avail yourself of 'tput'. have a look at the man pages for 'tput(1)'.

Regards!

...JRF...
A. Daniel King_1
Super Advisor

Re: vt220/ANSI terminal programming

Very cool with tput. I'm now pass-through printing, too (tput mc5, tput mc4).
Command-Line Junkie