Filename completion adds extra chars to command line

2005-06-03 Thread jerry
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: cygwin
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS  -I.  -I/tmp/bash-3.0
-I/tmp/bash-3.0/include -I/tmp/bash-3.0/lib   -O2
uname output: CYGWIN_NT-5.0 PN100-01-1-123s 1.5.17(0.129/4/2) 2005-05-25
19:38 i686 unknown unknown Cygwin
Machine Type: i686-pc-cygwin

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:

After hitting TAB twice for a list of possible candidates for filenames,
the command line following the list has too many characters on it.  It
may
be that the shell is not properly accounting for escape code in the
prompt.

This problem does not occur with command name completion.


Here is a sample:

123 scripts > ls CVS/- Hit TAB twice
Entries Repository  Root
123 scripts > ls CVS/ CVS/

Using the backspace key to try to erase the entire command, leaves:

123 scripts > ls CV


Another sample:

127 scripts > ls /usr/bin/zip
zip.exe   zipgrep   zipnote.exe
zipcloak.exe  zipinfo   zipsplit.exe
127 scripts > ls /usr/bin/zipn/zip

Backspacing to erase the command leaves behind:

127 scripts > ls /u


My prompt is defined as:

PS1='\[\e]2;\w\007\]\[\e[1;31m\]\# \[\e[32m\]\W \[\e[36m\]> \[\e[0m\]'


As an example of command name completion (which doesn't show this
problem):

126 scripts > ln - Hit TAB twice
ln.exe   lnkstub.exe
126 scripts > ln

Backspacing to erase the command leave just the prompt (as it should).


Repeat-By:

Set prompt to:

PS1='\[\e]2;\w\007\]\[\e[1;31m\]\# \[\e[32m\]\W \[\e[36m\]> \[\e[0m\]'

Test filename completion with:  ls /usr/bin/zip

Observe extra chars added to command line.

Backspace to erase the command line.  Observes that extra characters
remain after the prompt.


Fix:

(I have no fix to offer.)



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


problem with option -e, compound commands, and pipelines

2005-06-03 Thread Jan Beulich
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/local/share/locale' -DPACKAGE='bash' 
-DSHELL -DHAVE_CONFIG_H  -I.  -I/home/jbeulich/cpp/bash/3.0.16 
-I/home/jbeulich/cpp/bash/3.0.16/include -I/home/jbeulich/cpp/bash/3.0.16/lib   
-g -O2
uname output: Linux dus-dev-sl90 2.6.5-7.179-mpdbg #131 SMP Wed Jun 1 10:26:21 
CEST 2005 i686 i686 i386 GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:

With the below script, I would expect that either none or all of the cases allow
reaching the end of the script (i.e. the final echo statement); cases 1, 2, and 
4
fall through (with $? being 1), while cases 0 and 3 don't (as I expected).
Whether execution should fall through depends, as I understand it, in how one
reads that specification: If, like the specification says, indeed only simple
commands are influenced by -e, then all cases should reach the end. This
however doesn't seem to make much sense, and hence I'd rather interpret
the spec text a little less strict (allowing -e to apply to all commands), 
resulting
in the need for all cases to terminate early (as btw. ash and zsh do).

Repeat-By:
*script begin*
#!/bin/bash -ex

case "$1" in 
0)
true | false
;;
1)
true | { false; }
;;
2)
true | ( false )
;;
3)
while true
do
false
done
;;
4)
true | while true
do
false
done
;;
esac
echo "Result=$?"
*script end*

Jan



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Clearing window (^L) messes up command line

2005-06-03 Thread jerry
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: cygwin
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash.exe' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='cygwin' -DCONF_MACHTYPE='i686-pc-cygwin'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash'
-DSHELL -DHAVE_CONFIG_H -DRECYCLES_PIDS  -I.  -I/tmp/bash-3.0
-I/tmp/bash-3.0/include -I/tmp/bash-3.0/lib   -O2
uname output: CYGWIN_NT-5.0 PN100-01-1-123s 1.5.17(0.129/4/2) 2005-05-25
19:38 i686 unknown unknown Cygwin
Machine Type: i686-pc-cygwin

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:

Typing in a command (without hitting ), and then clearing the window
with ^L results in extra characters being added to the command line.
This may be the result of bash not properly taking into account escape
sequences in the prompt.


As an example:

250 scripts > ls /bin  -  not typed yet

Now I press ^L, and the window looks like:

250 scripts > ls /bin /bin

Trying to erase the entire line using BS, leaves:

250 scripts > ls /b


My prompt is set to:

PS1='\[\e]2;\w\007\]\[\e[1;31m\]\# \[\e[32m\]\W \[\e[36m\]> \[\e[0m\]'


Repeat-By:

Set prompt to:

PS1='\[\e]2;\w\007\]\[\e[1;31m\]\# \[\e[32m\]\W \[\e[36m\]> \[\e[0m\]'

At the shell prompt, type a command without hitting .
Now type ^L.   Observe extra chars added to the command.

Backspace to try to eliminate the entire line.  Observe that some
chars cannot be erased.


Fix:

(I have none.)



___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash