- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Determine terminal type
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 08:37 AM
тАО01-21-2004 08:37 AM
Is there a way to determine the kind of terminal in use? I don't mean simply $TERM but rather a way of asking the terminal itself?
Thanks,
Jim
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 08:40 AM
тАО01-21-2004 08:40 AM
Re: Determine terminal type
There is something of a solution:
TTYPE=$(tset -)
echo "Terminal Type = ${TTYPE}"
man tset for details. The man pages may also give you ideas for other approaches. In general, the most foolproof way is to present the user with choices in the .profile and ask.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 08:44 AM
тАО01-21-2004 08:44 AM
Re: Determine terminal type
# ttytype -a -s
TERM='vt200'; export TERM;
LINES=24; export LINES;
COLUMNS=80; export COLUMNS;
ERASE='^?'; export ERASE;
Just do an eval $( ttytype -a -s ) and you're good to go.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 08:45 AM
тАО01-21-2004 08:45 AM
Re: Determine terminal type
Use tset as follows
tset -
HTH,
Jeff
"Captain! She just can't take any more!"
Bet you get tired of hearing that all the time....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 10:03 AM
тАО01-21-2004 10:03 AM
Solution- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-21-2004 03:13 PM
тАО01-21-2004 03:13 PM
Re: Determine terminal type
There are about 3 major categories of terminal emulations, ANSI/vt, Wyse and HP. ANSI terminals are similar to vt (which is a shorthand way of saying VT-series of terminals made by DEC a couple decades ago). These are not truly 'dumb' as they can answer questions, or more accurately, respond to certain escape sequences. And each of the 3 categories of terminals has a specific set of strings that cause the terminal to reply automatically. Most of these strings return some sort of ID and ttytype will often perform additional queries once the category is discovered. The order of test is:
Wyse
ANSI and VT
HP
ttytype waits for one second to see if the terminal responds and if not, assumes it is not compatible with that test and tries another query. During that time, you may see semi-random characters on the screen which don't mean anything to the terminal. If the qery works, the sequence (and response) are invisible. The actual escape sequences are:
.ESC i
.ESC[ci
.ESC*s1DC1i
where ESC is the escape character and DC1 is device control 1, used for handshaking in HP's commercial opsystem, MPE.
Therein lies the two-edged sword. One sequence will make a Wyse terminal respond with a valid ID but connect a VT-420 and the terminal will lock up due to it's unique response to an incompatible query.
So you need to check all the possible terminals (and emulators) you'll be using to see if ttytype locks any of them. Another technique is to specify only the family that you are using:
eval $(ttytype -t ansi -t hp -s)
This will cut down the test time by one second and since almost no one uses Wyse terminals or emulators, you won't miss anything by eliminating the Wyse test, and will likely eliminate terminal lockups (HP terminals and emulators reliably ignore the ansi test sequence.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2004 03:49 AM
тАО01-22-2004 03:49 AM
Re: Determine terminal type
Thanks for the ideas. I have a few users who access the system using modems connected to Televideo 925's. Those are the terminals that are giving me the most trouble. I also have problems when using reverse video on those terminals.
Thanks for your help,
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2004 04:00 AM
тАО01-22-2004 04:00 AM
Re: Determine terminal type
for reverse video. That would drop a "magic cookie" at the current location. Any text received after that would be in reverse video until a 2nd magic cookie was dropped turning off video.
The other (better) method was to carry attributes for each display character in the character itself. This required more terminal memory but screen space was not wasted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2004 04:09 AM
тАО01-22-2004 04:09 AM
Re: Determine terminal type
I, too, haven't seen a TVIXXX for quite some time. But I *think* they had VT100 & maybe even Wyse emulation. You could try setting it to VT100 & make your problems go away.
Rgds,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-22-2004 05:31 AM
тАО01-22-2004 05:31 AM
Re: Determine terminal type
This all assumes that the application program is using the Curses library or tput to display inverse video. If the program uses hard-coded escape sequences imbedded in the program, fire the programmer and get someone that knows there are better ways to handle terminals.
Bill Hassell, sysadmin