#479155 set expand-tilde off in ~/.inputrc does not work

Package:
bash
Source:
bash
Description:
GNU Bourne Again SHell
Submitter:
Alain Greppin
Date:
2024-06-30 15:45:02 UTC
Severity:
minor
#479155#5
Date:
2008-05-03 09:38:14 UTC
From:
To:
Tilde expansion on the command line is very annoying when you don't want
it. The tilde expansion is done anyway if the file /etc/bash_completion
is loaded (root account does not load it). For testing, I just modified
that file to work for me. Beware that modification may break others
stuff in the completions.

file /etc/bash_completion around line 324
_expand()
{
        [ "$cur" != "${cur%\\}" ] && cur="$cur\\"

        # expand ~username type directory specifications
        if [[ "$cur" == \~*/* ]]; then
# avoiding tilde expansion
#               eval cur=$cur
                cur=$cur

        elif [[ "$cur" == \~* ]]; then
                cur=${cur#\~}
                COMPREPLY=( $( compgen -P '~' -u $cur ) )
                return ${#COMPREPLY[@]}
        fi
}

Regards,
Alain Greppin

PS: the same applies for sid