Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
0answers
25 views

slow autocomplete for cd in directory with many files

In directory with many files but only a few directories autocomplete is very slow for directories. If I type cd something tab it will take ages to autocomplete. Presumably this is because it is ...
3
votes
2answers
42 views

zsh completion for media player

In my .zshrc, I have menu select disabled globally, except for mpv/mplayer: zstyle ':completion:*' menu select=0 zstyle ':completion::complete:mpv:*' menu yes select This works as expected, but I ...
1
vote
0answers
29 views

How can i fix Linux Mint 19.1's GNOME terminal not TAB-autocompleting file names in apt?

I have a .deb package downloaded that i want to install using apt. When i wanted to TAB-autocomplete the following command nothing happened. $ sudo apt install ./pa[TAB] However, when i tried $ ./...
2
votes
1answer
35 views

How to look up zsh completion definitions

Is there a way to lookup (just print the completion definition to stdout) currently loaded zsh completion functions. I understand that they are stored somewhere on my fpath and I could do something ...
1
vote
1answer
52 views

Using tab for autocompletion doesn't work for certain kinds of filenames

Normally, one can hit the tab key after entering the first few characters of a filename and get the complete filename (or suggestions in case there are many with the same beginning characters). ...
2
votes
1answer
46 views

Documentation on bash completion

I've been unable to find complete documentation for the complete and compgen bash builtin commands. I'm on a Macintosh and help complete produces complete: complete [-abcdefgjksuv] [-pr] [-o option] ...
1
vote
1answer
43 views

ssh bash completion : sed: -e expression #1, char 97: invalid reference \2 on `s' command's RHS

I'm using Ubuntu 14.04.5 LTS. The ssh bash completion on any Host of the file ~/.ssh/config does not work : $ ssh b2sed: -e expression #1, char 97: invalid reference \2 on `s' command's RHS The ...
1
vote
1answer
45 views

Alias to prompt for tab completion for a set of directories?

Is it possible to make a bash alias, which would be able to prompt me for tab-completion of a set of directories? let's say I have a number of source code controlled projects, main path of each ...
1
vote
2answers
45 views

Show possible completions in zsh (possible-completions in bash)

I have recently switched to zsh from bash. Deep in my inputrc, I had "\e[/": possible-completions set. This allowed me to see all completions at a given point, without applying them. This was really ...
1
vote
0answers
33 views

Make bash understand I want to complete a directory name after “cd”

How to get bash to auto-complete cd commands only with directory names and ignore filenames (just as CMD on Windows) Example: I'm in /some/folder/ I have -rwxr-xr-x filesharp -rwxr-xr-x ...
0
votes
1answer
36 views

compgen usage error when attempting to complete “--” flags

I'm attempting to do bash completion for a command, and everything is working as normal with the full word commands, but when I try to complete the "--" flags, with the following code (following by a ...
0
votes
0answers
28 views

bash COMPREPLY with custom colors

Is there a way to have a COMPREPLY return colored output? I can get it to work when readline recognizes the output as a folder when I have bind "set colored-stats on", but I can't make my own colors. ...
3
votes
1answer
66 views

Prevent completion of files for 'make' command in zsh shell

Context zsh shell, oh-my-zsh framework, no special zsh's configuration (same problem with or without zsh-completions): see .zshrc at the end. Trouble If a directory contains: a makefile with ...
5
votes
0answers
328 views

dnf tab completion hangs

Tab completion is hanging when attempting to complete package names. eg dnf info fire[TAB]. How can I fix this? It works in general for bash, and also for completing dnf options, but not for package ...
3
votes
1answer
25 views

How to disable completion entirely for a specific shell command or alias?

I have the following Bash alias which doesn't take any arguments. alias b='cd ..' Typing b<space> and then pressing <tab> brings up completion results for any paths in the current ...
1
vote
1answer
42 views

Why does tab completion not work for all rpm command options?

When running the command rpm --query --all the options such as --query and -all are auto-completed when using the tab key. When running the command rpm --verify --all, the option --all does not auto-...
3
votes
1answer
69 views

Remove executable from path [duplicate]

