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)

0
votes
1answer
39 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 ...
2
votes
0answers
9 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 ...
4
votes
1answer
26 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 < ...
1
vote
1answer
47 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
20 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 ...
1
vote
1answer
30 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
40 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 ...
3
votes
0answers
23 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
61 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
67 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
17 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
28 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
8 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
24 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
29 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. ...
3
votes
1answer
53 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 ...
0
votes
1answer
28 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. ...
1
vote
0answers
13 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
1answer
41 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
43 views

mksh complete when moving to parent directory

I just installed the mksh and don't know how to solve one litte problem I have. When trying to change directory to the parent directory mksh does not complete when pressing "tab". Let me visualize: $ ...
2
votes
1answer
153 views

Dynamic zsh autocomplete for custom commands

I'm trying to write completion functions for some custom functions I wrote, but seem to be really struggling with even the most basic ones. An example function is: function eb_instances() { if ...
3
votes
1answer
31 views

zsh-completion: Completing two parts of an argument, separated by a colon

I'd like to set up zsh completion for a command which has a single argument of the form scheme:parameter. Suppose I have commands which can return all possible schemes, and all possible parameters. ...
1
vote
1answer
27 views

Reset Bash's memory used for auto-complete

After renaming a file to a similar name, I noticed TAB was still completing the old filename (if it matched the letters so far) and not showing the new one. No matter how many letters I typed, it ...
1
vote
0answers
35 views

Bash completion: separately show results from different sources

I have followed this tutorial to write my bash completion function. It has worked out just fine, but I was wondering if it is possible to separately show completions from different sources. For ...
1
vote
1answer
17 views

Disable printing all possibilities in tcsh on TAB

Earlier, in my shell, on pressing TAB, I would directly see the directory path completed to the best length possible. But now, after upgrading to centos-6 I see that it also prints all possible names ...
5
votes
4answers
295 views

Changing directories with Bash

I was wondering if there was an easier way to pick directories to cd to within one's current directory. For example, is there a way to just get a numbered list of the current directory and be able ...
2
votes
1answer
52 views

Bash autocompletion for an alias

This is in my .bashrc: alias p='sudo apt-get'; complete -F _apt_get p I've found the autocompletion only works if I've used autocompletion for apt-get at least once before trying to use it with the ...
0
votes
0answers
97 views

Strange Highlighting Color In ZSH Menu

I am using Arch Linux and zsh. When selecting options from a menu in zsh the color appears to be off when moving down in the list. For example after pressing the tab key twice after typing cd results ...
3
votes
1answer
30 views

Autocompletion: curbing the enthusiasm of a program

The people who package programs often seem to have an overly broad opinion as to the types of files their program will be used to open, as shown in the bash autocompletion setup that they create. For ...
2
votes
1answer
102 views

Bash/zsh tab autocomplete: Given initial command, ignore certain files in directory with autocomplete

What I'm asking is a little bit specific, and might be a different than other autocomplete questions on Unix Stackexchange. Suppose I have a directory that looks like this -rw-r--r-- 1 hlin117 staff ...
2
votes
0answers
53 views

Bash: redirect command argument completion [duplicate]

When you have written in the shell $ somecmd and double tab, you get all the suggestions that apply for that command. How can you redirect this output? I am aware of compgen, it seems to be able to ...
1
vote
1answer
47 views

Command argument completion of `~/bin/*` filenames from any directory in bash

A basic bash feature is the completion of commands stored in the various bin directories, regardless of the current working directory. This allows users to keep commands and binaries organized without ...
2
votes
1answer
134 views

How to implement dynamic bash auto completion

I have made a script that lists available projects. You can start a project by entering script start <project>. Now it would be great to enable autocompletion, so if you're entering start ...
2
votes
2answers
137 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 ...
3
votes
1answer
54 views

How do you make an alias or function that retains tab completion?

I made an alias to save some keystrokes with working with systemd: $ alias sctl='systemctl' However, this breaks tab completion for the subcommands. Is it possible to alias a command without ...
0
votes
1answer
55 views

When I press tab for autocomplete in bash I get: “Cannot parse arguments: unknown option -r” [duplicate]

My tab key's autocomplete function is not working. Instead, it spits out this error message: Cannot parse arguments: unknown option -r
6
votes
1answer
98 views

Start vi at the last line

I often find myself editing one of a set of configuration files by adding lines at the end. For editing I use vi (from bash) and currently use: vi +$(wc -c /home/john/master/tried.cfg) The above ...
1
vote
0answers
51 views

Bash completion function for vim 'scp://' Paths

For easily editing remote files with vim, I currently use a few .vimrc and .bashrc additions to my environment. The bash-scripting side of it "misuses" the available standard _scp bash completion ...
2
votes
2answers
66 views

Can I ignore __pycache__ directories in bash-completion and grep?

I've ignored __pycache__ in my git repos and in vi's wildmenu. The last place these directories pollute my workflow is when recursively grepping through project files and when using tab ...
0
votes
0answers
51 views

vim no tab completion in bash

When in shell, running vim <anything> and pressing tab, doesn't auto complete or show the list of the available files. Although it auto completes for the directory names, but not the file names. ...
3
votes
2answers
96 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
227 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=( ...
5
votes
2answers
179 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
94 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
61 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
45 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
159 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
17 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
182 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
82 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 ...