Re: difference between complete -o default and -o bashdefault

2005-07-08 Thread Tatavarty Kalyan
I think bashdefault tries out  username,hostname,command word,glob
completions where as 'default' just tries out filename completions.


On 7/8/05, Ian Macdonald <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I can't quite work out what the difference is between -o default and -o
> bashdefault. One is readline-oriented and the other is not, but the
> effect appears to be the same for the cases that I have run through.
> 
> Anyone?
> 
> Ian
> --
> Ian Macdonald   | The one good thing about repeating your
> [EMAIL PROTECTED] | mistakes is that you know when to cringe.
> http://www.caliban.org/ |
> |
> |
> 
> 
> ___
> Bug-bash mailing list
> Bug-bash@gnu.org
> http://lists.gnu.org/mailman/listinfo/bug-bash
>


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


--with-installed-readline breaks tilde-expansion

2005-07-08 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On the cygwin list, a difference was pointed out between compilations of
bash that avoid or use --with-installed-readline:

static_bash$ echo $HOME ~
/home/eblake /home/eblake
static_bash$ HOME=/tmp; echo $HOME ~
/tmp /tmp

dynamic_bash$ echo $HOME ~
/home/eblake /home/eblake
dynamic_bash$ HOME=/tmp; echo $HOME ~
/tmp /home/eblake

When compiling statically (without using --with-installed-readline), bash
uses its own -ltilde, and sh_get_env_value resolves to bash's
implementation in variable.c, which correctly searches bash's alternative
environment.

When compiling dynamically out of the box (using
- --with-installed-readline), there is a link error of multiply defined
symbols.  The problem here is that bash wants to use the static -ltilde
but the dynamic libreadline.dll; but since cygwin forbids dynamic
libraries with undefined symbols, libreadline.dll was already compiled
with -ltilde and all the symbols from -ltilde conflict with those from the
dynamic library.  My patch to this issue is below.

When compiling dynamically with the patch applied, bash gets its
tilde-expansion routines from the dynamic libreadline.  Unfortunately,
when compiling libreadline, sh_get_env_value resolves to readline's
version in shell.c, which just calls getenv().  Cygwin does not allow
bash's sh_get_env_value (or getenv) to override libreadline.dll's version
(back to that no undefined symbol rule - tilde.c cannot link into a
dynamic library with an import of sh_get_env_value unless sh_get_env_value
is defined as part of the dynamic library).  So tilde expansion is now
stuck reading the global environ instead of bash's environment, and since
bash does not update environ, tilde expansion is frozen to the value of
$HOME at process invocation.

I think the best solution would be a backwards-compatible extension to the
tilde library.  It should provide a new exported variable that defaults to
NULL (in which case tilde_expand_word falls back to calling the imported
sh_get_env_value), but which applications can set to override the calls to
sh_get_env_value (and thus sh_get_home_dir).  It could either be a char*
(the current string representing HOME/home_dir in bash's notion of the
environment) or a function pointer (a callback that lets bash compute the
current HOME or home_dir every time it is needed), I'm not sure which of
those two options would be easier for bash.  This new export would bump
the API version of readline (to 5.1?), and then compiling bash
- --with-installed-readline would have to use this new entry point so that
it can tell tilde_expand_word what to use so that tilde-expansion isn't
stuck expanding from a stale environment.


- --- bash-3.0-orig/configure.in  2004-07-21 14:06:54.0 -0600
+++ bash-3.0/configure.in   2005-05-24 20:29:34.0 -0600
@@ -487,14 +487,15 @@
esac
;;
esac
- -   READLINE_DEP=
+   READLINE_DEP= TILDE_LIB=
else
RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
READLINE_DEP='$(READLINE_LIBRARY)'
+TILDE_LIB=-ltilde
fi
 else
RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
- -   READLINE_LIB= READLINE_DEP=
+   READLINE_LIB= READLINE_DEP= TILDE_LIB=-ltilde
 fi
 if test $opt_history = yes || test $opt_bang_history = yes; then
if test $opt_history = yes; then
@@ -528,6 +529,7 @@
 AC_SUBST(RL_LIBDIR)
 AC_SUBST(RL_INCLUDEDIR)
 AC_SUBST(RL_INCLUDE)
+AC_SUBST(TILDE_LIB)
 AC_SUBST(HISTORY_LIB)
 AC_SUBST(HISTORY_DEP)
 AC_SUBST(HIST_LIBDIR)
- --- bash-3.0-orig/Makefile.in   2004-03-17 06:34:39.0 -0700
+++ bash-3.0/Makefile.in2005-07-06 05:59:58.0 -0600
@@ -309,7 +309,7 @@
 TILDE_LIBDIR = $(dot)/$(LIBSUBDIR)/tilde
 TILDE_ABSSRC = ${topdir}/$(TILDE_LIBDIR)

- -TILDE_LIB = -ltilde
+TILDE_LIB = @TILDE_LIB@
 TILDE_LIBRARY = $(TILDE_LIBDIR)/libtilde.a
 TILDE_LDFLAGS = -L$(TILDE_LIBDIR)
 TILDE_DEP = $(TILDE_LIBRARY)

- --
Life is short - so eat dessert first!

Eric Blake [EMAIL PROTECTED]
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.0 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCznYv84KuGfSFAYARAmw3AJ9Yam4HBCFu4zZ+93Tpwstt3CkkzgCcDG7X
VGiwfFrmNtArlMztTtF8Cdk=
=6Ifo
-END PGP SIGNATURE-


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


add PS1 to messages?

2005-07-08 Thread Dan Jacobson
Not sure if there is any fix for this. When sending messages like
"Terminated" to the terminal, maybe also send a PS1, if indeed we are
in prompt waiting foreground mode or whatever. Don't just leave the
users cursor parked at column 1:
# PS1="# "
# sleep 33&
[1] 3355
# killall sleep
# [1]+  Terminated  sleep 33
jobs
# 


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


Re: unable to redirect readonly variable error

2005-07-08 Thread Chet Ramey
Ian Macdonald wrote:
> Hello,
> 
> This doesn't seem right:

If no command name results after word expansion, variable assignments
take place in the current shell environment, and rediretions take
place in a subshell environment.  The variable assignments are attempted
first.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


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


Re: [completion with directory starting with = doesn't work]

2005-07-08 Thread Chet Ramey
Tatavarty Kalyan wrote:
> I see the same behaviour as posted above.
> 
> # mkdir =foo =foobar
> # cd =\=foo
> -bash: cd: ==foo: No such file or directory
> # echo $BASH_VERSION
> 2.05b.0(1)-release
> 
> I get the same result with bash version 3.00.15(1)-release.
> 
> I am not sure if this is related to bash completion package.

Type `complete cd'.  If you get output, you're using a completion
function for cd.  I can't reproduce the problem with stock bash-2.05
or 3.0.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet )
Live...Laugh...Love
Chet Ramey, ITS, CWRU[EMAIL PROTECTED]http://cnswww.cns.cwru.edu/~chet/


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