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.

learn more… | top users | synonyms (2)

3
votes
2answers
69 views

Why does man page completion fail after su?

I have a default Debian 8.1 installation. I do su man apt<TAB> but get nothing. I do see the manual when I write man apt-get in both modes: as user mas and as root. However, tab ...
2
votes
2answers
25 views

Tmux bash completion code walk-through

if [[ $COMP_CWORD -le $cmd_index ]]; then # The user has not specified a command yet local all_commands="$(tmux -q list-commands | cut -f 1 -d ' ')" COMPREPLY=( ...
3
votes
2answers
93 views

how to re-use existing completion with recent bash-completion?

i use alias which adds some parameters to some program. for example: alias git.home='git --git-dir=$HOME/.git.home/' complete -o bashdefault -o default -o nospace -F _git git.home \ ...
1
vote
1answer
48 views

Disable sorting of COMPREPLY in bash complete function

I have a list of words that should be present in the order of appearance in completion to a certain key, but bash seems to be internally sorting what is assigned to COMPREPLY array. How to avoid that? ...
3
votes
1answer
37 views

How can I ignore / remove / exclude autocompletions in zsh?

I usually use rs+[tab] to get rsync but it's showing three options (on a new system): ➜ $ rs rsh rsync rsyslogd I seldom use rsh or rsyslogd - how can I prevent these from appearing ...
1
vote
1answer
27 views

How to add a dir to fpath

I'm using zsh and prezto. I've adding the following line at the end of my .zshrc fpath=(/usr/local/share/zsh/site-functions $fpath) But unfortunately, the functions defined in this folder seems ...
2
votes
1answer
131 views

g++ bash: warning: programmable_completion: g++: possible retry loop

When I type g++ and do tab completion for file listing, I get this warning **g++ bash: warning: programmable_completion: g++: possible retry loop** I googled it and so far no results . Can ...
0
votes
1answer
16 views

how to access through the matches in file-name completion?

In case of file-name completion, is there a way to access through the matches that get displayed after a double tab?
1
vote
1answer
37 views

Completions stopped working after upgrading zsh

Previously I have been using this handy script with oh-my-zsh to set the tab color whenever I ssh into a machine: # iTerm2 window/tab color commands # ...
0
votes
0answers
39 views

Add slash suffix and not space for folder commands on bash auto-completion

What i expect my bash shell autocompletion to be like, % cd $HOM<TAB> -> cd $HOME/<CURSOR-HERE> What it does to me, % cd $HOM<TAB> -> cd ...
1
vote
0answers
45 views

set -x doesn't print stack info for bash autocompletion

In my bash 4.2.46 and centos - 7.1.1503, I ran set -x (to print debug info). Now, if I type ls, it prints: + ls --color=auto a b c ++ printf '\033]0;%s@%s:%s\007' root sk-vbox '~' All well and ...
0
votes
0answers
57 views

busybox tab completion in vi mode

When I use busybox and switch editing mode to vi via set -o vi then tab completion stops working. When I switch back set -o emacs then tab completion starts working again. # set -o vi # ls -l ...
13
votes
3answers
446 views

Unexpected Bash completion of ~ on OS X

I pressed ~TabTab on the bash command prompt and got an unexpected set of completions. First it looked like all the folks in the /Users directory, and a lot more. Then I thought it was doing the ...
3
votes
1answer
79 views

bash - ignore case but disallow autocomplete if ambiguous

Recently i face inconvenient when using bash auto complete with ignore case. Let's say i have this directories: [xiaobai@xiaobai test]$ l total 20K 3407873 drwx------. 60 xiaobai xiaobai 4.0K May 25 ...
4
votes
1answer
141 views

How does Bash auto completion work?

I can understand that bash auto completion works for standard utilities. But how does it do auto completion for custom programs like Oracle SQL loader? In the following command if you Tab after ...
1
vote
1answer
35 views

getting case insensitive completions with compgen in bash

I'm trying to get my command (devmode2) auto-completing with bash working with compgen -W, my bashrc has: _devmode2() { COMPREPLY=() local sonames=$(devmode2 --auto --current "${COMP_CWORD}" ...
2
votes
1answer
46 views

csh: setting command completion for `cd` to show both directories and files

