Skip to main content

Questions tagged [autocomplete]

A feature provided by interactive programs such as shells and text editors that inserts text to complete a word or phrase that the user is likely intending to compose.

Filter by
Sorted by
Tagged with
1 vote
0 answers
39 views

bash completion stopped working out of the blue

Running Debian unstable here. Two days ago, tab completions in bash stopped working in Konsole. No recent upgrades (except any security upgrades that may have happened in the background). I checked ...
user2751530's user avatar
1 vote
1 answer
53 views

Bash completion after quotation mark

I am experimenting with bash completion to write a general completion library in C associated with command line parsing and stumbled in a behavior for which I can find no documentation. I am using the ...
user1542207's user avatar
1 vote
1 answer
62 views

Equivalent of PSReadLine for bash (or whatever linux shell) as you type

I'm aware of this question Equivalent of PSReadLine for bash But sadly it is still not close enough for me, all of the suggestions requires to press either tab, or ctrl + r or whatever, while ...
Nour's user avatar
  • 115
1 vote
0 answers
32 views

Ignore Accent Differences in Zsh Autocomplete

Suppose I have a directory named cálculo in the current directory. How can I autocomplete its name after typing the starting characters without the accent? $ cd calc<tab> $ cd cálculo/ I failed ...
sidyll's user avatar
  • 207
1 vote
1 answer
20 views

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 ...
BeeOnRope's user avatar
  • 559
-1 votes
1 answer
69 views

Kali Linux terminal autocomplete breaks hitting tab, or paste from clipboard and pressing left arrow

If I paste a command from the clipboard and hit left arrow to change the command the command changes it will duplicate the first word of the command, however if you use the cursor to it, it starts at ...
trchosen1's user avatar
2 votes
1 answer
173 views

bash_completion script crashes bash

I moved alias, env var and completion declarations out of .bashrc and into separate files: .bash_env .bash_aliases .bash_completion and imported them inside .bashrc if [ -f ~/.bash_env ]; then . ...
Ettapp's user avatar
  • 161
1 vote
1 answer
56 views

bash completion only for first non-option word?

I have a program, say foo, like many others that takes command-line arguments of the form: foo [ options ] command ... where options are zero or more short (e.g., -s) or long (e.g., --long) style ...
Paul J. Lucas's user avatar
2 votes
1 answer
90 views

Where do I find the specs for bash's _longopt autocompletion?

I like to have shell completion for as many commands as possible. I write a fair amount of shell-scripts that take a lot of different parameters, and it's a life-saver to have the completion just work....
Popup's user avatar
  • 636
1 vote
1 answer
23 views

zsh completion for custom script: URL + optional parameters

I have zsh completion for custom script, where one parameter must be URL (ie, string) and then there are several optional parameters: --AAA --BBB --CCC: _arguments -S : \ '--AAA' \ '--BBB' \ ...
Martin Vegter's user avatar
1 vote
0 answers
30 views

Is it possible to write bash completion function when arguments are in the form --arg=argval

