Thread View: gnu.bash.bug
2 messages
2 total messages
Started by bothner
Sat, 09 Sep 1989 02:35
Re: Bash example for xterm users
Author: bothner
Date: Sat, 09 Sep 1989 02:35
Date: Sat, 09 Sep 1989 02:35
141 lines
4430 bytes
4430 bytes
Alas, the example I just sent out confuses bash too easily.
The problem is most likely that the length of the string
is longer than the actual visible prompt string.
So simple commands work fine, but (say) file-name completion
loses big.
In fact, I got the following output:
free: Called with already freed block argument
Tell bfox@ai.mit.edu to fix this someday.
Mailing a bug report...Freeze file out of date
--- and then I got the folling (bounced) mail message.
--Per
P.S.
One solution is to have "normal" strings in PS1,
and then alias cd,pushd, etc to have the side effect of
changing the title bar. This works reasonably well in tcsh,
but I haven't tried it for bash.
It would also help if readline (?) could be made more robust.
This may be hard for arbitrary control sequences, but one
could have a convention that when calculating the length of
a prompt string, only count characters after a '\r' or '\n'.
Then one could place a '\r' after the "invisible" part of the prompt.
Another solution is to do something like tcsh's precmd alias,
which is automatically executed before each prompt.
The "precmd" could be responsible for setting the title bar.
------------------------
This is a Bash bug report. Bash maintainers should be getting this report.
If this mail has bounced, for right now please send it to:
bfox@ai.mit.edu
since he is the current maintainer of this version of the shell.
This is /usr/local/bin/bash (invoked as `/private/usr/local/emacs/info/bash'), version 1.03.109, on host wslt03.pa.dec.com, used by bothner.
This shell is interactive, and it is not a login shell.
The host is a SONY running Bsd.
The current environment is:
function setname () {
{ TERMNAME="$*"; if [ "$TERM" = "xterm" ] ; then
echo -n "]1;${TERMNAME}"
fi
}
}
TERMNAME=xterm
OLDPWD=/mnt/bothner
no_exit_on_failed_exec=
notify=
auto_resume=
function dc () {
{ echo "Oops! mistyped cd again, I assume!"; builtin cd $* }
}
function unsetenv () {
{ unset $* }
}
function setenv () {
{ export $1="$2" }
}
STANDARD_PATH=/usr/local/bin:/usr/bin/X11:/usr/sony/bin/X11:/etc:/usr/etc:/usr/ucb:/bin:/usr/bin:/usr/sony/bin:/usr/new:/usr/new/mh:/usr/pds/bin:/usr/hosts:/usr/sony/games:/usr/pds/games:/usr/games
UTIL_PATH=:/usr/bin/X11
MACH=vax
X11=/usr/bin/X11
GNU=
HOST=wslt03.pa.dec.com
EUID=7
UID=7
HISTSIZE=256
HISTFILE=/mnt/bothner/.bash_history
BASH_VERSION=1.03.109
PWD=/usr/local/emacs/info
MAILPATH=/usr/spool/mail/bothner
MAILCHECK=60
IFS=
PS2=bash>
PS1=]2;${TERMNAME}: \w@\h\r\h<\!>
MANPATH=/usr/local/man:/usr/man
cputype=mc68020
machine=news800
SYS_LANGUAGE=Japanese
TZ=pst8pdt
HOME=/mnt/bothner
SHELL=/usr/local/bin/bash
TERM=xterm
USER=bothner
PATH=/usr/local/bin:/usr/bin/X11:/usr/sony/bin/X11:/etc:/usr/etc:/usr/ucb:/bin:/usr/bin:/usr/sony/bin:/usr/new:/usr/new/mh:/usr/pds/bin:/usr/hosts:/usr/sony/games:/usr/pds/games:/usr/games:.
TTYPE=ascii
SHLVL=4
BASH=/usr/local/bin/bash
TERMCAP=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: :AL=\E[%
dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP: :ti=\E7\E[?47h:te=\E[2J\E[?47l\E8: :as=\E(0:ae=\E(B:DE=^H:
WINDOWID=4194309
DISPLAY=unix:0.0
And here are the last 40 commands.
ls
cd src-g++/
ls
t HINTS
t ChangeLog
ls -l ideas
t ideas
cd
uncompress gcc.xtar.Z
cd /mnt/g++
cd /mnt/gnu/g++
ls
d src-g++/
cd src-g++/
ls
cd /mnt/emacs
ls
ls /mnt/gnu
cd ..
cd emacs
cd /mnt/gnu/emacs
ls
cd dist-18.55/
ls
cd info/
ls
t dir
cd /usr/local/lib
ls
cd ../emacs
ls
cd info
pwd
ls
df
cd
ls
ls -l *.Z
rm et.tar.Z
rm imake
Bash example for xterm users
Author: Brian Fox
Date: Sun, 10 Sep 1989 01:20
Date: Sun, 10 Sep 1989 01:20
29 lines
1569 bytes
1569 bytes
Date: Fri, 08 Sep 89 19:35:42 -0700 From: bothner@wsl.dec.com One solution is to have "normal" strings in PS1, and then alias cd,pushd, etc to have the side effect of changing the title bar. This works reasonably well in tcsh, but I haven't tried it for bash. It would also help if readline (?) could be made more robust. This may be hard for arbitrary control sequences, but one could have a convention that when calculating the length of a prompt string, only count characters after a '\r' or '\n'. Then one could place a '\r' after the "invisible" part of the prompt. Yes, this should be done, but it will not solve the problem. The specific set of commands might be "esc-seq string esc-seq". There is no place in that string where a \r could be placed to tell bash where the cursor was. Another solution is to do something like tcsh's precmd alias, which is automatically executed before each prompt. You mean Bash's PROMPT_COMMAND variable? The "precmd" could be responsible for setting the title bar. Brian
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads