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
1 answer

Tab completion for alias with the same names in zsh

I am using zsh. I have a command foo, and I use alias foo="sudo foo" as a shortcut. I want zsh to complete the command just like I typed foo. I googled and found compdef _foo f=foo which can deal with it. When I type f something, the completion…
kqwyf
  • 84
  • 7
0
votes
0 answers

ZSH tab-completion for git commands not working as expected

I recently got a new MacBook for work and had to setup a new dev environment, and the tab-completion for git commands isn't working the way it does on my old machine. I used to be able to type git checkout 1234 and it would tab-complete to git…
0
votes
0 answers

"TAB" doesn't work in the terminal by using git

I know that it is possible to make the commands complete by pressing the tab key. But for some reason this function does not work for me. Tell me please, how to fix it? My operating system is mac os.
0
votes
0 answers

bash completion script that susbtitute to another command

I want to make a "completion script" that substitutes a virtual command (g) to another command (cd). I want g dl to dynamically transform into cd ~/dl/. An alias is not what I want, because I want to continue typing. The g's argument is…
ppom
  • 1
  • 3
0
votes
0 answers

SOLVED Error in BASH tab-completion with variable

I encounter an error with BASHs tab-completion with a variable being part of a filename or path. The variable points to a certain path and that variable gets generated during boot time. Due to an scripting error or maybe intentional it has a double…
Rava
  • 53
  • 7
0
votes
0 answers

How to edit ssh bash complete for config file entries?

So I am aware one can edit bash tab completion scripts with functions for a variety of behaviors I have configured a long list of aws hosts on my .ssh/config, written as dot sepparated names, like so: Host aws..
Guga Figueiredo
  • 292
  • 4
  • 18
0
votes
2 answers

Shell command completion

User commands can be given the -complete=shellcmd option. This turns out to be quite disappointing, since instead of working in the same way as vim's built-in completion for its :! command, it just repeatedly completes the names of shell commands…
intuited
  • 23,174
  • 7
  • 66
  • 88
0
votes
1 answer

Emulate TAB key press in Bash script to autocomplete

I have simple Bash script running command in Kubernetes, however I need autocomplete in one command to continue: #!/bin/bash DATE=$(date +%Y-%m-%d_%H:%M:%S) printf "Available Kubectl contexts:\n\n" kubectl config get-contexts -o=name | sort…
DisplayName
  • 479
  • 2
  • 7
  • 20
0
votes
1 answer

Bash completion using output from script

I know there are a lot of tutorials on bash completion, but I just can't figure this out. All I want is this. If I type myscript[tab][tab], then "myscript list-commands" is run. It will output a space delimited list of available commands (but I can…
tscheingeld
  • 789
  • 7
  • 24
0
votes
2 answers

Variable completion in Octave GUI Editor

I mean to get completion of variable names, function names, function argument names, and keywords in Octave, similarly as in Eclipse CDT, e.g. This works in the Command window, but not in the Editor, where only keywords and functions can be…
0
votes
1 answer

How to add tab-completion to command with two arguments (and tab complete both)?

Let's have a command command. This command has an option -o that takes 2 arguments. I'd like to add tab-completion to both of those arguments. I've tried complete -c command -x -s o -a "complete first arg" I but cannot add tab-completion to the…
matusf
  • 469
  • 1
  • 8
  • 20
0
votes
0 answers

PowerShell script for tab completion

In Word or Eclipse, as an example, it has an option to "auto-correct" a custom phrase like sysout into System.out.println("");. However, is there a script I could use to have this same function while typing in any other program? For example, if I…
Alexander
  • 9
  • 4
0
votes
0 answers

How might I implement tab completion in GoLang?

I have an interactive program written in Go. How might I go about implementing tab completion within the program? Would command history be possible (pressing up/down arrow key)? Example: $ ./go-program (Go-Program)> set option
Mike
  • 37
  • 6
0
votes
0 answers

emacs shell tab file name completion never close and multiply - after gdb locking in windows fix

See further below for the original question. I've used gdb for over a couple of decades, and after an update gdb started defeating c-x-b and preventing windows from being used to view things I wanted to see, while forcing bindings to buffers I…
user10469346
0
votes
1 answer

Tab completion inside singularity bash shell

I am using a singularity container created from a docker ubuntu:xenial base image. When I get into the shell using this command - singularity shell --bind /path/to/inputs:/mnt3,/path/to/outputs:/mnt2 /singularity_docker_xenial_image.img 1) the tab…