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
1 vote
0 answers
12 views

Bash File Completion Creates Python Virtual Environment

Sometimes when I use tab file completion in a bash shell it pauses for one or two seconds before showing tab completion, and creates a Python virtual environment in my current directory. For example ...
user avatar
  • 11
7 votes
1 answer
221 views

Adding tab completion to a bash script

I am creating a script which does some processing on a file. For the file, Ι will select any file from the current directory or will give path to a file. Problem is the file name can be huge, so ...
user avatar
  • 150
0 votes
1 answer
30 views

How to show iTerm2 completion suggestions in a menu while typing

In a presentation at Docker Con 2022, Shy Ruparel showed his iTerm2 terminal with an awesome completion/suggestion function. It shows command suggestions in a menu while typing, without pressing TAB ...
user avatar
  • 111
-1 votes
1 answer
30 views

zsh: tab rotates between directories, what key to select and enter one?

I am trying to complete path within a directory tree. When I press tab at any directory level, completion rotates among all possible directory completions. Is there a way to bind a key to "select&...
user avatar
1 vote
0 answers
30 views

Autocompletion not working for pass password manager in zsh in linux

I already used pass program for password managing on MacOS with zsh (where the autocompletion worked flawlessly out of the box) and now trying to move on linux on a raspberry pi 4b 4GB, installed zsh ...
user avatar
  • 329
1 vote
0 answers
97 views

TAB completion not working for mounted partition

I'm used to mount a Windows partition (G) into my Windows Subsystem for Linux (running Ubuntu 20.04) by giving the following commands: sudo mkdir /mnt/g sudo mount -t drvfs G: /mnt/g Unfortunately, ...
user avatar
0 votes
1 answer
22 views

How can I suppress *:// from tab completion suggestions for 'open'?

I have experience this in OS X in zsh shell, man page for open. $ type open open is /usr/bin/open $ man open OPEN(1) General Commands Manual OPEN(1) ...
user avatar
  • 229
2 votes
1 answer
29 views

How can I display file completion without escapes for spaces and special shell characters?

I have a bunch of filenames with spaces: [~/music]% ls Acid Eater - Black Fuzz On Wheels.ogg Angel'in Heavy Syrup 4.mp3 Akalé Wubé - Akalé Wubé.opus Astor Piazzolla & Gary ...
user avatar
1 vote
1 answer
39 views

Is there any way to make autocompletion work for command option names in Bash?

I'm using Bash 4.4. [root@192 ~]# bash --version GNU bash, version 4.4.19(1)-release (x86_64-redhat-linux-gnu) Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or ...
user avatar
0 votes
0 answers
66 views

When does /usr/share/zsh/vendor-completions get loaded?

As far as I can tell, my .zshrc doesn't manually source anything in /usr/share/zsh/vendor-completions. If I try to write, in my .zshrc, an alias for a command that has completions set up in /usr/share/...
user avatar
  • 153
1 vote
0 answers
32 views

History expansion with a string containing whitespace

I've been using unix for awhile and haven't like to use !, which, for as long as I've used unix, I've interpreted as find the last command that begins with the string following !, but it seems to not ...
user avatar
0 votes
0 answers
33 views

Disable Bash completion for a single environmental variable

Suppose I have an environmental variable $SAVE_DIR=/etc/ used to return to a saved directory (here /etc/) from any Bash shell. Typing cd $SAV[Tab] expands to cd $SAVE_DIR which is quite convenient. ...
user avatar
  • 101
0 votes
0 answers
65 views

Bash completion and spaces

