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
0
votes
2answers
56 views

Bash tab completion slow after accidentally writing (but then deleting) millions of files to a directory

The other day I had a script error which wrote 4 million small text files to my home directory: I've accidentally written 4 million small text files to a folder, how best to get rid of them? I ...
2
votes
2answers
80 views

`ls -l ~~` (two tilde)+ tab does not show directories starting with ~~, but users

In the bash shell, why does ls -l ~~ + Tab not show directories starting with ~~, but users? (all users). The ls -l is just an example. If I type ~ + Tab in any directory, I get a list of users.
1
vote
1answer
24 views

zsh ssh autocomplete Host instead of Hostname from ~/.ssh/hosts

Is there a way I can massage my ~/.zshrc to make the ssh auto-completion autocomplete for the Host, not the Hostname? I have an entry in my ~/.ssh/config that looks like this: Host staging-rfc ...
0
votes
1answer
27 views

Bash completion not working with symlink tree

Let's say that I have this tree architecture: ~/user |_____ dir0 |_____ symlink0 | |_______ somefile0 |_____ symlink1 |_______ somefile1 |_______ somefile2 If I'm doing this: cd ...
1
vote
1answer
14 views

Zsh completion script found but not executed

First, let's assume that I have: alias foo='path/to/my/program' in my .zshrc, then I created a completion script ~/.oh-my-zsh/completions/_foo for it, where inside the file I have: #compdef foo ...
1
vote
1answer
21 views

Zsh file autocompletion with bare git repo

I have this in my .zshrc: # command completion autoload -Uz compinit compinit usually letting me tab through commands, args, and files. But with git --git-dir=<the path> --work-tree="$HOME" (...
0
votes
0answers
6 views

Is there a simple way to define different bash completion methods for different parameter positions

I have a script called like this: thescript some_command file1 file2.... If I do complete -W "cmd1 cmd2 cmd3" thescript I get the cmd1/cmd2/cmd3 completion for the first pamater but also for what ...
2
votes
1answer
21 views

zsh completion tag-order matching patterns

Is it possible to use matching patterns instead of ignored-patters in tag-order? I'd like to try a custom limited set of matching completions on the first try without a prefix, like this: $ man <...
5
votes
1answer
159 views

Which shell is this?

Which shell is this? How to get that auto-complete?
0
votes
1answer
32 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
43 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
23 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
39 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
26 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
33 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
25 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
76 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
51 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
35 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
139 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
49 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
25 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
272 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
23 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
31 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
20 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
25 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 ...
4
votes
1answer
54 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
46 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
28 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
66 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
49 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
33 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
71 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
44 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
57 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
78 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
17 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
59 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
462 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
100 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
20 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
52 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
52 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
42 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
42 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
211 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
95 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 ...