Re: --with-installed-readline breaks tilde-expansion

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

According to Eric Blake on 7/23/2005 7:14 AM:
> 
> The following patch, to both readline and bash, allows readline to export
> a hook (rather than trying to import a function, which doesn't work in
> dynamic libraries for at least cygwin), so that bash can then override
> getenv() even within the context of a dynamic readline library.  It fixes
> not only tilde expansion (HOME), but also other uses of sh_get_env_value,
> where readline needs to read environment variables from bash, rather than
> the original program environ: INPUTRC, LC_ALL, LANG, EMACS, TERM, COLUMNS,
> and LINES.

[Patch is available at
http://lists.gnu.org/archive/html/bug-bash/2005-07/msg00135.html]

This patch is still needed with bash-3.1-alpha, when dynamically linked
against readline-5.1-alpha.  Even with the bash-3.1 trick of setting
environ, cygwin's getenv() does not track the new environ from within the
shared library.

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

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

iD8DBQFC/KIV84KuGfSFAYARAgYYAKDXZu+d85hIL/Q/Ii6kyQesvufepQCfXfM1
GQ1Wxosp9xylAdxua0u2d9E=
=SQuQ
-END PGP SIGNATURE-


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


Bash completion in Cygwin

2005-08-12 Thread Gary Fritz
In
http://groups-
beta.google.com/group/gnu.bash.bug/browse_thread/thread/e0dc6716afe8162d/df
a06fd85db708e1
a bug was reported that prevented TAB completion from working properly in 
Cygwin when the "c:/" synonym for "/cygdrive/c" was used.  Because ":" is 
considered whitespace for completion for setting PATH, it breaks completion 
when you use c:/.

There was a "workaround" -- quote the ":", which is pretty painful when you 
have to type it dozens or hundreds of times a day.  How often do you set 
PATH!?

The bug was reported in 2002, and the reporter said he had a fix.  The bug 
is still present.  Could we reconsider accepting this fix so Cygwin users 
don't have to fight this hack zillions of times a day?

Gary


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


Re: Bash completion in Cygwin

2005-08-12 Thread Chet Ramey
Gary Fritz wrote:
> In
> http://groups-
> beta.google.com/group/gnu.bash.bug/browse_thread/thread/e0dc6716afe8162d/df
> a06fd85db708e1
> a bug was reported that prevented TAB completion from working properly in 
> Cygwin when the "c:/" synonym for "/cygdrive/c" was used.  Because ":" is 
> considered whitespace for completion for setting PATH, it breaks completion 
> when you use c:/.

The fix, available in the current release of bash, is to modify the
contents of the COMP_WORDBREAKS variable to remove the `:'.  That will
change readline's completion behavior so it does not break words to be
completed at colons.

For example:

COMP_WORDBREAKS=${COMP_WORDBREAKS//:/}

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: Bash completion in Cygwin

2005-08-12 Thread Gary Fritz
Chet Ramey <[EMAIL PROTECTED]> wrote: 
> The fix, available in the current release of bash, is to modify the
> contents of the COMP_WORDBREAKS variable to remove the `:'.

Outstanding!!  Exactly what I needed.  Thanks!
Gary


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


Re: Bash completion in Cygwin

2005-08-12 Thread J. David Boyd
Gary Fritz <[EMAIL PROTECTED]> writes:

> In
> http://groups-
> beta.google.com/group/gnu.bash.bug/browse_thread/thread/e0dc6716afe8162d/df
> a06fd85db708e1
> a bug was reported that prevented TAB completion from working properly in 
> Cygwin when the "c:/" synonym for "/cygdrive/c" was used.  Because ":" is 
> considered whitespace for completion for setting PATH, it breaks completion 
> when you use c:/.
>
> There was a "workaround" -- quote the ":", which is pretty painful when you 
> have to type it dozens or hundreds of times a day.  How often do you set 
> PATH!?
>
> The bug was reported in 2002, and the reporter said he had a fix.  The bug 
> is still present.  Could we reconsider accepting this fix so Cygwin users 
> don't have to fight this hack zillions of times a day?
>
> Gary

Why not just add a mount for C: as /c?

That's what I did, so now I can move around with ease, with the same number of
characters to have to type as c:

Dave in Largo, FL



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


Re: --with-installed-readline breaks tilde-expansion

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

According to Eric Blake on 8/12/2005 7:20 AM:
> According to Eric Blake on 7/23/2005 7:14 AM:
> 
>>>The following patch, to both readline and bash, allows readline to export
>>>a hook (rather than trying to import a function, which doesn't work in
>>>dynamic libraries for at least cygwin), so that bash can then override
>>>getenv() even within the context of a dynamic readline library.  It fixes
>>>not only tilde expansion (HOME), but also other uses of sh_get_env_value,
>>>where readline needs to read environment variables from bash, rather than
>>>the original program environ: INPUTRC, LC_ALL, LANG, EMACS, TERM, COLUMNS,
>>>and LINES.
> 
> 
> [Patch is available at
> http://lists.gnu.org/archive/html/bug-bash/2005-07/msg00135.html]
> 
> This patch is still needed with bash-3.1-alpha, when dynamically linked
> against readline-5.1-alpha.  Even with the bash-3.1 trick of setting
> environ, cygwin's getenv() does not track the new environ from within the
> shared library.

Actually, setting the environ works, it is just not done enough.  So a
simpler patch may be finding the extra places where environ needs to be
set so that the readline library will see the new environment:

$ echo $HOME
/home/eblake
$ ./bash --version
GNU bash, version 3.1.0(1)-alpha1 (i686-pc-cygwin)
Copyright (C) 2005 Free Software Foundation, Inc.
$ ./bash -c 'HOME=/; /bin/echo -n; echo ~'
/
$ ./bash -c 'HOME=/; echo -n; echo ~'
/home/eblake

Notice that 3.1-alpha is currently setting environ just before executing a
disk command, but not after changing an assignment of one of the variables
that readline cares about.  If only built-in commands are executed between
the change in the variable, then environ is not updated, and readline's
use of the stale environ prints the wrong results.

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

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

iD8DBQFC/RLA84KuGfSFAYARAv65AJ0WN1KBH81xGQhErt+rjzikwxhHtwCg0LlP
0WYiaS72CQdDIIOa9ypJJEE=
=DsR2
-END PGP SIGNATURE-


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