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
1answer
106 views

Is there a way to use regex expressions to auto-fill filenames in bash?

Assuming I have a directory with files as shown: $ ls file0001.txt file0002.txt file0003.txt file0004.txt file0005.txt someotherfile.txt Lets say I want to run the following command: $ cat ...
58
votes
2answers
36k views

An easy bash completion tutorial? [closed]

I want to learn how to write bash completion scripts. Which tutorial would you recommend for a newbie?
2
votes
2answers
99 views

How can I remove a command from bash completion?

For bash completion, I would like to replace youtube-dl with youtubedl. I can make an alias for youtubedl, however, both youtube-dl with youtubedl will exist. Primarily, I just want to remove ...
1
vote
0answers
31 views

How to have full completion in a run application dialog?

I've configured XFCE to execute gmrun as run dialog (Alt-F2). It works great with completion on commands but does not propose completion on arguments. How to set up a run dialog with full bash/zsh ...
3
votes
2answers
60 views

Bash completion for user without access to /etc

I'm using a Chromebook (with a developer mode enabled), and as someone of you may know, there is no write access to the system directories (including /etc/). I'd like to enable the bash-completion ...
5
votes
1answer
66 views

What's the relevance of these bash completion suggestions?

~ is $HOME. For me, cd ~ is /home/cat. Simple so far, yes? In Bash, the following happens: cat @ mint-kitty : ~/Downloads $ cd ~ # from /home/cat/Downloads to /home/cat/, as an example, but ...
0
votes
0answers
19 views

autocomplete in noexec mounted drive

I noticed that bash won't let me tab-complete executable files in a noexec file system. I'm assuming that in order for it to actually auto-complete, the file has to be within the PATH and at least ...
4
votes
1answer
54 views

Use same colors in bash tab complete and ls [duplicate]

Bash is using a different color for tab completion than ls. For example, my ls command uses a red color for a broken symlinks (I'm using dircolors to configure it), but if I use ls Tab, the color is ...
0
votes
2answers
36 views

Why isn't the tab-key autocompleting under Xfce4?

I have a big problem under Xfce4, namely when I try to start a program using alt+F2, I'll start typing xfce4-terminal and before I finish it, it suggests the end of the sentence--but usually you ...
1
vote
1answer
54 views

Bash Autocompletion - Insert words in commands

I know that linux bash has autocompletion feature when TAB is pressed and it will show possible completions just below the command. My question is how can you update autocomplete feature so that in ...
6
votes
1answer
881 views

Can the command completion for `cd` be modified 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 ...
1
vote
1answer
43 views

Clever complete of .c and .o

I would like that bash completes my command vim myPrTab to vim myProgramName.c even if the current folder also contains a file called myProgramName.o, since 99.9% of the time I want to open the source ...
1
vote
2answers
180 views

Add arguments when completing a command name

I am looking for a way to expand some predefined strings in the terminal when tab (or another key combination) is pressed. This is different from tab completion. My terminal already expands ~ to my ...
3
votes
1answer
53 views

zsh: Tab completion for function with Git commands

In zsh I am using the following function to delete a local and a remote branch with one command: gpDo () { git branch -d "$1" && git push --delete origin "$1" } Currently, auto-...
0
votes
0answers
23 views

Why is my tab complete running slowly [duplicate]

I've recently noticed that the tab complete in my terminal is running rather slowly (maybe 1-2 seconds but it used to be a lot quicker, and it's quite annoying as I tab complete a lot). I used another ...
0
votes
1answer
54 views

Why is there an upper limit to tab completion's “display all 3197 possibilities?”

I have a directory containing many (.pdb) files--9917 of them. I wanted to count them to make sure that they were all there (the download said there would be 9917). When I cd into the directory and ...
2
votes
1answer
100 views

Search bash history for already typed command

When I type ctrl+r and then start typing I can see what commands in the history match which is great. Now is there a way to search the history on commands I have already typed in the terminal? For ...
1
vote
1answer
82 views

