Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

POSIX mode and tab completion?

28 views
Skip to first unread message

fen...@lightspeed.net

unread,
Feb 15, 1997, 3:00:00 AM2/15/97
to

Configuration Information [Automatically generated, do not change]:
Machine: i586
OS: linux
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DHOSTTYPE='i586' -DOSTYPE='linux' -DMACHTYPE='i586-unknown-linux' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./lib -g -O2
uname output: Linux ulfheim.lightspeed.net 2.1.26 #3 Sun Feb 9 21:06:51 PST 1997 i586
Machine Type: i586-unknown-linux

Bash Version: 2.0
Patch Level: 0
Release Status: release

Description:
I wanted to use bash in posix.2 mode, so I put the line
"set -o posix" in my .bash_profile. However, after using bash in
this mode for a few minutes I noticed that tab completion didn't
seem to be enabled. Further experimentation showed that if the
line "set -o posix" or "shopt -so posix" was present in /etc/profile
or ~/.bash_profile, then tab completion did not happen, but if the
same line was simply run on the command line, then tab completion
did not disappear.

This seems nonintuitive to me. Two questions: a) should this be
happening? b) If it should, is there an easy way for me to enable
posix mode in my profile without killing tab completion? It's an
ugly hack to type "set -o posix" on the command line every time I
login, or to have to patch the source with my limited skills.

Repeat-By:
Put the line "set -o posix" in ~/.bash_profile. Logout, then login.
Tab completion is dead. Remove line "set -o posix" from ~/.bash_profile.
Logout, then login. Tab completion is working. Type "set -o posix".
Tab completion is still working.

[note: to verify that posix mode was indeed turned on, I would run
a program known to output to stderr as follows: "foo >& /dev/null".
If posix mode was indeed enabled, then stderr would still output to
my terminal, unless the ">&" was changed to "&>".]

Thanks for your time.
Mike
--
---.-- Thinking of Maud you forget everything else.--More--
|{.... Michael Driscoll
|.d.@| <fen...@lightspeed.net> 35 22' 28" N 119 9' 38" W
------ Dynamic Home Page: http://userzweb.lightspeed.net/~fenris/

Chet Ramey

unread,
Feb 18, 1997, 3:00:00 AM2/18/97
to

> Configuration Information [Automatically generated, do not change]:
> Machine: i586
> OS: linux
> Compiler: gcc
> Compilation CFLAGS: -DPROGRAM='bash' -DHOSTTYPE='i586' -DOSTYPE='linux' -DMACHTYPE='i586-unknown-linux' -DSHELL -DHAVE_CONFIG_H -I. -I. -I./lib -g -O2
> uname output: Linux ulfheim.lightspeed.net 2.1.26 #3 Sun Feb 9 21:06:51 PST 1997 i586
> Machine Type: i586-unknown-linux
>
> Bash Version: 2.0
> Patch Level: 0
> Release Status: release
>
> Description:
> I wanted to use bash in posix.2 mode, so I put the line
> "set -o posix" in my .bash_profile. However, after using bash in
> this mode for a few minutes I noticed that tab completion didn't
> seem to be enabled. Further experimentation showed that if the
> line "set -o posix" or "shopt -so posix" was present in /etc/profile
> or ~/.bash_profile, then tab completion did not happen, but if the
> same line was simply run on the command line, then tab completion
> did not disappear.

Are you using the vi editing mode?

--
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, Case Western Reserve University Internet: ch...@po.CWRU.Edu

Chet Ramey

unread,
Feb 19, 1997, 3:00:00 AM2/19/97
to

> >> Machine Type: i586-unknown-linux
> >>
> >> Bash Version: 2.0
> >> Patch Level: 0
> >> Release Status: release
> >>
> >> Description:
> >> I wanted to use bash in posix.2 mode, so I put the line
> >> "set -o posix" in my .bash_profile. However, after using bash in
> >> this mode for a few minutes I noticed that tab completion didn't
> >> seem to be enabled. Further experimentation showed that if the
> >> line "set -o posix" or "shopt -so posix" was present in /etc/profile
> >> or ~/.bash_profile, then tab completion did not happen, but if the
> >> same line was simply run on the command line, then tab completion
> >> did not disappear.
> >
> >Are you using the vi editing mode?
>
> Yes, actually I am.

OK, that partly explains it. There is indeed a bug there, but in POSIX
mode, the vi editing mode should not map tab to complete. This is because
POSIX.2 completely specifies the behavior of the vi editing mode, and the
standard requires tab to be mapped to self-insert by default.

If you want to run in POSIX mode with TAB mapped to complete in vi mode,
leave `set -o posix' in your .bash_profile and add the following line
to ~/.inputrc:

TAB: complete

I have fixed the code so that `set [-+]o posix' does the same thing when
invoked on the command line as when present in .bash_profile.

0 new messages