I have a script called teleport in my path. When I type tele and hit tab, I'd like for tab-completion to complete this to teleport. However, there's another program installed on my system: telepathy-...
0
votes
1answer
65 views

Zsh: manually load completion functions

If I load completion functions at shell startup, but I spawn shell like a madman to work on the same folder. This is the case when I have multiple completion functions that target repository that ...
2
votes
2answers
50 views

Treat command like another for completion purposes

My zshrc includes the following function to create a directory and then enter it: function mcd () { mkdir -p "$*" && cd "$*" } The function itself works fine but I get odd behavior with ...
0
votes
0answers
25 views

Tab Completion from File in Bash

I was wondering if there is simple way to list tab completions in a file that will be accessed by all commands (e.g. are independent of the command currently on the terminal), if no other completions ...
0
votes
0answers
25 views

Possible to override bash environment variable completion?

I'm trying to figure out how to use the complete bash builtin to override tab completion of "environment variables." That is, when there is a dollar sign $ to the left of the cursor, with all ...
0
votes
1answer
60 views

Make bash-autocomplete recognize certain filetype for certain script

How can I make bash recognize a certain filetype for a specific script? for example, I wrote a tiny script to compile a lilypond-file and then automatically open the compiled pdf: #!/bin/bash run() ...
0
votes
0answers
96 views

Bash completion comes back from the dead

I started with this problem: Bash disables autocompletion for some commands The only difference was that in my case the command in question was configure. I successfully applied the solution ...
0
votes
2answers
35 views

Git: autocomplete my prompt after failed push because missing -u flag

Using git, I often create local branches and then want to push them to the remote (e.g. Github). This requires the -u or --set-upstream flag. Here is what git outputs without this flag: $ git ...
7
votes
1answer
150 views

zsh: complete hostnames and files in given directory

