autocomplete

Diagnose bash autocomplete issues

Diagnose bash autocomplete issues I have one binary on my system, fio installed via package manager which doesn’t autocomplete files with tab once you’ve typed fio . I guess this means something must over overridding the autocomplete behavior but I don’t even know how to begin diagnosing it. Asked By: BeeOnRope || Source I would …

Total answers: 1

git diff tab completion of tags hides file name completion (using bash)

git diff tab completion of tags hides file name completion (using bash) I am using git on Ubunto with bash shell, and a tab-completion using bind ‘"t":menu-complete’ in my .bashrc file. When I do git diff X, tab-completion starts cycling with matching git tags, instead of matching files. If I complete enough characters such that …

Total answers: 1

TCSH tab auto complete with the part of current typed command

TCSH tab auto complete with the part of current typed command I am trying to write my own complete for a command. The completion needs to use a portion of the typed command to for a path search. I am trying to get the following behavior When I write my_commad -ws my_ws -t[TAB] a list …

Total answers: 1

zsh completion for umount: limit completion to one argument

zsh completion for umount: limit completion to one argument when I use zsh completion for the umount command: umount /mnt/t<TAB> it completes the mounted filesystem /mnt/tmp. But when I accidentally press tab too many times, it tries to be too helpful, and suggests other mountpoints, which leads to nonsense completions such as: umount /mnt/tmp / …

Total answers: 1

I want to "Autocomplete" sub and sub/sub directories rooted in a fixed directory

I want to "Autocomplete" sub and sub/sub directories rooted in a fixed directory I have some directories with music files $ tree -d ~/Music/ /home/boffi/Music/ ├── Aldous_Harding │   ├── Aldous_Harding │   ├── Designer │   ├── Party │   └── Warm_Chris ├── Madness │   └── The_Very_Best └── Mitski ├── Be_the_Cowboy ├── Bury_Me_At_Makeout_Creek ├── Laurel_Hell ├── Lush ├── …

Total answers: 2

zsh completion: complete from predefined list

zsh completion: complete from predefined list My zsh script takes following arguments: ./script –connect server –foo 3 –bar 5 name –foo and –bar take integers, name is the only non-option argument, and –connect should complete from predefinded list of servers. I am stuck at the –connect part, where I tried to define server list. _arguments …

Total answers: 1

How to get bash autocompletion to mimic the behavior for a certain command?

How to get bash autocompletion to mimic the behavior for a certain command? I’m writing a script wrapping a certain Linux command. Now, that command, when I use it directly on the command-line, has some autocomplete behavior. For example, if I type the command name, then space, then a string and press Tab – it …

Total answers: 1

How to disable "long descriptions" of commands in ZSH

How to disable "long descriptions" of commands in ZSH I have a program named fhome that provides shell completion for Zsh: $ fhome <tab> config — Manage system configuration event — Manage events help h — Shows a list of commands or help for one command object o — Manage objects I’d like to disable …

Total answers: 1

SSH Config Host Autocomplete Command not Autocompleting

SSH Config Host Autocomplete Command not Autocompleting I wrote a function to get my hosts from ssh config without getting wildcard hosts: sshConfAutoComplete() { cat ~/.ssh/config | grep ‘host ‘ | sed ‘ s#.**##g; s#host ##g ‘ } Output: pi lynx iridium batchelorantor rasp The output is correct, so I added this function to: /usr/local/etc/bash_completion.d/ssh …

Total answers: 2

Where to put bash-completion scripts from 3rd party programs in Fedora?

Where to put bash-completion scripts from 3rd party programs in Fedora? A piece of software I would like to use, xsos, comes with a bash-completion script. Where is the correct place to store it on a Fedora system? Should I create a generic directory in my $HOME and then call it from .bashrc? Asked By: …

Total answers: 1

zsh gnu-screen tab completion for `-x` flag similar to `-ls`

zsh gnu-screen tab completion for `-x` flag similar to `-ls` In bash, when I type screen -x and press tab twice, I get a list of all the running sessions. In zsh, when I type screen -ls and press tab twice, I get a list of all the running sessions and can tab through them, …

Total answers: 1

Konsole auto-completion for link pointing to folder

Konsole auto-completion for link pointing to folder Original Question When cding into a folder through a link, auto-completes does not add the last / unless I hit tab twice. How to change that behavior? MWE: cd /tmp/ && mkdir test && cd test && mkdir folder && ln -s folder link Then do cd lin …

Total answers: 1

conflict between bash and its auto-completer on the meaning of .. for symlink to directory

conflict between bash and its auto-completer on the meaning of .. for symlink to directory In my home directory /home/regis, after creating a symbolic link LINK to directory DIR/SUBDIR, and doing cd LINK, I have a conflict between bash and its auto-completer regarding what .. leads to. For bash auto-completer, .. leads to /home/regis, as …

Total answers: 1

zsh completion: complete –options for custom script

zsh completion: complete –options for custom script I have zsh completion rule for custom script. My script can take zero or more options (starting with -) and zero or more arbitrary strings (patterns): _arguments -S : ‘–foo’ ‘–bar’ ‘1:pattern:’ this rule works only partially, in following format: script "somestring" <TAB> offers –foo or –bar and …

Total answers: 1

Zsh completion: move into list selection on first tab

Zsh completion: move into list selection on first tab Short Description When I hit <tab> in zsh, I want the first completion candidate to be highlighted immediately instead of requiring me to hit <tab> a second time to focus the list. Example Say I have a directory structure like this: Projects/ | +– FooAwesome/ | …

Total answers: 1

zsh completion: duplicate commands

zsh completion: duplicate commands Lets say I have an alias for grep. When I use zsh completion, it will offer grep twice (once as command, once as alias): gr<TAB> grep grep I found I can use ignored-patterns specifically for aliases for commands or for builtins or functions" zstyle ‘:completion:*:*:-command-:*:aliases’ ignored-patterns ‘grep’ zstyle ‘:completion:*:*:-command-:*:commands’ ignored-patterns ‘foo’ …

Total answers: 1

Zsh autocompletion for git bare repos

Zsh autocompletion for git bare repos This is the completion code in my .zshrc: autoload -U compinit zstyle ‘:completion:*’ matcher-list ‘m:{a-zA-Z}={A-Za-z}’ zstyle ‘:completion:*’ menu select zmodload zsh/complist compinit _comp_options+=(globdots) # Include hidden files. I’ve been having a problem with the autocompletion when i use an alias: config=’/usr/bin/git –git-dir=$HOME/.local/share/dotfiles –work-tree=$HOME’ This problem has been discussed and …

Total answers: 1

Path-like search for a file

Path-like search for a file Basically I am trying to get something similar to command search with $PATH, but with a different list of directories and the file I’m searching for is not executable. The list of directories is fixed (I can pack it in a variable in the same format as PATH, or whatever), …

Total answers: 4

Complete a positional argument only once

Complete a positional argument only once I’m trying to write a completion for a command (call it gs) that takes an SSH hostname as its first argument, and an arbitrary string as the second argument. I’ve stolen this from the default SSH completion: # Load completions shared by various ssh tools like ssh, scp and …

Total answers: 1