1754020 Members
7602 Online
108811 Solutions
New Discussion юеВ

stty question

 
Shawn_45
Occasional Advisor

stty question

Hello,

autocomplete was not set somehow. I guess (yes, I am just guessing because it was not mentioned in the book how it was set) it has something to do with stty just like erase.

Here is output of stty -a:
$ stty -a
speed 300 baud; line = 0;
rows = 24; columns = 80
min = 1; time = 0;
intr = ^C; quit = ^\; erase = DEL; kill = ^U
eof = ^D; eol = ^@; eol2 ; swtch
stop = ^S; start = ^Q; susp = ^Z; dsusp
werase ; lnext
-parenb -parodd cs8 -cstopb hupcl cread -clocal -loblk -crts
-ignbrk brkint -ignpar -parmrk -inpck istrip -inlcr -igncr icrnl -iuclc
ixon ixany ixoff -imaxbel -rtsxoff -ctsxon -ienqak
isig icanon -iexten -xcase echo echoe echok -echonl -noflsh
-echoctl -echoprt -echoke -flusho -pendin
opost -olcuc onlcr -ocrnl -onocr -onlret -ofill -ofdel -tostop

Does anyone know which one sets autocomplete? If it is not set here then how is it set? Currently it is working in my csh but not in sh.

Shawn
8 REPLIES 8
Michael Tully
Honored Contributor

Re: stty question

The setting of auto-completion is done in the shell, not in the tty.

Try setting your shell to be 'ksh' from the $ prompt. Once you have use the escape key (twice)
Anyone for a Mutiny ?
Michael Steele_2
Honored Contributor

Re: stty question

For clarification we're talking about ESC ESC for filename expansion and ESC once to vi your command history?

Command recall and filename expansion is a korn shell feature. It can also be found in POSIX. Put the line below in your root account's /etc/profile file or in your .profile file for other accounts that use POSIX.

export HISTFILE=$HOME/.sh_history
Support Fatherhood - Stop Family Law
Shawn_45
Occasional Advisor

Re: stty question

Hi,

As I said, I can always use the feature in csh. My point was not to use it but to know how to set it.

I am not talking about history so export HISTFILE was not the solution I am afraid :-( I found I am lucky that things always don't work the same way as described in the book.


Thanks for your replies!

Shawn
T G Manikandan
Honored Contributor

Re: stty question

In csh
you should use

#set filec

to set that

THanks
Ty Roberts
Frequent Advisor

Re: stty question

I am currently having this same problem. One of the users set to use KSH, the autocomplete feature will not work. Stty -a is the same as a user where it does work and I have run set filec and still no dice..

any help would be greatly appreciated.

Thanks,
Ty
John Kittel
Trusted Contributor

Re: stty question

In ksh and sh I don't think file name completion needs to be turned on. It is always on. ESC ESC or ESC \ should try to complete. Perhaps in your terminal emulation the ESC key is not mapped? Try Ctrl-[ in place of escape. ( thats a control left-square-bracket ).
John Kittel
Trusted Contributor

Re: stty question

Check seting of variables VISUAL and EDITOR in .profile

For example, I use sh, if $EDITOR=vi, file name completion works with ESC ESC, and ESC \. BUT, if $EDITOR=emacs, only ESC ESC works. ESC \ does not.

Bill Hassell
Honored Contributor

Re: stty question

For POSIX shells in HP-UX (/usr/bin/sh, /usr/bin/ksh, even bash), you must set HISTFILE and HISTSIZE, and for completeness, set EDITOR=/usr/bin/vi. HISTFILE does not take effect if typed in after starting the shell, it must be set by /etc/profile or .profile, anytime before the first prompt by the shell. If this is a workstation problem, the default is NOT to run /etc/profile or .profile at all. The terminal emulators (hpterm, xterm, dtterm) must be started with the *loginShell:true (Xwindow resource) or -ls option on the command line. Command recall and filename completion will work on all the POSIX shells (once setup with the above env variables) in HP-UX.


Bill Hassell, sysadmin