In my csh terminal, when I do: ls tab -- it shows everything in the current directory as a possibility cd tab -- it shows only directories in the current directory as a possibility. If no ...
15
votes
1answer
647 views

What's the magic that allows me to tab-complete remote files as I type an scp command?

Presumably this is a feature provided by some plugin I have enabled in my oh-my-zsh setup (I have been using zsh for many years now). I noticed ever since I added my public key to the server (now I ...
2
votes
0answers
41 views

Context-sensitive bash completion changes wildcard behavior

Somewhere along the way I've fallen into the habit of hitting tab twice after using a wildcard in commands like mv or rm, which by default causes bash to show the list of files that would match the ...
0
votes
0answers
75 views

My apt-get installer has no autocompletion for some packages

I have installed Kali Linux v1.1.0 (Debian based). Filename completion for sudo was not running at the beginning, so I added: complete -c sudo And everything seems to autocomplete now, except for ...
2
votes
1answer
61 views

Writing a tab completion script for bash

I made a shell script that reads input from user and kills a process. But in bash if the user presses Tab key then bash suggests some keyword or file names. My script however doesn't suggest anything. ...
2
votes
1answer
58 views

zsh case-insensitive mid-word completion

I have the following in my .zshrc for case-insensitive tab completion. I encountered a situation where the tab completion fails, and I can't figure out why. autoload -U compinit && compinit ...
3
votes
1answer
92 views

Run a command in background that sets env var or define function

> export foo=1 & [1] 9016 [1] + done export foo=1 > echo $foo > I know when running a command with & you spawn a new process and the export foo=1 is not setting env vars in ...
2
votes
1answer
53 views

Bash completion - How to get filename completion for suboptions

I have a function which can take main arguments and then sub-arguments. Some of these sub-arguments are filenames. The current completion code I have is as follows. _scm() { local cur prev opts ...
2
votes
1answer
85 views

Install an additional completion function for bash

I have never used bash completion of todo.txt cli; however, I have decided to give it try. On the author's github, it says: (Optional, since v 2.9:) Install the Bash completion, either system-wide, ...
1
vote
2answers
81 views

Bash autocomplete: does not list files or directories

In my bash terminal, I would usually press tab twice to get the file and folder list. For instance cat 2XTAB would list all files and folders in the present directory and cd Proj2XTAB would list all ...
2
votes
0answers
144 views

Making zsh filename completion case-insensitive everywhere

I have the following line in my zshrc to make filename completions case-insensitive: zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' This works most of the time but I’ve noticed that if I ...
3
votes
1answer
70 views

Zsh gpg2 autocompletion

I am using zsh with oh-my-zsh on OSX. I installed gnupg2 from homebrew giving me the executable gpg2. Unfortunately zsh auto completion appears to only support gpg (even though that executable is not ...
1
vote
1answer
107 views

zsh git command auto-complete add extra origin to the git branch name

After I clone a git repository locally, I want to switch branch to, says, 'ABCD'. $ git branch -a * master remotes/origin/ABCD remotes/origin/HEAD -> origin/master remotes/origin/master $ ...
0
votes
0answers
15 views

Specify “any sequence of digits” to ‘compgen’

How can I get compgen to return matches for “any valid sequence of digits”? The Bash compgen command is used to generate completion matches in Bash programmable completion. There are many options for ...
4
votes
1answer
228 views

Can the command completion for `cd` be modfiied to only show directories and ignore files?

When I am in a directory in bash, and I press cd Space Tab, it shows everything in the directory as a possibility. (Show all 1000 possibilities?) This is really cumbersome when I am in a directory ...
3
votes
1answer
212 views

Combining zsh’s tab completion with case insensitivity

I have zsh 5.0.7 configured to use case-insensitive tab completion with zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' The problem I’m having is that this case insensitivity often leads ...
1
vote
1answer
281 views

I want to create a cron job that runs a command on a remote linux box using ssh but I want ssh to answer password [duplicate]

Thank you for the reply.This is not what I am after. The ssh from server 0 to (1,2,3) (no password) but a remote script on server (1,2 & 4 ) which starts a service/application needs a password for ...
3
votes
2answers
79 views

Seeing file names in SCP

I'm using scp to copy files from a remote server to a local one. What's really uncomfortable is that I need to type the file path precisely. I'm used to relying on autocompletion, because file names ...
3
votes
1answer
139 views

Autocomplete issue in bash with equal sign (=)

I am trying to make autocomplete work and wroted a piece of code to demonstrate an issue I faced up: $ cat completion.sh function _completion_command() { compopt +o bashdefault +o default +o ...
1
vote
0answers
46 views

How can I complete a -N numeric parameter?

I'm writing an autocomplete script for supervisorctl. Is it possible to complete a numeric parameter such as -6, -999 etc? Currently my call to _arguments looks like, which doesn't work: _arguments ...
12
votes
1answer
264 views

How can I loop over possible completions? [duplicate]

I'd like to be able to get my hands on an array of possible completions for a given partial command. For example, the partial command service um has the following possible completions: $ service ...
1
vote
1answer
62 views

Broken git autocompletion after I have overridden the git command

Recently git branch <tab> started showing me the following error: $ git branch bash: -c: line 0: syntax error near unexpected token `(' bash: -c: line 0: `/usr/bin/git --git-dir=.git ...
2
votes
3answers
111 views

How to get tab completion when using curly braces in Bash

I want to have tab completion when using curly braces in a command in bash. For example: cp ~/html/{foo bar.txt whatever} /var/www/html/ I want the tab completion for the files stated in the curly ...
4
votes
1answer
164 views

Tab autocompletion of accented characters with oh-my-zsh doesn't work

I am not able to properly display autocompleted filenames that contain accented characters like ã in my shell configuration of zsh and oh-my-zsh. I've created a filename cão.txt to demonstrate this ...
1
vote
2answers
139 views

Zsh completion on the second command or after an alias?

I have changed my OS X Yosemite shell to Zsh and configured with "oh my zsh" plugins, recently i installed proxychains-ng to proxy command line tools, but i found zsh completion does not work on the ...
2
votes
1answer
178 views

How to remove a filename from bash completion, based on its suffix?

Apologies if this is a duplicate, but I'm (unsuccessfully) trying to edit the bash completion options for vim. Specifically, when editing a LaTeX document, there are lots of supplementary files which ...
1
vote
1answer
79 views

When using zsh tab-completion, Ignore CDPATH if a local file or directory matches

I love Z shell's tab completion with CDPATH, but sometimes it's overkill. I'd like it to only kick in as a fall-back if nothing in the local directory matches. For instance, I was just in ...
5
votes
1answer
74 views

Keep the space after completion for some characters in zsh

Zsh has a bit of completion-related automation that's nice most of the time: after pressing Tab, a space is inserted automatically (or some other appropriate character such as , inside braces). I ...
3
votes
3answers
95 views

Autocomplete of a file name in bash prompt

I usually put a date before a file or directory name similar to 2014-04-20 file_name.doc. So, in a folder there is usually a bunch of files and directories starting with a date. But when accessing ...
2
votes
1answer
39 views

How to associate exstension with program so that it works with tab complete

I use texmaker to edit my LaTeX (.tex) documents. I also use texmaker for other things, but 90% of the time I just want to open a .tex document. If I want to open document.tex, I usually just write ...
2
votes
0answers
27 views

Escaping output in tcsh completion by program

How do I escape output in the program providing completion? Suppose: tcsh% complete foo 'p/*/`mycomp`/' And mycomp is a Perl program printing this: #!/usr/bin/perl print "one\n"; print "two ...
2
votes
1answer
37 views

tcsh completion questions

I come from bash and am looking into tcsh's tab completion feature. 1) Is it correct that tcsh cannot delegate completion to a shell function (the way bash does with 'complete -F _func cmd')? 2) ...
1
vote
2answers
77 views

bash completion: how to complete a list of hosts for a specific argument?

My programm can have the following format: <command_name> <arguments> <options> -hosts <host1> <host2> ... <hostn> (<more_arguments>) ... I am trying to set ...
2
votes
1answer
557 views

oh-my-zsh style completion for directory/file paths without oh my zsh

I had oh-my-zsh installed for a while, and I could type a full path using only one letter, then press tab to case-insensitively autocomplete the whole thing. For example, if I had a file at ...