With fresh 9.1 install, bash completion no longer expands $HOME

2013-06-10 Thread David P. Caldwell
On my 9.0-based machines, if I typed $HOME[tab] when typing a command
in bash, the $HOME would be overwritten by the actual path to my home
directory (the value of $HOME) and tab completion would work as
expected.

After a fresh 9.1 install, this does not work as well.

$HOME is still detected by completion, but it is not expanded after
pressing tab (this does not matter to me), but also an extra space is
inserted after tab.

For example, if I have a directory named src under my home directory,
and my working directory is an unrelated directory, and I type cd
$HOME/sr[tab]:

Under 9.0:
cd /home/dcaldwell/src/[cursor]

Under 9.1:
cd $HOME/src [cursor]

So under 9.1 I lose the slash and see a space instead, essentially,
which renders this not very useful.

If I use ~ rather than $HOME, it works correctly under both. Obviously
I could probably learn to type ~ rather than $HOME but it would be a
hard habit to break after years. :)

For bash (and for most software) I am using binary packages from the
-release distribution, so my 9.0 machines have 4.1.11 and my 9.1
machines have 4.2.37.

I don't know enough about all the moving parts to know where to start
tracking this down, so can someone point me in the right direction?
(Unless there's an known problem or change I'm missing.) I can't
figure out where completion is configured in bash outside the
/usr/local/etc/bash_completion.d/ directory, which incidentally on my
9.1 setup contains:

$ ls /usr/local/etc/bash_completion.d/
dbus-bash-completion.sh*gdbus-bash-completion.sh*
gsettings-bash-completion.sh*

Thanks,

-- David Caldwell
http://www.davidpcaldwell.com/
___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: With fresh 9.1 install, bash completion no longer expands $HOME

2013-06-10 Thread Jeremy Chadwick
Re: http://lists.freebsd.org/pipermail/freebsd-questions/2013-June/251607.html

This has nothing to do with FreeBSD 9.0 vs. 9.1 other than the fact that
the package on 9.0 is older than 9.1.  Instead, this has everything to
do with the difference between bash versions you're using.  Remember:
packages and ports 99% of the time are third-party software (in this
case GNU), and therefore any changes in behaviour between versions are
entirely independent of FreeBSD.

The feature you like from bash 4.1 was removed in some manner of
speaking in bash 4.2.  This prompted a user to complain -- please read
the thread (not just the post) in full, because you will see there are
others who *do not* like this behaviour:

http://lists.gnu.org/archive/html/bug-bash/2011-02/msg00274.html

In bash 4.2.29 -- which is technically patch 029 for bash 4.2 -- the
feature you desire got moved into a shopt feature called direxpand,
with the default being disabled.  Because bash 4.3 is not out yet, you
will not find any mention of this in the official bash CHANGES file at
this time.  Instead, you will find the answer in the official bash42-029
patch itself (read the top):

ftp://ftp.gnu.org/gnu/bash/bash-4.2-patches/bash42-029

If you do not like this default, or feel strongly about this whole thing
and want to discuss it, the GNU bug-bash mailing list is the place:

http://www.gnu.org/software/bash/

To enable direxpand, use shopt -s direxpand.  You can put this command
in your ~/.bashrc.

-- 
| Jeremy Chadwick   j...@koitsu.org |
| UNIX Systems Administratorhttp://jdc.koitsu.org/ |
| Making life hard for others since 1977. PGP 4BD6C0CB |

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org