I am writing a bash completion script for a Perl script with two types of options: Options without argument (e.g., --verbose) and options with argument specified after an = sign (e.g., --debug-file=/...
user avatar
  • 9,336
3 votes
1 answer
80 views

zsh completion rules for custom script

I have zsh completion file for custom script foo. It should complete regular files in $HOME/foo : #compdef foo _arguments -S : \ '-i' \ '1:thing:_path_files -W $HOME/foo -g "*(.)"' ...
user avatar
3 votes
2 answers
113 views

zsh completion for gpg

I am using the default _gpg completion file for zsh, which came with my zsh version 5.7.1-1 (debian 10). I have pasted the file here: https://ctxt.io/2/AABg86pPFQ When I do gpg <TAB>, zsh ...
user avatar
0 votes
0 answers
582 views

zsh tab completion not working specifically for running `zsh <SCRIPT>`

In general tab-completion is working fine with zsh, except when I try to execute a script as in: zsh script.sh In this case if I write zsh sc[TAB] I get nothing. Are there known fixes, or possible ...
user avatar
0 votes
1 answer
163 views

zsh prefix completion is gone when running in tmux

The prefix completion in zsh using up and down arrow arrow keys is amazing. Let's assume I have the following command history: ls ~ vim .zshrc ls /tmp cat /tmp/wiefoijewfoijwef ls /etc Then, when I ...
user avatar
  • 111
2 votes
1 answer
116 views

How to make zsh autocomplete suggest flags of the inner executable of a wrapper?

I'm using Arch Linux with zsh. I'm using devour as a wrapper for other commands, using it like devour cmd args.... I want zsh autocomplete to suggest cmd's flags/arguments after I've typed out cmd, ...
user avatar
1 vote
0 answers
36 views

Bash: Complete Multiple Nested Directories with Tab

Current .bashrc bind 'set show-all-if-ambiguous on' bind 'TAB:menu-complete' Here's the current behaviour I have: $ cd D<TAB> Desktop/ Documents/ Downloads/ I hit <TAB> again and it ...
user avatar
0 votes
0 answers
58 views

How does one manually ensure tmux starts up with bash completion?

The problem here is potentially a cross-platform issue (I am running a MacOSX Brew-installed tmux with a Brew-installed BASH and bash completion. When I first installed tmux, a new open window ...
user avatar
  • 653
0 votes
0 answers
36 views

zsh path autocomplete does not work in python -m command

I cannot autocomplete paths in a command like: python -m scripts.really_cool_script path/to_very_important.txt Is it possible to make autocomplete work here? It's also useful when I want to find the ...
user avatar
2 votes
1 answer
507 views

Case-insensitive completion in bash

I have a folder ~/TestFolder. The current working directory is the home directory(~). I want to enter a partial command, for example cd test, and I want it auto filled to give the command cd ...
user avatar
  • 21
0 votes
3 answers
108 views

Is there a way to validate a completion file?

I have tool that is able to create a completion file for bash, zsh and fish. I normally use zsh, but i cannot get this completion file to work on zsh. So as a test i installed fish and created the ...
user avatar
2 votes
0 answers
59 views

Preview Oh My Zsh completion

I would like to preview what, if anything, would be completed using oh-my-zsh suggestions. In other words, a visual indicator that pressing TAB will insert what I think it will. in different color (...
user avatar
  • 170
1 vote
0 answers
219 views

zsh/oh-my-zsh: how to make tab completion add no trailing space for non-folder files?

I installed zsh and oh-my-zsh. By default, when using tab completion zsh adds a trailing space for non-folder files. For demonstration I created the following folders/files in a folder named ...
user avatar
0 votes
1 answer
56 views

Autocomplete bash function with available system font

I have a function. How can I add to it an auto-completion with an available font name? So if I type something like doSomethingWithFont Ubun<tab> it'll be completed to doSomethingWithFont Ubuntu\ ...
user avatar
2 votes
3 answers
299 views

Bash tab completion refresh on directory change

I have a command called up (as a function in my bashrc) that allows me to easily go up to specified directories above the one I am in. The command works well, however adding bash tab completion would ...
user avatar
1 vote
1 answer
207 views

Disable zsh "smart" autocompletion for gem command, but keep ordinary path completion

I'm on a Mac running macOS 12.0.1 and trying to switch over from bash to zsh. When I'm trying to issue something like the following command: gem install pg -v 1.2.3 -- --with-pg_config=/opt/homebrew/...
user avatar
2 votes
1 answer
130 views

How do you set the colour of the bash tab completion when `colored-completion-prefix` is turned on?

I have colored-completion-prefix set on in my ~/.inputrc file, but when I tab complete, the prefix part which has already been typed is a colour that I do not like. In the bash manual it says: "...
user avatar
  • 954
1 vote
1 answer
39 views

How can I make an autocomplete function for zsh that can allow for a random number?

I have a small script for managing tickets in gitlab repos. When I type ticket and press tab, I'd like to see: % ticket new -- create a new ticket # -- Number of ticket -v -- increase verbosity ...
user avatar
0 votes
1 answer
34 views

Function tab-completion not matching that of wrapped command

I've got a function defined in my fish shell: function cl --wraps=cd cd $argv && ls -l --color=auto end According to man function, the --wraps option "causes the function to inherit ...
user avatar
0 votes
1 answer
58 views

fish - Maximum recursion depth reached with tab-complete

With my fish shell, I have defined the alias alias black='command black -l 110' When I type black in my shell and start to tab-complete, I get the error complete: maximum recursion depth reached ...
user avatar
1 vote
1 answer
64 views

Bash autocomplete: select random suggestion

Basically I want a way for figlet to choose a random font. It doesn't seem to have an inbuilt method, or at least I haven't found one in the manual or in the web. I want the message to pop up every ...
user avatar
0 votes
0 answers
57 views

Tab-completion for alias

I am trying to set em as an alias and bash-completion alias for emerge. Question: Why does tab complete on the alias cause the error, until I tab complete the original command? Partial .bashrc # Add ...
user avatar
  • 676
1 vote
0 answers
127 views

What is the advantage of defining shell completion in .profile instead of .bashrc?

As I understand it, under Bash, /etc/profile, ~/.profile, and ~/.bash_profile are for settings that persist across subprocesses and subshells (mostly environment variables), while /etc/bashrc and ~/....
user avatar
  • 341
2 votes
2 answers
577 views

Zsh autocompletion for function based on git, why is compdef not working in .zshrc?

I have an alias for git defined as alias g=git With this and my zsh and antigen setup, g has the same auto-completion as git. However, when I replace g with a function to show the git status by ...
user avatar
  • 2,091
2 votes
1 answer
97 views

fill in from previous command arguments

Can I make the right-arrow key fill in an argument-at-a-time from the previous command line? $ mogrify -resize 50% file.jpg $ pressing right arrow now should fill in mogrify, pressing right arrow ...
user avatar
3 votes
1 answer
159 views

How to write automated tests for zsh completion?

I have a project in which I automatically generate zsh completion functions. As I work on it, I've found corner cases and bugs which I'm just writing down and making sure to re-test when I make ...
user avatar
  • 133
1 vote
0 answers
117 views

zsh completion: complete files or directories depending on whether option -r was given

I have following custom completion file for diff. Among other things, it does not offer same file for completion multiple times. #compdef diff local ignore ignore=($words[2,$#words]) local of='-e -f -...
user avatar
2 votes
1 answer
192 views

How to make `zsh` immediately show all completions, without first inserting the common prefix?

I have zsh set up with Oh-My-Zsh. The z plugin allows me to jump to recently used directories. When I type z name<TAB>, it autocompletes name from the list of recently visited dirs by matching ...
user avatar
  • 143
1 vote
0 answers
69 views

zsh completion: different completion when stdin is a pipe

I have a program foo. It can be used in 2 different modes: foo [-c] file1 [file2] or find . -print0 | foo [-0] [-c] In first mode, the only optional argument is -c, and then there are one or more ...
user avatar
1 vote
1 answer
189 views

zsh completion: complete _values, but case-insensitive

I have the following completion script to complete a list of roles: host /usr/share/zsh/vendor-completions # cat _foo #compdef foo local -a values=('ROLE_ADMIN[Admin]' 'ROLE_USER[User]') _values -s ,...
user avatar
0 votes
1 answer
101 views

zsh completion: only complete files in give path, not directories [duplicate]

I need to complete only first level (depth 1) files in given path, and ignore directories. I tried specifying -g '*(.)' but that seems to have no effect: #compdef foo local state _arguments -S : \ ...
user avatar
0 votes
1 answer
86 views

zsh completion: stop completing when wrong option is used

My script foo takes directories in given path /foo/path as argument, plus it has one optional argument -l. I have this completion file: #compdef foo _arguments : \ '-l' \ '*: :->directory'...
user avatar
2 votes
1 answer
119 views

zsh completion: complete options requiring number as argument

I have a script foo, which takes few optional commandline arguments in the form of: foo -A <NUM> -B <NUM> -i or it can also be without space: foo -A<NUM> -B<NUM> -i where NUM ...
user avatar
1 vote
1 answer
175 views

zsh completion: offer completions for files and --options in any order

I have sample command foo, which takes one or more file names, plus any combination of 3 --options. Moreover, the options can be specified anywhere on the commandline, before, after or between the ...
user avatar
1 vote
1 answer
530 views

Autocompletion of makefile with makro in zsh not correct (works in bash)

I have a makefile that has the targets start-prod start-test stop-prod stop-test restart-prod restart-test Autocompletion works in bash without problems but in zsh it will only complete start- etc. ...
user avatar
0 votes
1 answer
195 views

Get the available files in bash - like with 'tab' - but without expanding the current command being typed

Is there a way to get a list of files in a directory while you're typing something into the command line? E.g. you're typing /var/log/, and at this point you'd like to get a list of files, but ...
user avatar
2 votes
1 answer
124 views

How to cd into the only subfolder by auto-completion in bash?

I am using Centos 7 and bash. I know on some machines, if there is only one subfolder (and some files) in current folder, when you type cd <tab> it will auto-complete the name of the subfolder. ...
user avatar
1 vote
1 answer
79 views

How to stop autocomplete on remote ssh server

When I ssh into a remote server (macOS) from a Linux (Mint) laptop, the remote autocomplete engages and completes upon each keystroke. This started fairly recently, but I can't pinpoint exactly when. ...
user avatar

1
2 3 4 5
16