1752426 Members
5797 Online
108788 Solutions
New Discussion юеВ

.profile and .dtprofile

 
SOLVED
Go to solution
Omar Alvi_1
Super Advisor

.profile and .dtprofile

Hi,

I would like to set backspace to be deafult for erase using stty on logging in.

I am using a GUI program for the telnet session so I set erase as backspace in ~/.profile. However on logging in backspace is not set as erase.

Any help appreciated.

Regards,

-Alvi

7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: .profile and .dtprofile

login in telnet and ssh

stty -1 > /tmp/tty.text

Take out of there the backspace key and others you want to work in .dtprofile and add it to those profiles.

[root@jerusalem root]# stty -a
speed 38400 baud; rows 24; columns 80; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = ;
eol2 = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W;
lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke

This output is from Linux but you get the idea.

This will solve the issue you've raised.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Robert-Jan Goossens
Honored Contributor

Re: .profile and .dtprofile

Hi Alvi,

Try this in your .profile,
stty erase "^H"

Hope it helps,

Robertt-Jan.
twang
Honored Contributor

Re: .profile and .dtprofile

1. Set the backspace using stty in .profile:
stty erase "^H"
2. And set dtsourceprofile to true in .dtprofile:
DTSOURCEPROFILE=true
Bill Hassell
Honored Contributor

Re: .profile and .dtprofile

Two areas need to be addressed:

Many Xwindow emulators had the DELETE key defaulted to the backspace key (makes VMS user happy, but the rest of us..). So make sure that the emulator you are using has the backspace key mapped to backspace (ie, CTLR-H).

The second concern is .profile and logins using CDE or borrowing dtterm/xterm/hpterm emulators. CDE by default starts these local HP-UX clients without a login so .profile is bypassed. So check that .profile is actually run during login with something like:

echo ".profile start..."

at the beginning of .profile. If it is not being run, do this (on the server where the emulators are run) to force the terminal emulators to actually run all profiles:

echo "*loginShell: true" >> $HOME/.Xdefaults




Bill Hassell, sysadmin
Mike Stroyan
Honored Contributor

Re: .profile and .dtprofile

The dtterm, hpterm, and xterm emulators all respond to a ttyModes resource. You can put a
*ttyModes: erase ^H
line in ~/.Xdefaults to have the terminal emulators start with termio set to have backspace as erase.

| ttyModes
| This resource specifies a string containing terminal-setting
| keywords and the characters to which they may be bound.
| Allowable keywords include: intr, quit, erase, kill, eof, eol,
| swtch, start, stop, brk, susp, dsusp, rprnt, flush, weras, and
| Inext. Control characters may be specified as ^char (e.g. ^c or
| ^u), and ^? may be used to indicate delete. This is very useful
| for overriding the default terminal settings without having to do
| an stty every time an hpterm is started.

Twang- The DTSOURCEPROFILE=true setting determines whether dtsession sources ~/.profile before the CDE session starts up. That is done when there is no tty to perform an stty on. The setting does not cause .profile to be used when individual terminal emulators start up.
Omar Alvi_1
Super Advisor

Re: .profile and .dtprofile

Hi all and thanks for the input.

Well, I tried playing around with the dtprofile and .profile, and quotes, and sehlls, but in the end this is how I solved the problem.

Editing the .profile as follows
ENV=$HOME/.shrc ; export ENV

And then create the file $HOME/.shrc containing
stty erase ^?

Apart from this, what exactly is the effect of DTSOURCEPROFILE=TRUE, does it execute both .dt and .profile or only .profile.

If I have a line under DTSOURCEPROFILE=TRUE, will it be executed.

And I didn't get much of what Mike said about there being no tty.

Thanks and Regards,

-Alvi
Alex Glennie
Honored Contributor
Solution

Re: .profile and .dtprofile

DTSOURCEPROFILE= true

will source the users .profile at CDE login only ! see Mike comments re dtsession, note his warning about individual emulators eg dtterm,xterm and hpterm.

If you check their repsective man pages you will see they do not source the .profile aka login shell by default : use either a -ls cmd line option or make use of the resource *loginShell : True

eg vi $HOME/.Xdefaults
dtterm*loginShell:True

DTSOURCEPROFILE only executes the .profile and yes if you add a line underneath it, it will be executed but may not be carried into the separate shells invoked by the individual terminal sessions under a CDE session .