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.

Filter by
Sorted by
Tagged with
5
votes
4answers
2k views

Why bash disables autocompletion for some commands and how can I enable it?

It often happens to me that bash disables auto completion for certain commands. This forces me to add random symbol to name of command, use autocompletion, and than fix the command name. This is ...
5
votes
2answers
3k 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 file0001....
1
vote
1answer
177 views
+150

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 ...
1
vote
2answers
951 views

Very slow auto-completion in Linux for Windows

For some reason auto-completion is very slow for me in WSL, it always takes several seconds display the result of, for example ll ~/Te<tab> (which would, after 2-3 seconds, print ll ~/Temp). I'...
1
vote
0answers
36 views

Bash Tab Completion in continuous line

I am trying to develop an autocomplete or tab-complete feature for my own set of commands. For my conitnous line input the identifer is .E or .D. For example: FILENAME N [TAB] [TAB] FILENAME ...
0
votes
0answers
14 views

distinguish absolute from relative paths in zsh completion function

I have a command that can accept absolute and relative paths (just like ls) as first argument # absolute mycommand $HOME/.local mycommand /tmp/ # relative mycommand ../build mycommand file_in_cwd.txt ...
2
votes
4answers
969 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 ...
25
votes
3answers
7k views

Bash autocomplete: first list files then cycle through them

Is it possible to configure bash in such a way that on the first tab autocomplete it lists all possible files and on subsequent ones cycles through the choices? Both options are easy to do ...
2
votes
1answer
41 views

Complete a command fully relative to a different directory

I have a function to run a single command in a different category. cd1 SOMEDIR MYCOMMAND ARG… is equivalent to (cd SOMEDIR && MYCOMMAND ARG…), with two advantages. It's slightly easier to type ...
0
votes
1answer
31 views

Update bash-completion automatically when installing package

I'm having trouble trying to update automatically the bash completion in the current bash session when installing a package. My package installs the completion file in /usr/share/bash-completion/...
2
votes
0answers
32 views

2nd configuration for Bash complete to work independently of TAB completion

Is it possible to have a second configuration for Bash's complete which operates independently of the standard TAB triggered one? I've written a Bash filename completion script tailored specifically ...
0
votes
1answer
39 views

Tab completion after equality sign in bash

How do I get bash to autocomplete when pressing TAB after an equality sign (=)? E.g. starting Abaqus, I use the command line abaqus job= and would like to be able to press TAB after '=' and get a ...
0
votes
0answers
12 views

Bash, autocompletion run commands with parameter

