1833247 Members
3144 Online
110051 Solutions
New Discussion

Re: Term setting

 
SOLVED
Go to solution
Ngoh Chean Siung
Super Advisor

Term setting

Hi,

stty & tset are the 2 methods to set Termainl characteristics (TERM).

May I know what is the difference between them and when to apply which method?

regards.
3 REPLIES 3
Mark Grant
Honored Contributor

Re: Term setting

"stty" sets individual characteristics as per your instructions. "tset" sets all the characteristics of a terminal according to what is probably right for your terminal.
Never preceed any demonstration with anything more predictive than "watch this"
Ngoh Chean Siung
Super Advisor

Re: Term setting

Hi,

Thanks Grant.

Could you pls provide me some cases when to apply these 2 methods? Because I'm still not very clear about it.

regards.
Mark Grant
Honored Contributor
Solution

Re: Term setting

Generally speaking, you use "tset" in the users ".profile" or equivalent so that all the settings get set up when the user logs in. However, if you want to change something specific at some time, for example, you have a user who runs an application that uses CNTL C for a command, you might add a "stty intr ^T" to change the interrupt character for that user.

Alternatively, maybe you run some application that crashes, leaving you in raw mode. Everytime you press ENTER, the cursor moves down but not to the left and you find ^J is the only way to press a real ENTER. You might just run a brief "stty onlcr" to solve that one. You probably would also have to run "stty -noraw", "stty echoe" and "stty echo" in the above example but we'll not worry too much about that (particularly as "stty sane" would have done all of them for you).

So basically, "tset" is like running an application to set up your terminal and "stty" is for a more fine grained changes.
Never preceed any demonstration with anything more predictive than "watch this"