Stack Exchange Network

Stack Exchange network consists of 174 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
19 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
12 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
23 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 ...
3
votes
0answers
98 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
22 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
34 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
60 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
29 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
47 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
23 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
19 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
55 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
85 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
34 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
140 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
47 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/...
2
votes
1answer
45 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
40 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
47 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
74 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
91 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
42 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
75 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
96 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
29 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
155 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
44 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
39 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
95 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
2answers
116 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
189 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
53 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
108 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
57 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
127 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
24 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
133 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
129 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
18 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 ...
0
votes
1answer
54 views

How to allow for files completition for the rest of _arguments?

I got _arguments "1: :($(/usr/local/bin/aliases-drush.php))" \ working which is really great -- it's a PHP script printing one possibility for argument every line -- but the rest of the arguments can ...
3
votes
2answers
56 views

How to get bash completion settings to be inherited by child shells?

I have a project-specific setup file that I source right before running gnu screen. In that file, I set up bash completion for my test command and the related tests. That looks like this: $...
1
vote
1answer
267 views

terminal autocomplete when there are several files/directory?

I've created a user using sudo useradd -m peris but when I log in the terminal, I use the tab to autocomplete, but its not working, and it is working in the root user For instace I am in a folder ...
1
vote
0answers
36 views

Bash how does skip-completed-text work?

I use menu-complete bash function to cycle through completion when I press Tab, and I'm happy with it. But it has too often happened to me the following. Suppose I'm looking for the file ...
1
vote
0answers
89 views

Bash autocompletion is slow

I have written a shell script for autocompletion(bash); which, on sourcing, runs a python script, stores the output of the script and acts as a source of word list for the compgen command. Following ...
1
vote
0answers
792 views

“unexpected EOF while looking for matching `)'” - when trying autocomplete [duplicate]

Whenever I start typing in a command which uses $( ) expansion, and I press tab while typing in the inner command, I get an error: unexpected EOF while looking for matching `)' Thus, for example, I ...
1
vote
0answers
74 views

bash tab auto-complete for java keytool

Can anyone point me to a bash tab autocomplete for the java keytool command? Learning & writing this seems not simple, and I presume that someone has felt this pain before.
1
vote
1answer
46 views

define tab completion helper function to use in several completion files (zsh)

I am writing zsh completion functions for a couple of commands from the same toolkit. The commands are different enough that I want to write different completions for them in different files. (i.e. ...
0
votes
1answer
278 views

remove colors from zsh tab-completion

I don't want to see colors in the suggestions of zsh tab-completion. They make the reading harder for me. How can I do that? Here is my .zshrc: # _ # _______| |__ # |_ / __| _ \ # / ...
3
votes
0answers
128 views

Use colon as filename separator in zsh tab completion

I have many programs which take filename arguments as one(or more) of path/to/file scp:path/to/file.ext ark:/abs/path/to/file.ext Is it possible make zsh complete filenames after some keywords ...