Bash completion for `unrar`

When bash-completion is loaded, unrar x completes after pressing tab to RAR-archives in the directory. But for multipart archives with the new naming convention, like Filename.part01.rar ...
2
votes
1answer
65 views

How can I configure zsh completion to launch a menu - for command options?

If I am cd'ing into a directory, there is a setting in my ~/.zshrc that tells zsh to always launch a menu when I hit tab on an ambiguous completion, e.g. ~% cd /etc/a tab will immediately cause a ...
4
votes
0answers
99 views

How to get bash tab completion to work with read only file system?

I have deliberately configured the file system of my RaspberryPi (Raspbian - Jessie) to be read only. One of the things that's not (yet) working is tab (aka auto) completion in bash, where I often get ...
4
votes
0answers
55 views

Calling zsh completion function and obtaining its results

I'm trying to make use of zsh's completion widgets in my own scripts. At one point I'd like have access to the result of every completion that is active in zsh, or rather I want to obtain the final ...
6
votes
2answers
1k views

Bash autocompletion for an environment variable holding a directory name

I'm using, among other things, bash 4.2.37 on Linux Mint 14. When I autocomplete the name of an environment variable by typing Tab, it expands to the name of the variable followed by a space. If the ...
1
vote
0answers
14 views

How to pipe bash completion suggestions? [duplicate]

I am trying to save bash completion suggestions to use them. So, I am trying to simulate two tabs and pipe the result to something else. I am looking for something like: $ getCompletions git ...
2
votes
2answers
729 views

bash completion very incomplete on centos 7

I have installed bash completion using yum install --enablerepo=epel bash-completion. While it works for some basic commands (git & yum), I am missing a large part of the completers. My /etc/...
2
votes
0answers
40 views

Is it possible for bash/readline to “clean up” completion suggestions out the terminal?

If you are using zsh and do a tab completion for commands, pathnames, options etc, whenever there are multiple potential matches the suggestions will be displayed below the prompt. Once you chose a ...
1
vote
1answer
3k views

FreeBSD csh, TAB to show available choices?

I am a newbie to FreeBSD. How can i configure csh or tcsh to show available choices by pressing Tab twice, just like bash?
2
votes
1answer
108 views

Is it possible to configure bash to autocomplete with one tab like zsh?

As most people here know, when using bash at the command prompt if you partially type a file name a command or an option to a command etc, bash will complete the word if there is exactly one match. ...
2
votes
1answer
206 views

sudo: nocorrect: command not found

I am using zsh and oh-my-zsh on Arch Linux. I am not able to make directory using mkdir edward@ArchLinux ~ $ sudo mkdir -p /samba/raspberry [sudo] password for edward: sudo: nocorrect: command ...
4
votes
1answer
33 views

Prevent customized bash autocomplete from affecting io redirection (< and >)

I've used complete -W 'firstdatabase databasetwo etc' mysql to save a list of databases, so that I can autocomplete them using the mysql command. However, in many cases I would type mysql db < /...
12
votes
2answers
10k views

How to debug and fix slow autocomplete in bash?

After a recent update (Ubuntu 12.04 LTS), TAB complete on the command line is slow. After entering a partial command (e.g evi [TAB]) or partial filename (e.g. evince somedocu[TAB]) the shell, ...
1
vote
1answer
115 views

Implement a shell in a bash script [closed]

I am trying to emulate a shell in a bash script, like this: cmd_shell() { while true; do read -e -p 'pass> ' command run_cmd $command done } It works ok, and the option -...
1
vote
0answers
40 views

Bash tab completion not working within symlinked directory

I'm working with Bash 4.2.46 on RHEL7 with the bash-completion packages installed, but I seem to have found an odd corner case where tab completion doesn't seem to work as expected. I have a set of ...
2
votes
1answer
58 views

Automatically add slash when navigating through symlink

