Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bash completion: do not expand tilde #1495

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Jun 26, 2022

  1. bash completion: do not expand tilde

    Make behavior of bash completion for `ag` consistent with `ls`, `man`,
    etc. in respect to tilde expansion to home directory path. Do not
    replace `~` by `/home/user` in response to `[Tab]` in the following
    cases:
    
        ag pattern ~us
        ag pattern ~/src
    
    Completion of file names is still handled by `_filedir`. As to other
    utilities, e.g. `ls` uses `_longopt` function that does not call
    `_expand` at all, while `man` has call of `_expand` but it is bypassed
    for file names.
    
    Expansion of `~` is controlled by the following setting in `inputrc`:
    
        set expand-tilde on
    
    For details see
    [info "(bash) Readline Init File Syntax"](https://www.gnu.org/software/bash/manual/html_node/Readline-Init-File-Syntax.html)
    Alternatively `M-&` (`tilde-expand` command) may be used to expand tilde
    at particular point
    [info "(bash) Miscellaneous Commands"](https://www.gnu.org/software/bash/manual/html_node/Miscellaneous-Commands.html)
    
    If you are going to revert this commit, please, add a comment with an
    example when `_filedir` is not enough and `_expand` is really necessary.
    maxnikulin committed Jun 26, 2022
    Configuration menu
    Copy the full SHA
    e5f13bb View commit details
    Browse the repository at this point in the history