I have a script myscript which takes two arguments: hostname directory How can I write my own zsh completion, so that whenever I do mysript <TAB> it completes from my hosts list (ie same as ...
2
votes
0answers
52 views

autocomplete with inline variable setting

I use bash version 4.4.19(1)-release (x86_64-apple-darwin17.3.0) on my Mac with MacOS (10.13.6) For example, I have autocomplete set up for the AWS CLI, via complete -C '/Users/jstoner/Library/...
3
votes
1answer
54 views

Managing trailing characters using zsh autoloaded completion

I'm trying to create an autoloaded completion file for zsh. To do so, I've added a _myprog file in a folder that is in my fpath. This file goes roughly like this: #compdef myprog _myprog () { ...
1
vote
1answer
65 views

ZSH completion depending on the provided argument

Is there a way to access already provided argument as a variable in a ZSH completion scripts? here is the example: #compdef test _test_comp(){ t=($(cat /tmp/file_with_opts)) _wanted t expl "...
1
vote
0answers
68 views

How to change bash completion result coloring

How to change completion coloring when auto-completing subcommands in bash? For unknown reason, it looks like the completion results are treated by bash as broken symlinks. And it looks really ...
1
vote
0answers
133 views

why is yum's tab completion slow while apt-get's tab completion is fast?

Why is yum's tab completion slow while apt-get's tab completion is fast? I'm not sure but I believe that this may have to do with the fact that for autocomplete yum looks over the internet and apt-get ...
0
votes
1answer
185 views

How to enable tab auto completion linux subsystem windows 10

I have installed kali linux subsystem on my windows 10 machine. When ever i hit tab button in linux bash i hear some annoying sound and apt-get install ph doesn't give me any suggestion of ...
2
votes
0answers
90 views

How to make zsh pass the manual section to the man command when the `separate-sections` style is set?

When asking for a completion by pressing Tab on the zsh command line, the matches can be grouped according to their tag provided that the group-name style is set to an empty string: autoload -Uz ...
1
vote
2answers
88 views

Remove forward slash when tabbing to see a list of directories

Is there a way to remove the trailing forward slashes in the tab-completion output of Zsh when I start writing a cd command and tab to see a list of directories? E.g. ~ cd <tab> Adlm/ ...
1
vote
1answer
168 views

How to extend existing zsh completion functions?

I'm trying to add auto-completion for some custom ant parameters. However, it seems to be overwriting the existing oh my zsh ant plugin auto-completions which I'd like to keep. Is there a simple way ...
0
votes
0answers
31 views

How to modify bash completion for command names to match custom list only?

I want to customize bash completion on command names, such that matches are looked for in a particular list only. If I try the following: complete -E -W "foo bar" it works fine on an empty line, ...
1
vote
1answer
236 views

How to get same shell completion as Arch Linux ISO

I noticed this when booting the arch linux ISO: e.g. type shift at prompt then press tab auto-completion list pops-up below (inside red rectangle in screenshot) press tab tab use arrow keys to ...
0
votes
2answers
48 views

Bash: autocompletion in nested command

I am using bash and what I'm trying to do is achieve autocompletion in a nested command. For example, typing: kill $(cat tmp/p| followed by <tab> would yield kill $(cat tmp/pids/ And I'd ...
0
votes
1answer
38 views

Tab auto-deletion at command line

Running Ubuntu 18.04 and using bash. So I am aware of how to use tabs at the command line to auto-complete the next token with file paths and what have you. Question: is there an easy shortcut for ...
1
vote
0answers
42 views

When using TAB completion with dd command, options (like 'if' or 'of') disappear

When I type dd if= then hit TAB to complete, the file name is added, but the if= portion vanishes (and of= too, for that matter). So for example, instead of # dd if=input_file.iso of=/dev/sdb I get ...
5
votes
1answer
97 views

Ignore auto-completion on single same filename

Normally when I pass a filename which is the only file there in current directory with auto-completion by Tab to the command come before it then press multiple Tab(mistakenly), the same filename ...
2
votes
3answers
276 views

Remove zsh autocomplete suggestion

When I type cd l and hit tab, zsh autocompletes to cd lightdm/ this is not a directory that is available to me (in fact I've uninstalled lightdm). How do I stop this from happening? I have ...
1
vote
1answer
310 views

How to use aliases with auto completion in oh-my-zsh?

I'm using zsh on MacOS El Capitan. I'm wondering how auto completion has to be parameterized to resolve aliases as well. When I used bash, my .bash_profile contained the following: alias mdb "mongo -...
2
votes
1answer
55 views

Bash tab completion deletes text

I have a debian system on which my bash tab completion has a weird behavior. When I write a command like scp file.tgz remoteServer:/home/remoteU and hit tab it will complete to scp file.tgz /home/...
2
votes
1answer
165 views

How to enable up-arrow command history and command completion in sftp on Gentoo?

When I try to use up-arrow command history via sftp to my CentOS 7 server it just prints ASCII characters to the output instead of recalling recent commands: sftp> ^[[A It's very time consuming ...
1
vote
1answer
60 views

Bash completion with changing number?

I would like to create a function or alias or command completion in bash which would take a command as "dfk-1234" or "DFK-nnnnn" (the number can be 1 to 5 digits, not zero-padded), and run a command "...
5
votes
2answers
134 views

Bash completion overwrites current word

I am trying to create a bash completion script for my command. ls has the behaviour that I want. I need to get this same behaviour form my command. This is what I get for ls $ ls /home/tux/<Tab&...
0
votes
1answer
31 views

Stray line feed character at the end of the bash complete output

So I routinely push applications to background and switch among them. I realized that fg doesn't have a tab complete defined. So I thought I can put together a tab complete for fg quickly with the ...
2
votes
0answers
194 views

Dropdown menu in Bash

How can I make Bash show a typical Web-style dropdown menu when typing the argument to a custom-made command? (Making it work with builtins or Standard Unix commands is secondary.) The crucial parts ...
1
vote
1answer
148 views

How can I define zstyle completion preference for a zsh alias?

If I have an executable - say ~/bin/stuff in my PATH, I can define this in my .zshrc to have it autocomplete text files first as arguments to my command: zstyle ':completion:*:*:stuff:*' file-...
0
votes
0answers
19 views

_alternative in _arguments prints errors but it still works

I have /usr/local/share/zsh/site-functions/_drush #compdef drush _arguments \ "1: :($(/usr/local/bin/firstarg-drush.php))" \ "2: :_alternative 'arguments: :(php ev scr sql-sync sql-cli sql-query ...