I use symlinks a lot and pretty much linked my whole home directory into a folder .other or .dotfiles. When I'm im my home directory and try to got into the folder .config/, its actually a symbolic ...
2
votes
2answers
61 views

Autocomplete from grep output

How might I more easily use a filename found by grep as an argument to vim: $ grep -r foo * lib/beatles/john.c lib/pantera/phil.c lib/pinkfloyd/roger.c lib/pinkfloyd/richard.c lib/whitestripes/...
5
votes
1answer
1k 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 ...
4
votes
0answers
29 views

How do I write a custom filename completer for specific directories in zsh?

I've found that file names with dates before the title are difficult to tab-completion. I'd like to write custom completion functions for these directories. How do I specify that the completer should ...
1
vote
2answers
189 views

Linux shell that allows you to choose from tab completion

This is an odd question, and I don't have a lot of information to provide but .. I recall seeing a Linux terminal that had a feature which allowed its user to choose between the options listed from a ...
0
votes
1answer
80 views

Strange directories in /home

There are some strange directories appearing in /home (so far, maybe in other locations too). These directories do not show up in ls but do with bash's tab autocomplete, when doing things like cd. ...
1
vote
1answer
29 views

Can I auto-complete by tab in zsh with regular expression

I use oh-my-zsh configuration. When I want to auto-complete, I need to first type correctly the initial letter. For example go, then tab will give google-chrome. If I type *le-ch*. It didn't work. How ...
1
vote
0answers
39 views

Can I clear an env var during bash completion?

I use bash completion from https://bash-completion.alioth.debian.org/ and some vendor supplied scripts too (eg. https://github.com/git/git/blob/master/contrib/completion/git-completion.bash) I also ...
0
votes
0answers
15 views

Why is zsh seemingly ignoring no_list_beep?

I have zsh (5.1.1) on OS X (10.10.4), and am using oh-my-zsh with various plugins. When I type e.g. ls z in a directory with multiple items starting with z, zsh beeps and then displays an ...
2
votes
1answer
48 views

Bash tab complete with non-first token in command substitution $(…) throws error

Using tab completion on the first command in $(...) cat $(w When I hit tab I get potential completions as usual. $ cat $(w w wc which wicd-client ...
1
vote
1answer
43 views

What's the intended use case for COMPLETE_ALIASES in zsh?

For some months now, I have had setopt completealiases in my .zshrc. I haven't the faintest idea why I added it - most other things have comments or can be understood from neighbouring settings. ...
4
votes
1answer
159 views

How to use bash's complete or compgen -C (command) option?

When creating shell completion functionality in bash, it seems like the -C option would be powerful and common. It's defined like this: -C command command is executed in a subshell ...
3
votes
1answer
128 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 ...
2
votes
1answer
86 views

pmount hangs on BASH autocomplete

Whenever I try to use autocompletion in combination with pmount the terminal freezes until I abort via CTRL+C which leads to the autocompletion to actually be executed. Autocompletion works fine in ...
0
votes
1answer
90 views

Bash: Tab completion with cdable_vars

I've been relying on this hack for jumping around in the file system for a couple of years before finding out today that I can do the same thing using native Bash by activating the option cdable_vars. ...
25
votes
0answers
851 views

How to combine zsh autocomplete for wrapper function arguments and existing command

I work mostly in gvim and many terminals. Originally, I preferred to open all my files in a single vim instance. To that end I used an alias to open files from my terminals in the current 'vim ...
1
vote
0answers
15 views

Bash tab completion for aliases [duplicate]

I define a number of aliases for my git work flow. alias gs='git status' alias ga='git add -u' alias gaa='git add -A' alias gc='git commit' alias gr='git checkout --' alias gu='git reset HEAD' alias ...
2
votes
2answers
275 views

Prevent path autocompletion from using CDPATH in bash?

On my Mac, bash (version 3.2.53(1)) autocompletes command-line arguments using files only in the current directory. On a Linux machine at work, bash (version 4.1.2(1)) autocompletes command-line ...