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
4
votes
1answer
96 views

Which shell is this?

Which shell is this? How to get that auto-complete?
0
votes
1answer
30 views

bash completion with arguments containing spaces

How to create a bash completion script that contains spaces in the argument, the following work nicely as long as the args are space separated, but I couldn't make it work with args that contain ...
0
votes
0answers
42 views

function in bash_profile to get `ls` result, choose one of them and pass to next command

Use case: I need to do export KEY=value_file or cat value_file frequently and there are a lot of files so that creating alias for each of them is not actionable. Work flow: XXX$: `name of the ...
0
votes
1answer
21 views

Centos7 autocomplete path not work

In centos6, If I set testPath=/usr/local/bin and then ls $testPath/ press it would be autocompleted as ls /usr/local/bin but in Centos7, shown is ls \$testPath/ how to set this completion rule ...
1
vote
1answer
31 views

zsh: complete relative path as absolute?

I'm trying to write a completion function for a command that requires that its argument be an absolute path. (No, I don't know why.) I thought it would be nice to allow typing a relative path, but ...
0
votes
0answers
22 views

Auto-completing bash command options in vim

When I am writing shell scripts inside of vim, I often myself looking at manpages for the command options the script will use. Is there any way to retrieve the auto-complete wordlist for a command ...
2
votes
0answers
31 views

How can I prevent zsh from trying to autocomplete URLs?

The default completion of the curl and open commands tries to fill in URLs. For example, typing curl <TAB> gives file: ftp:// gopher:// http:// https:// alongside any files in the ...
1
vote
1answer
20 views

How to set up alias to cd into a subdirectory with completions?

I've set up this function in my ~/.zshrc: cdp() { cd "/mnt/c/Users/Mark/PhpstormProjects/$1" } But I don't get tab completions for it. Is there any way to get the directory names to autocomplete ...
1
vote
1answer
46 views

Does not work autocompletion on <TAB> in bash command line [closed]

When I tried to use auto completion in bash terminal with TAB, I have got the following error: bash: !ref: unbound variable bash: words[i]: unbound variable It is pretty annoying to manually enter ...
0
votes
0answers
49 views

autocomplete with tar and .xz

When I wish to unpack a certain file with tar, I type tar followed by my chosen parameters. Then I type the first(s) letter of the file name and then press the tab key, as to let the autocomplete ...
0
votes
0answers
29 views

npm autocomplete broken if prefixed by double dash (--)

I notice this when using a command that accepts additional args after a double-dash, for example: npm test -- spec/blah-spec.js In a raw, clean, ZSH v5.3 install, tab-completion works properly: npm ...
3
votes
1answer
114 views

Autocomplete not working while exporting environment variable in bash

Suppose I wish to export an environment variable named MYPATH holding following 2 paths: /full/path/to/fileA /another/full/path/to/fileB So, I think it should be done like this in bash: $export ...
0
votes
1answer
47 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
24 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 ...
3
votes
1answer
151 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 ...
0
votes
0answers
20 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. ...
4
votes
0answers
28 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
19 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
20 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 ...
3
votes
1answer
42 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....
1
vote
0answers
38 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
23 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 ...
1
vote
1answer
64 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 ...
1
vote
0answers
48 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
28 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
1answer
63 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
40 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/...
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 ...
0
votes
1answer
67 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
15 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 ...
2
votes
1answer
48 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
404 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
vote
1answer
65 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'...
-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".
0
votes
0answers
19 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
34 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 ...
2
votes
1answer
44 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
47 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 ...
1
vote
0answers
41 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
39 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\
0
votes
1answer
173 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 ...
0
votes
0answers
91 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
52 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 ...
1
vote
0answers
91 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
63 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 ...
1
vote
1answer
60 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). ...
2
votes
1answer
73 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
71 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
1answer
87 views

Alias to prompt for tab completion for a set of directories?

Is it possible to make a bash alias, which would be able to prompt me for tab-completion of a set of directories? let's say I have a number of source code controlled projects, main path of each ...
1
vote
2answers
392 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 ...