3

In this question, the inimitable Dennis Williamson mentions how to bind a keystroke to a command that will run in the background of the Bash shell, with bind -x. How can the same thing be done in Zsh?

(I couldn't find this in the zshzle man page, but it's possible that I overlooked it.)

iconoclast
  • 21,213
  • 15
  • 102
  • 138

1 Answers1

0

You can use zle -M to display info underneath your command line. For example:

.who() {
  zle -M "$(who)"
}

# Create a new widget `who` that calls our function `.who`.
zle -N who .who

# Bind said widget to alt-shift-W.
bindkey '^[W' who
Marlon Richert
  • 5,250
  • 1
  • 18
  • 27