Skip to content

QOL: Adds bash tab completion cycling#4634

Open
coolbotic wants to merge 1 commit intobasecamp:devfrom
coolbotic:adds-menu-style-tab-complete
Open

QOL: Adds bash tab completion cycling#4634
coolbotic wants to merge 1 commit intobasecamp:devfrom
coolbotic:adds-menu-style-tab-complete

Conversation

@coolbotic
Copy link

Summary

Updates the bash config (inputrc) to enable menu-style tab completion for completion candidates. Preserves the existing “common prefix” completion behaviour while allowing candidates to be cycled using repeated Tab presses.

1st Tab: Functionally remains the same, showing a list of completions and filling in common when ambiguous.
2nd+ Tab: Cycles through each candidate (with Shift-Tab cycling backwards)

This behaviour mimics what I got used to liking when using ZSH previously.

Drawbacks

You do lose the nice annotations on some completions by replacing complete with menu-complete. Maybe binding to a different key combo could get around this.

e.g:
Before:

> docker # 1st Tab
attach      (Attach local standard input, output, and error streams to a running container) 
images      (List images)                                                                  
rmi         (Remove one or more images)
...

After:

> docker # 1st Tab
attach      builder     commit 
...

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant