bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Tab completion doesn't escape spaces when globbing while using autoc


From: Chet Ramey
Subject: Re: Tab completion doesn't escape spaces when globbing while using autocd
Date: Wed, 28 Apr 2021 10:07:28 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.1

On 4/27/21 4:59 PM, Manuel Boni wrote:

Bash Version: 4.4
Patch Level: 23
Release Status: release

Description:

I currently have these settings in my .bashrc:
shopt -s autocd
shopt -s globstar
shopt -s nocaseglob
bind 'set show-all-if-ambiguous on'
bind 'set completion-ignore-case on'
bind 'TAB:menu-complete'
bind '"\e[Z":menu-complete-backward'

Consider the path 'projects/uni/2020/Behavioral Science/'.
When I try to navigate to the 'Behavioral Science' directory using
`pushd projects/**/*beh*` and then pressing the TAB key,
the shell correctly expands the path to 'projects/uni/2020/Behavioral\
Science/'.
When I try to navigate to that directory typing
`projects/**/*beh*` and then pressing the TAB key,
the shell expands the path to 'projects/uni/2020/Behavioral Science/'
(without escaping the space)
and thus changing the directory will fail.

Thanks for the report. It looks like this has been around since early 2008.
The fix is to tell readline we're doing filename completion when the
command word being completed contains a glob pattern.

Chet


--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]