I have bash script kbase for 'cat' and 'grep -A10' from specified files for specific word with arguments. Main part of script. cat ~/bash/kb/*.kb | grep "## $1" | grep $2 | grep $3 One .kb file is ...
5
votes
2answers
2k 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
1answer
31 views

I have a tab completion that hangs, is it possible to use strace to find out what is going on?

In my example I start typing sudo su dkay...<tab>... and the command hangs for about a minute before tab completing to sudo su dkayton. I got advised to use strace to find out what is happening....
5
votes
2answers
276 views

How to generate list of *all* available commands and functions?

In Linux (I am using CentOS 7), there is a built in functionality to view all runnable commands. The command is run by pressing tab twice in the console followed by the prompt: Display all 1130 ...
-1
votes
2answers
38 views

“Filename” vs “Filename-git”

What is the meaning of files that end in -git? For example, I searched in a Terminal for "xcb-imdkit" then pressed tab. xcb-imdkit comes up, as well as "xcb-imdkit-git".
1
vote
1answer
28 views

Make auto completion options remain on screen in zsh, like bash

As Apple rolled out the first developer previews of macOS Catalina, it seems like they have made the default shell into zsh, instead of the good old bash. I've kept myself at Mojave, but nonetheless I'...
9
votes
4answers
856 views

How to order files by date in tab completion list

$ 7z l ~/Downloads/Tab How to make the resulting list to be sorted by date, not by name? I currently use special script to list N most recent files in a given directory (and copy the filename ...
0
votes
0answers
16 views

Classic path completion with complete -F

I wrote the function to do a dynamic autocompletion for my tool, for the first argument (for example: mytool <run | delete> --other_opt /media/../../). How can I use the classic path ...
1
vote
0answers
29 views

zsh _arguments completion that gradually reveals options

I have at the moment a completion function that looks something like this (except way more entries) _arguments \ '-check[do a check]' \ '-play[play a specific song]:songnumber' \ '-test.n=[run ...
5
votes
2answers
7k 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 ...
2
votes
1answer
28 views

how do I tab in telnet when executing it on remote host by ssh?

How can I use tab when I use telnet on a remote host by ssh, I have something like: ssh -o StritHopstKeyChecking=no -p port user@hostA telnet hostB; echo "Reconnect?"; while read < /dev/tty; do ...
1
vote
0answers
28 views

Tab complete global alias names not at the beginning of a line

I have a bunch of aliases like this alias -g foo=cmd1 alias -g faz=cmd2 alias -g fam=cmd3 At the shell (I'm using zsh) I want to be able to type echo fa<TAB> and be prompted for faz or fam ...
0
votes
1answer
76 views

How to use zsh tab completion on Git without origin?

I am using zsh with oh-my-zsh on Ubuntu 18.04.2. Currently, Git is installed at version 2.20.1. Whenever I want to push a local branch to a remote (origin) I try to use the tab completion in the ...
1
vote
0answers
31 views

How to restrict autocomplete for the files found from PATH?

What I would like to be able to do is to have a list of words that are allowed to be autocompleted when typing the first word in the command line. Say, I have PATH=/dir, and the directory /dir has ...
0
votes
0answers
34 views

Add trailing slash in csh

How do I get csh to add a trailing slash at the end of tab autocompletion? eg: \stuff \otherstuff now if I type cd s and press tab, I get: \stuff and not \stuff\
5
votes
1answer
491 views

Assign both menu-complete and dynamic-complete-history to TAB

Is there a way for me to assign both menu-complete and dynamic-complete-history to Tab (or one to Tab and the other to Tab-Tab) in .inputrc? I'm thinking there might be a way to setup a function and ...
5
votes
1answer
649 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 ...
0
votes
0answers
62 views

slow autocomplete for cd in directory with many files

In directory with many files but only a few directories autocomplete is very slow for directories. If I type cd something tab it will take ages to autocomplete. Presumably this is because it is ...
3
votes
2answers
2k views

Using zsh autocompletion for alias

I have created a few aliases for git in zsh, for example gch = git checkout, grb = git rebase --committer-date-is-author-date and some more complex useful zsh functions for git commands. But how can I ...
3
votes
2answers
49 views

zsh completion for media player

In my .zshrc, I have menu select disabled globally, except for mpv/mplayer: zstyle ':completion:*' menu select=0 zstyle ':completion::complete:mpv:*' menu yes select This works as expected, but I ...
2
votes
1answer
576 views

Installed Anaconda -> strange behavior with DNF

I am using Fedora 26. Since I installed Anaconda, if I type in Terminal something like sudo dnf install gnome[TAB] I get Traceback (most recent call last): File "<string>", line 1, in <...
17
votes
1answer
933 views

Zsh tab completions not working as desired for partial paths

I want case-insensitive fuzzy completion for files and directories in zsh. After reading the manual for a few hours, this is what I came up with: zstyle ':completion:*:*:*:*:globbed-files' matcher 'r:...
11
votes
2answers
5k views

Make BASH's Tab Completion Fill In First Match?

Is there any way to make BASH fill in the first match when I press TAB, kind of like the Windows command prompt? (It should still display the list of matches, but it should cycle through them when I ...
1
vote
0answers
59 views

How can i fix Linux Mint 19.1's GNOME terminal not TAB-autocompleting file names in apt?

I have a .deb package downloaded that i want to install using apt. When i wanted to TAB-autocomplete the following command nothing happened. $ sudo apt install ./pa[TAB] However, when i tried $ ./...
2
votes
1answer
45 views

How to look up zsh completion definitions

Is there a way to lookup (just print the completion definition to stdout) currently loaded zsh completion functions. I understand that they are stored somewhere on my fpath and I could do something ...
12
votes
6answers
4k views

LC_CTYPE breaking autocomplete: what is the cause of this problem?

For some reason today, every time I hit tab in the terminal, this shows up: cat bash: warning: setlocale: LC_CTYPE: cannot change locale (en_CA) Display all 150 possibilities? (y or n) This ...
2
votes
3answers
541 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
55 views

Using tab for autocompletion doesn't work for certain kinds of filenames

Normally, one can hit the tab key after entering the first few characters of a filename and get the complete filename (or suggestions in case there are many with the same beginning characters). ...
5
votes
1answer
1k views

Autocomplete in make based on possible targets

The Makefile is: %.pdf: %.tex rubber -d $< If there is a doc.tex in the directory, then make doc.pdf builds doc.pdf. The problem is that when I type make, the autocompletion gives nothing: it ...
2
votes
1answer
697 views

How to change the key for autocompletion in ZSH?

I'm on Ubuntu Mate 16.04 using terminator as my terminal. And using zsh version 5.1.1. I'd rather change the keybinding to the left arrow key to emulate fish in a way. Anyone know how?
3
votes
2answers
771 views

Bash autocomplete variables for other commands than cd

I have env variable $SCRIPT. Normaly I can use autocomplete vim $SC<tab> and completion works as expected. On some systems it does not work. I have bash completion loaded, but completion in ...
4
votes
1answer
385 views

Ignore files for zsh's completion for SVN

I managed to configure zsh such that it does not suggest LaTeX temporary files when I use autocompletion for emacs by adding this line to my ~/.zshrc: zstyle ':completion:*:*:emacs:*:*files' ignored-...
2
votes
1answer
300 views

Bash completion extra space when adding file directory

I have a script for extending bash-completion for certain commands. If I type command1 and do a tab, it should auto-complete with a file directory (and the files). It works fine expect for one ...
0
votes
1answer
54 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
1answer
578 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
1answer
61 views

Documentation on bash completion

I've been unable to find complete documentation for the complete and compgen bash builtin commands. I'm on a Macintosh and help complete produces complete: complete [-abcdefgjksuv] [-pr] [-o option] ...
1
vote
1answer
56 views

ssh bash completion : sed: -e expression #1, char 97: invalid reference \2 on `s' command's RHS

I'm using Ubuntu 14.04.5 LTS. The ssh bash completion on any Host of the file ~/.ssh/config does not work : $ ssh b2sed: -e expression #1, char 97: invalid reference \2 on `s' command's RHS The ...
1
vote
2answers
200 views

Show possible completions in zsh (possible-completions in bash)

I have recently switched to zsh from bash. Deep in my inputrc, I had "\e[/": possible-completions set. This allowed me to see all completions at a given point, without applying them. This was really ...