How to write bash completion when the arguments have no spaces but = For example myapp can take either --arg=argVal1 or --arg=argVal2 _myapp_completion() { local cur prev opts COMPREPLY=() ...
kanna's user avatar
  • 213
0 votes
1 answer
52 views

How to specify that an optional argument requires 2 arguments in a zsh competition script?

I am writing a custom competition function for zsh. Currently, I have the following code _arguments \ ... '(-G --glitchpct)'{-G+,--glitchpct=}'[Controls how often the characters on screen glitch]' I ...
Alex.Kh's user avatar
  • 101
0 votes
1 answer
13 views

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, ...
Itamar Katz's user avatar
1 vote
1 answer
77 views

How can I make auto-complete systemd unit names be case-insenstive?

Bash auto-complete helped immensely with the php-like naming conventions to systemd unit names. It completely solves the mix of Kebab-case, snake_case, camelCase. But I still get frustrated with ...
gcb's user avatar
  • 420
1 vote
1 answer
43 views

zsh completion for cssh: complete hosts from /etc/hosts as well as ~/.ssh/config

my zsh completion file _cssh has this line, which completes hosts only from /etc/hosts: '*:userhostport: _alternative hosts:host:_hosts usersathosts:userathost:_user_at_host' how do I make it ...
Martin Vegter's user avatar
0 votes
1 answer
51 views

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 -...
Dan Messer's user avatar
1 vote
1 answer
23 views

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, ...
Martin Vegter's user avatar
0 votes
1 answer
74 views

zsh custom completion file not sourced properly

I encountered a strange behaviour regarding ZSH completion for my custom script and need some ideas, what went wrong and how to solve it. I have written a little custom script myscript and also ...
lukeflo's user avatar
  • 121
0 votes
0 answers
25 views

bash autocompletion filetype filter bypass

How to ignore bash autocompletion's file filtering when it's broken? For example, I want to auto complete a iso file for bsdtar, but my distro didn't include that extension. Pressing tab just feel ...
gcb's user avatar
  • 420
0 votes
2 answers
43 views

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 │   └── ...
gboffi's user avatar
  • 1,454
1 vote
0 answers
22 views

ZSH, complete to longest prefix

I no longer find the combination of settings in ZSH that first completes to the longest prefix. What I'm looking for is this: Given several files aaa, aab, cab, if you type a + tab, ZSH completes to ...
alecail's user avatar
  • 1,643
0 votes
0 answers
128 views

How do I disable completion for a specific command in zsh

I want to disable completion for the make command, so when I type make <tab>, zsh doesn't try to parse Makefile. It should be done temporarily (e.g. for this zsh session only, so removing files ...
lilydjwg's user avatar
  • 221
2 votes
1 answer
86 views

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 ...
Martin Vegter's user avatar
0 votes
1 answer
52 views

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 ...
einpoklum's user avatar
  • 9,635
1 vote
1 answer
47 views

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 ...
Bartek Pacia's user avatar
1 vote
2 answers
158 views

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 ...
Nickotine's user avatar
  • 489
0 votes
0 answers
71 views

Enable filepath autocompletion when adding files with Git in Zsh

Let's say following is the output of my git status command. On branch LG-201 Your branch is up to date with 'origin/LG-201'. Changes not staged for commit: (use "git add <file>..." ...
Kartik Chauhan's user avatar
2 votes
0 answers
215 views

How to disable annoying autocomplete popup on Fedora Linux?

I'm running Fedora Linux 37 on a laptop computer with a touch screen. Occasionally, some process or something triggers and I start seeing this really obnoxious text autocomplete prompt whenever I type ...
Silvio Mayolo's user avatar
1 vote
1 answer
117 views

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 ...
Matteo's user avatar
  • 113
1 vote
1 answer
95 views

How to troubleshoot bash completion for git not working in subshell

When I launch my first bash shell, completion for git works (git rest<TAB>->git restore). After opening a second shell within the first one, tab completion is no longer working for git, but ...
Moberg's user avatar
  • 187
0 votes
0 answers
42 views

Does the implementation of a program provide the handler of the Tab-hitting event? [duplicate]

In bash, how does autocompletion know the options to complete a command? For example, when I hit key Tab after ls, it will list the files in the current directory. when I hit key Tab after ebook-...
Tim's user avatar
  • 103k
1 vote
2 answers
387 views

git autocompletions in Fish: how can I disable them or speed them up?

I'm running Fish shell (3.6.0) on Ubuntu. Let's say that I'm trying to run git add foo/bar.txt . I type: git add foo and then I press tab . Now the shell freezes up for a few seconds. Even pressing ...
Flimm's user avatar
  • 4,258
0 votes
1 answer
190 views

Why the option -P of compgen does not work?

I am playing around with the programmable completion of Bash and there is something I don't quite understand. Environment This is what I get when I run bash --version in my terminal. GNU bash, version ...
chemacabeza's user avatar
0 votes
1 answer
91 views

Should I use `set -u` in my terminal? Why does it break autocomplete for git?

I added set -u (equiv. set -o nounset) to .bashrc, but now some tab autocompletes fail with errors about unset variables. One example is for git autocompletes. Would this be a git autocomplete bug or ...
Jeremy Hunt's user avatar
4 votes
0 answers
224 views

Most recents files/directory suggested results by TAB completion with zsh

I would like to get with TAB suggestion on zsh to get the more recent file as first suggestion after a second TAB pushing. For the moment, I have with a first TAB pushing the list of the more recent ...
guizmo133's user avatar
2 votes
1 answer
88 views

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 ...
Daniel F's user avatar
  • 887
0 votes
1 answer
108 views

BASH: use . instead of a space for command completion

I have bash function directory located at /git/function This is structure: /git/function/ ├── delete │ ├── delete.dir │ └── delete.file ├── main.sh ├── get │├── get.dir.sh │└── get.file.sh How to use ...
Rafal Niznik's user avatar
0 votes
1 answer
331 views

Konsole auto-completion for link pointing to folder [duplicate]

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 && ...
Clément's user avatar
  • 378
1 vote
1 answer
42 views

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 ...
Regis's user avatar
  • 13
1 vote
1 answer
119 views

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' \ ...
Martin Vegter's user avatar
2 votes
0 answers
68 views

How to auto-complete "hashcat" options?

Is it possible to get auto-completion of hashcat command line options? What I mean is, when entering, for example, hashcat --incre, and then pressing Tab, I want that the incomplete option completed ...
UndercoverDog's user avatar
1 vote
0 answers
127 views

zsh vared: how to define custom completion?

I would like to launch a command that would read user input and pass each line as a new task to TaskWarrior: #!/bin/zsh set -e while vared -p 'task add> ' -eca task; do eval task add "${task[@...
khardix's user avatar
  • 11
1 vote
1 answer
364 views

set colored-stats ignores $LS_COLORS

Problem Bash <tab> autocompletion ignores $LS_COLORS variable and uses default color values. Setting I have a dircolors file and just the following declarations in .bashrc: eval `dircolors $HOME/...
Karolis Koncevičius's user avatar
3 votes
1 answer
471 views

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 ...
Ashton Wiersdorf's user avatar
1 vote
2 answers
75 views

zsh completion: complete block devices in /dev

for my script, I need to complete block devices in /dev, so that when I do my_script.sh <TAB> it will complete /dev/ and offer me all disks that are listed in /dev (not in subdirectories). So ...
Martin Vegter's user avatar
0 votes
0 answers
1k views

Tab completion and Mobaxterm

I am using Mobaxterm to access cluster that is running on Bash. I have an absurd, but very annoying issue. When I installed Mobaxterm, Tab completion would end the path with a / and if you press it ...
Michael Listovski's user avatar
3 votes
1 answer
155 views

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 ...
Martin Vegter's user avatar
0 votes
1 answer
154 views

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+...
Stagnant's user avatar
1 vote
1 answer
109 views

Don't jump to the end of the word after inword (completeinword) completion in zsh

I've been able to turn on autocompletion when the cursor is in the word: https://unix.stackexchange.com/a/736909/556055 But the whole point was that I can accept an autocompletion and resume typing ...
Andrew15_5's user avatar
5 votes
1 answer
1k views

Configure zsh to use tab autocompletion when in the middle of a word (ignore chars after the cursor) like in bash

In bash (\bash --noprofile --norc) when the caret/carriage/cursor (|) is in the middle of a word (l|!@#asdf) you can double Tab to show suggestions (ls for this example) for the word before the caret (...
Andrew15_5's user avatar

1
2 3 4 5
17