1820566 Members
1970 Online
109626 Solutions
New Discussion юеВ

# at login

 
Scott Robarge
New Member

# at login

How can I control the behavior of the # at login? It erases the previous character as expected, but doesn't push the curser back at the same time--ie; at a login prompt, user mistypes 2nd character & then corrects it--
'ud#ser_name' is correctly interpreted (& displayed), rather than the pound sign moving the curser back to display only 'user_name'.
Help?
4 REPLIES 4
Steven E. Protter
Exalted Contributor

Re: # at login

We have the following line in /etc/profile

ENV=/.kshrc

which says

PS1=`uname -n`:'$PWD
[!]# '

This controls the prompt.

PS2 is the partial prompt you get when you don't complete a command.

echo "steve

gets PS2
>

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
Jeff Schussele
Honored Contributor

Re: # at login

Scott,

Since you haven't logged in yet, the only thing the system can go on is the termcap associated with the term type the user's terminal is reporting at login.
Not sure, but you'd probably have to adjust the termcap entries for the appropriate terminal types that will be logging in.
But I'd be careful what impact that has post-login. Test it before implementing.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Scott Robarge
New Member

Re: # at login

Thanks for your replies--Steven, I believe Jeff may be onto something (perhaps I wasn't clear--the user isn't actually logged in at the point of occurance, so no 'ENV' is set yet). Are there any other places to look beyond termcap?
Thanks again to you both!

Scott
Bill Hassell
Honored Contributor

Re: # at login

The # character is the default erase character for terminals and dates back to hardcopy (paper) terminals. So the behavior is designed to mimic paper devices (actually backspacing and typing over the character produced a blck smudge). The stty command is used to change the special meaning of special characters. Typically, you want something like this in /etc/profile or .profile:

/sbin/stty erase "^H" kill "^U" intr "^C" eof "^D" -parity ixoff

Now the backspace key works as expected. However, /etc/profile is run after login so the login and password prompts will not recognize backspace as the erase character/ For 11.0 and later (with patches), you can use the /dev/ttryconf device file to preset the stty settings from all terminal logins.


Bill Hassell, sysadmin