Skip to content

Tab completion always skips dotfiles, even with shopt -s dotglob #992

Open

Description

@tblisonb

Description

Filename tab completion always skips hidden files (names starting with .) unless the word already being completed starts with . itself. For example, in a directory containing .bashrc, typing ls <TAB> never suggests .bashrc; you have to already type ls .<TAB> to see it.

This appears to be hardcoded in tab_complete_with_expanded_pattern (src/completions/tab_completion.rs), which is always called with should_skip_hidden = true:

let results =
    tab_complete_with_expanded_pattern(&expanded, comp_resultflags, word_under_cursor, true);

and PathPatternExpansion::wants_hidden() (src/globbing.rs) only returns true when the user-typed pattern already starts with .:

pub(crate) fn wants_hidden(&self) -> bool {
    self.rhs_pattern.starts_with('.') && !self.rhs_pattern.starts_with("./")
}

There's no config flag to change this, and it's independent of shopt -s dotglob (I couldn't find any reference to dotglob in the codebase). This is a bit surprising given the README documents dotglob as the way to "match hidden files with * and ?" for glob/extglob expansion elsewhere - it'd be natural to expect the same shopt (or an explicit flyline setting) to also affect plain tab completion.

Suggested behavior

Either:

  • Have plain tab completion respect shopt -s dotglob the same way glob expansion does, or
  • Add an explicit flyline setting (e.g. flyline suggestions --match-hidden-files <true|false>), similar in spirit to GNU Readline's match-hidden-files variable.

Environment

  • flyline 1.7.1 (built from the AUR PKGBUILD source)
  • Arch Linux, bash 5.3.15

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions