- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- setting TERM variables so that they still persist ...
Operating System - HP-UX
1822845
Members
3882
Online
109645
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
тАО11-17-2009 08:58 AM
тАО11-17-2009 08:58 AM
setting TERM variables so that they still persist after logging out
Hello All
I am trying to set the TERM variable on our HP 11.11 machines to xterm.
I can issue #set TERM=xterm, #TERM=xterm and all works ok but settings revert to TERM=sun once I log out.
I have also changed the .profile setting from:-
# Set up the terminal:
if [ "$TERM" = "" ]
then
if /bin/i386
then
TERM=sun-color
else
TERM=sun
fi
export TERM
fi
TO:
# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
but even with set and env set to TERM-xterm it still reverts to TERM=sun when I log out.
How can I set the TERM=xterm so it stays permanent. If TERM=sun, scrolling on teh terminal is not working properly.
Thank you
Regards
I am trying to set the TERM variable on our HP 11.11 machines to xterm.
I can issue #set TERM=xterm, #TERM=xterm and all works ok but settings revert to TERM=sun once I log out.
I have also changed the .profile setting from:-
# Set up the terminal:
if [ "$TERM" = "" ]
then
if /bin/i386
then
TERM=sun-color
else
TERM=sun
fi
export TERM
fi
TO:
# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
but even with set and env set to TERM-xterm it still reverts to TERM=sun when I log out.
How can I set the TERM=xterm so it stays permanent. If TERM=sun, scrolling on teh terminal is not working properly.
Thank you
Regards
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2009 09:17 AM
тАО11-17-2009 09:17 AM
Re: setting TERM variables so that they still persist after logging out
the answer is going to vary. If you're using X-Windows, check the .dtprofile and see this post regarding DTSOURCEPROFILE
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1384214
you may need to examine the value of $TERM just prior to you "new" statements:
# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
As, if it's already set, it won't run
Such code may already exist in the system-wide file /etc/profile.
and, of course, if you're using something other then the normal POSIX / Ksh shells, other start up files could (or would) come into play as well
http://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1384214
you may need to examine the value of $TERM just prior to you "new" statements:
# Set up the terminal:
if [ "$TERM" = "" ]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
As, if it's already set, it won't run
Such code may already exist in the system-wide file /etc/profile.
and, of course, if you're using something other then the normal POSIX / Ksh shells, other start up files could (or would) come into play as well
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-17-2009 06:58 PM
тАО11-17-2009 06:58 PM
Re: setting TERM variables so that they still persist after logging out
The problem is with this line:
if [ "$TERM" = "" ]
You never want to accept TERM from an outside source. There is a little known feature (RFC 1091) of telnet that most Unix system use and that is the terminal type subcode 24. Back in the late 1980's, this was thought to be useful when there were just a few well-defined terminal types. Today, you should never use the incoming terminal type (set before login). In your case, your local system is lying to HP-UX -- as far as I know, there is no "sun" terminal, just as there is no "linux" terminal.
HP-UX had the foresight to provide a tool to handle the dozens and dozens of terminals automatically. The program is called ttytype and you can see what it does with this command line:
ttytype -s
ttytype will query the telnet line asking the terminal to identify itself. The correct way to set the TERM (and LINES and COLUMNS and ERASE) variable is to rip out *ALL* the code in /etc/profile and .profile which tests for "$TERM" = "". Instead, the *only* TERM setup line will be:
eval $(ttytype -s)
Now, regardless of how a user connects to your system (xterm, hpterm, dtterm, PuTTY, SecureCRT, Reflection, QCterm, hyperterminal, or even a real terminal like a Wyse 50 or an HP 700/92, etc) the TERM variable (and related terminal characteristics) will be set correctly. Note that when you do not use a 'real' terminal such as xterm, resizing the terminal window can be problematic on older systems that do not support SIGWINCH, a special signal indicating that the LINES and COLUMNS variables need to be updated. The command:
eval $(resize)
will update the LINES and COLUMNS values to match the new window size.
In all cases, success in using vi is completely dependent on obtaining TERM, LINES, COLUMNS and ERASE correctly. AS you might guess, setting these automatically is the only sane way to do this.
Bill Hassell, sysadmin
if [ "$TERM" = "" ]
You never want to accept TERM from an outside source. There is a little known feature (RFC 1091) of telnet that most Unix system use and that is the terminal type subcode 24. Back in the late 1980's, this was thought to be useful when there were just a few well-defined terminal types. Today, you should never use the incoming terminal type (set before login). In your case, your local system is lying to HP-UX -- as far as I know, there is no "sun" terminal, just as there is no "linux" terminal.
HP-UX had the foresight to provide a tool to handle the dozens and dozens of terminals automatically. The program is called ttytype and you can see what it does with this command line:
ttytype -s
ttytype will query the telnet line asking the terminal to identify itself. The correct way to set the TERM (and LINES and COLUMNS and ERASE) variable is to rip out *ALL* the code in /etc/profile and .profile which tests for "$TERM" = "". Instead, the *only* TERM setup line will be:
eval $(ttytype -s)
Now, regardless of how a user connects to your system (xterm, hpterm, dtterm, PuTTY, SecureCRT, Reflection, QCterm, hyperterminal, or even a real terminal like a Wyse 50 or an HP 700/92, etc) the TERM variable (and related terminal characteristics) will be set correctly. Note that when you do not use a 'real' terminal such as xterm, resizing the terminal window can be problematic on older systems that do not support SIGWINCH, a special signal indicating that the LINES and COLUMNS variables need to be updated. The command:
eval $(resize)
will update the LINES and COLUMNS values to match the new window size.
In all cases, success in using vi is completely dependent on obtaining TERM, LINES, COLUMNS and ERASE correctly. AS you might guess, setting these automatically is the only sane way to do this.
Bill Hassell, sysadmin
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP