Questions tagged [tab-completion]

Most shells provide tab completion where a user can type part of a command or file name, and then press tab to make the shell complete the command. This saves greatly on the number of key presses needed when working on the command line.

359 questions
0
votes
0 answers

Tab completion with respect to one file type

How is it possible to restrict the tab completion to a specific file type? I think of an additional function x in powershell which only lists .tex files and starts the default or a specified program. I would like to type x doc to the shell, hit the…
Dirk
  • 1,134
  • 2
  • 12
  • 21
0
votes
1 answer

Bash completion not working when environment variable defined

When I define an environment variable inline like this: env_variable=true command, my custom bash completion script fails. Example: user@host in /tmp/tmp.6DRvQAkpFe > ls user@host in /tmp/tmp.6DRvQAkpFe > docker-ssh container1 container2 container3…
Carey
  • 650
  • 1
  • 4
  • 16
0
votes
1 answer

cygwin bash tab completion for arguments fork failure

I have an odd problem with tab completion under cygwin's bash on my Win 7 installation. I get fork failures ('permission denied') under very specific circumstances.. Tab completion works fine for all commands. Tab completion works fine for arguments…
Paperclip Bob
  • 346
  • 2
  • 8
0
votes
1 answer

bash enable autocomplete for PATH names

In bash, if I were to type which pyth it would autocomplete to which python. I have my own program, limitcpu, and if I type limitcpu pyth nothing happens. Tab completion still works for files where I provide the path, but I would like it…
chew socks
  • 1,406
  • 2
  • 17
  • 37
0
votes
1 answer

What is different about these two zsh completion methods?

I have created a zsh completion script. It works as expected if I hardcode the options list, but if I try to generate that same hardcoded value using a bash command, my results are unexpected. For the purposes of this question, I have combined both…
Brian Mego
  • 1,439
  • 11
  • 10
0
votes
0 answers

Completions for directory paths don't work in command args

Example: https://github.com/wadewegner/zsh-completions/blob/master/src/_sfdx I've noticed that completions for the directory stop working. For example, before using the above completion, you could type sfdx force:command -d and then use TAB to…
Wade
  • 741
  • 1
  • 5
  • 18
0
votes
1 answer

Add completion information for existing CLI utility?

For example, I would like to add completion to adb so that when I hit Tab after adb I can see sub-commands like shell and install. In Bash or Zsh the completion is always in separate file, so this is not an issue. How do I do similar thing in…
Franklin Yu
  • 8,920
  • 6
  • 43
  • 57
0
votes
1 answer

addsuffix behaviour in tcsh complete

I am working with a Makefile for conversion of documents. To specify which document to convert, I have to give folder names in 2 make-variables: NAME and DATE. The directory structure is /data/$(NAME)/$(DATE) NAME may contain numbers and…
sbulka
  • 21
  • 1
  • 4
0
votes
1 answer

Zsh completions with multiple repeated options

I am attempting to bend zsh, my shell of choice, to my will, and am completely at a loss on the syntax and operation of completions. My use case is this: I wish to have completions for 'ansible-playbook' under the '-e' option support three…
Josh Souza
  • 396
  • 1
  • 6
0
votes
1 answer

Access bash tab completions from script

You normally interact with bash completion by pressing the tab key in your terminal. I would like to interact with it within a script of mine. Essentially, I would like a function/command that answers the question "If I pressed tab with text xyz…
Drew
  • 12,578
  • 11
  • 58
  • 98
0
votes
1 answer

gnuplot adds extra space after tab completion

On my Ubuntu 14.04, I installed gnuplot using apt-get install gnuplot-x11. It's working fine except that when I tab complete a filename, it adds and extra space which I need to manually delete. This is somewhat annoying. Is there any way to fix it?…
Peaceful
  • 4,920
  • 15
  • 54
  • 79
0
votes
2 answers

How do I prevent Vim from expanding ‘~’ during completion?

I'm on my MacBook using Vim, and let's say for simplicity's sake that I have files ~/some_file.py, ~/some_other_file.py, and ~/user.py open. On macOS, ~ expands to /Users/. So if I type :b user in Vim command line and then hit tab to…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
0
votes
2 answers

tab and arrow keys weird behavior in redhat

I am facing some weird behavior when trying to ssh to the server by using either Iterm2 or OSX Terminal. Basically, the issue is when using tab for auto-completion, it will print one more random extra char in the end, for example: //the 'e' is…
Jack Zhang
  • 304
  • 1
  • 9
  • 21
0
votes
2 answers

Unification of python command line interpreter and command-subcommand command line interfaces

I have an command line interpreter (or "line-oriented command interpreter" in the python docs for the cmd module) for a program that I'd like to add command line utility interface to. For example, now a session looks like this: (% for shell prompt,…
Thomas
  • 6,515
  • 1
  • 31
  • 47
0
votes
0 answers

how to read a piece of script for ZSH completion?

How do I read these lines? #compdef rspec compadd -P spec/ $(ls spec/**/*_spec.rb | sed -E "s/spec\///g") I understand it's a completion rule for ZSH, but I'm not sure I follow what it is saying.... They come from here,…
Mayer
  • 23
  • 5