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
6
votes
2answers
766 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
37 views

email address completion in zsh

This is an extract from the zsh shell's manual: The completion system in zsh is programmable. For example, the shell can be set to complete email addresses in arguments to the mail ...
0
votes
0answers
20 views

Trying for infix bash completion

I'm trying to make a bash-completion function that will match infix like this: candidates: Ay Axy Axx Bx $ x<tab> Should suggest Axx Axy Bx. So far, I've come up with this: f1 () { local ...
0
votes
0answers
16 views

gnome terminal text-input stutters

Operating on Debian 4.19.37-5, a Buster 10.0 with a gnome 3(.30?) as GUI, I do experience annoying, from time to time even destructive behaviour, that does originate from the gnome terminal, I think. ...
2
votes
1answer
41 views

How to properly make custom zsh completions “just work”?

Please forgive me if I'm doing something stupid here, the documentation is huge and searching didn't turn up anything yet. I'm trying to create shell completions for my custom script called fab. For ...
4
votes
0answers
23 views

Bash completion own compgen prefix

I have a simple bash completion script that essentially invokes my (non-bash) program and set its output to COMREPLY, i.e. COMPREPLY=( $(my-program -- "${COMP_WORDS[@]}") ) Some of the options ...
1
vote
0answers
15 views

How to get auto complete to work on aliases [duplicate]

I have created some aliases but tab completion doesn't work for them. I mean I created an alias impulse typing impul+TAB gives expected result but after that it doesn't works. I mean it doesn't ...
2
votes
0answers
18 views

How to enable “on-the-fly” autocompletion with vim-supertab?

Using the "supertab" plugin for autocompletion in vim, how can I make it so that hitting TAB is not required for the selection menu to pop up? I.e. what I want is the menu to be always present and to ...
1
vote
1answer
62 views

Is it possible to have tab autocompletion of remote files for SCP?

Given host A / user a and host B / user b, and ssh from A to B: a@A$ ssh b@B. Suppose that in B there is a file called hello.txt. As we know, if I log into B and look for this file, I can use tab to ...
2
votes
1answer
31 views

ignore specific command from zsh completion

Is it possible to tell zsh to not autocomplete certain commands when using TAB completion ? EXAMPLE: I type chm <tab> and zsh completion offers me two options: chmem chmod I never use chmem....
4
votes
1answer
892 views

Custom tab-completion in bash's `read`

Is there a way to "import" a list of words into bash's read builtin to have custom tab-completion? I've been writing a wrapper script for suckless' minimalist irc client "ii", and I don't have a way ...
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 ...
1
vote
0answers
29 views

bash/zsh: Is it possible to prevent auto-inclusion of a slash when using tabs to autocomplete a path?

When I use tab to autocomplete a path, a trailing slash is automatically added. I checked both bash and ZSH and I get the same behavior. Is it possible to prevent this? I check unsetopt and I have "...
0
votes
1answer
18 views

Complete something not according to the context in zsh

I use zsh with the “new” completion system (compinit). Sometimes I want to restrict completion to a subset of what is possible, to cut down on ambiguity. This is a user choice, not a configuration ...
53
votes
5answers
18k views

How do I get bash completion for command aliases?

I am looking to get tab-completion on my command line aliases, for example, say I defined the following alias : alias apt-inst='sudo aptitude install' Is there a way to get the completions provided ...
3
votes
1answer
55 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 ...
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
195 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 ...
1
vote
2answers
1k 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
42 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
20 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
987 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 ...
26
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
54 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
35 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/...
0
votes
1answer
43 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
13 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 ...
6
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
36 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
307 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
42 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
30 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
875 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
18 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
31 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
33 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 ...
2
votes
0answers
40 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
115 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
40 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
493 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 ...
0
votes
0answers
85 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
50 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
587 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
963 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
71 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 $ ./...