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.

1
vote
1answer
40 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
23 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 ...
0
votes
0answers
18 views

Zsh “tab-expands” only first 2 segments of path

I have a path like one/two/three/four. I type on/tw/th/fo and hit tab. I expect the input to expand to one/two/three/four (my path). Instead, only the first 2 segments expands and the result is: one/...
7
votes
1answer
119 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 ...
0
votes
0answers
20 views

bash autocomplete in two stages

I have a directory which contains multiple Tools (one folder per tool). Each of these tool directories, contains multiple folders (1 folder per version). tool1 -- ver1 -- ver2 tool2 -...
2
votes
0answers
40 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
31 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
17 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
30 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 ...
0
votes
0answers
22 views

Why zsh in OS X autocomplete ssh host while there are more hosts in the ssh config?

I have added bunch host names to ~/.ssh/config. And when I want to go to a server I just use tab in order to complete the host like ssh mongo.host.com. The problem is that I have recently added ...
1
vote
0answers
37 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
40 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
31 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
66 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
0answers
48 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
25 views

How to use zsh compctl with fallback

is there any way to let a programmable completion fall back to path completion? E.g., if the dotnet process doesn’t return any completion suggestions (https://github.com/dotnet/cli/blob/...
0
votes
0answers
26 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, ...
0
votes
1answer
73 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
38 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
37 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
37 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
91 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
51 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
93 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
44 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
71 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
48 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
115 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
19 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
79 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
96 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
13 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
45 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
45 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
180 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
33 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
70 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
691 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
53 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
29 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
179 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: # _ # _______| |__ # |_ / __| _ \ # / ...
2
votes
0answers
93 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 ...
0
votes
2answers
173 views

Tab completion for git branches showing old/outdated entries

I'm on a sort of frankendebian stretch/sid (not the best idea, I know; planning on reinstalling soon). Tab completion works for git branch names in git repo directories: :~/project $ git checkout &...
1
vote
1answer
92 views

How to autocomplete or find file with special character almost impossible to type?

In bash, I make use of the autocomplete with TAB feature a lot, and sometimes I have filenames starting with special characters that I can't type with my default keyboard layout. My question is, how ...
2
votes
1answer
297 views

Auto-Complete the path on AIX using profile

We have an AIX environment in which I have to use Esc\ to complete the path. In a RHEL environment I was able complete the path using Tab. Is it possible to get this Tab auto complete feature going in ...
0
votes
1answer
248 views

Are there system settings that affect command line completion?

I have an application (not my own) that I run on two different CentOS6 machines with 2.6.32-696 kernels. The application is a command line driven (it has its own prompt once started) data analysis and ...
1
vote
1answer
436 views

How to provide Bash completion for a directory-local executable?

I wrote a Bash script to help me manage some symlinks. It's a wrapper around some Stow commands. When I invoke it, I pass it two command-line arguments: a command (plug/unplug/replug) and a directory ...
4
votes
1answer
73 views

Don't suggest current directory in autocomplete

I am a long time user of ZSH. It seems to me that I used to have this functionality a long time ago but then I rewrote my .zshrc (a long time ago) and now I miss this functionality every now and then. ...
1
vote
1answer
121 views

“compdef: unknown command or service” with disk quota exceeded

I just came across a problem with zsh. Every time I open it, I got this: /home/****/.zcompdump:201: parse error near `\n' compdef: unknown command or service: git And zsh completion broke down as ...
0
votes
0answers
25 views

How can I make a bash-completion script that will allow only files with certain extensions? [duplicate]

I have some bash completion scripts loaded, and one of the features is that when I type: mplayer x<tab><tab> it will only show me files that have extensions that make sense to play with ...