[gnu.bash.bug] file completion doing ugly things under xterm

trost@reed.bitnet (Bill Trost) (11/17/89)

Namely, when I type <tab>, the entire line being completed gets
displayed twice, whether or not the completion is successful.

Since I don't use xterm that much, I'm probably not going to spend
much time tracking it down, but y'all might want to track it down
anyhow.

(I just hope this isn't a problem with my X resources....)
--

bfox@AUREL.CNS.CALTECH.EDU (Brian Fox) (11/17/89)

   Namely, when I type <tab>, the entire line being completed gets
   displayed twice, whether or not the completion is successful.

   Since I don't use xterm that much, I'm probably not going to spend
   much time tracking it down, but y'all might want to track it down
   anyhow.

   (I just hope this isn't a problem with my X resources....)
   --

I need the version of Bash, the machine, the operating system, and
possibly your xterm termcap entry.

I live in X windows and do not have this problem.

Brian

trost@reed.bitnet (Bill Trost,Box 607,ext 571,497) (11/18/89)

Oh, gack.  It looks like the problem is with the Tektronix termcap
entry for xterm, which seems to have been copied onto our Vax.  Maybe.

On the DECstation (no problems), TERMCAP is set to

vs|xterm|vs100|xterm terminal emulator (X window system):\
	:cr=^M:do=^J:nl=^J:bl=^G:le=^H:ho=\E[H:\
	:co#80:li#24:cl=\E[H\E[2J:bs:am:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\
	:ce=\E[K:cd=\E[J:so=\E[7m:se=2\E[m:us=\E[4m:ue=\E[m:\
	:md=\E[1m:mr=\E[7m:me=2\E[m:\
	:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:ta=^I:pt:sf=\n:sr=\EM:\
	:al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:\
	:MT:ks=\E[?1h\E=:ke=\E[?1l\E>:\
	:is=\E[r\E\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:\
	:rs=\E[r\E<\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:xn

On the Vax and the Utek box, it is

vs|xterm|4316x|4317x|4319x|vs100|xterm terminal emulator (X window system):\
	:cr=^M:do=^J:nl=^J:bl=^G:le=^H:ho=\E[H:\
	:LC:co#80:li#24:cl=\E[H\E[2J:bs:am:cm=\E[%i%d;%dH:nd=\E[C:up=\E[A:\
	:ce=\E[K:cd=\E[J:so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:\
	:md=\E[1m:mr=\E[7m:me=\E[m:\
	:ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
	:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:ta=^I:pt:sf=\n:sr=\EM:\
	:al=\E[L:dl=\E[M:ic=\E[@:dc=\E[P:\
	:MT:ks=\E[?1h\E=:ke=\E[?1l\E>:\
	:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:\
	:rs=\E[r\E<\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l:xn:\
	:AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\
	: :hs:ts=\E[?E\E[?%i%dT:fs=\E[?F:es:ds=\E[?E:


And the problem doesn't occur on the Decstation.  If I use the
Decstation's termcap entry on the Vax, I get the same problem.  Hmmm.

Oh, sorry, this is bash 1.04, the Vax is an 11/785 running 4.3, the
Tek box is pretending to be a sun3 running Bsd, the decstation is
running Ultrix.

(Whaddya want the *version* for?? :-) )

khai@amara.uucp (S. Khai Mong) (11/22/89)

I too, was having funny things happenning to my completions, in that
it was printing it twice and losing track of where it was.  I was
quite resigned to living with it.   But one day I cleaned up my .login
file and the problem went away.

It turns out that when you invoke bash, the variable "EMACS" must
*not* be set.  If it is, bash thinks that it is running within Emacs
or something and does wierd things, the bad file completion being one
result.



--
Sao Khai Mong:   Applied Dynamics, 3800 Stone School Road, Ann Arbor, Mi48108
(313)973-1300 (uunet|sharkey)!amara!khai  khai%amara.uucp@mailgw.cc.umich.edu

trost@reed.bitnet (Bill Trost) (11/30/89)

>It turns out that when you invoke bash, the variable "EMACS" must
>*not* be set.  If it is, bash thinks that it is running within Emacs
>or something and does wierd things, the bad file completion being one
>result.

Bleah; yeah, I found the getenv("EMACS") in readline.c.  Might I
suggest that the check be made for TERM being set to emacs, instead of
the variable EMACS being checked, for those of us who start up xterms
from emacs?  (Seems like a saner way to do the check, anyhow)

And, on the other side of the coin, if it is determined that we are
running under emacs, bash shouldn't give you back the command line to
edit when a history lookup fails (eg, !sp instead of !ps).
--
--