zsh-users
 help / color / mirror / code / Atom feed
* Hiding Zsh bindkey -s echo of commands
@ 2023-08-16 14:00 Budi
  2023-08-16 15:14 ` Roman Perepelitsa
  0 siblings, 1 reply; 2+ messages in thread
From: Budi @ 2023-08-16 14:00 UTC (permalink / raw)
  To: zsh-users

How to hide Zsh bindkey -s group of commands echos when being invoked,
so this'd behave or perform like Bash' bind -x ?


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Hiding Zsh bindkey -s echo of commands
  2023-08-16 14:00 Hiding Zsh bindkey -s echo of commands Budi
@ 2023-08-16 15:14 ` Roman Perepelitsa
  0 siblings, 0 replies; 2+ messages in thread
From: Roman Perepelitsa @ 2023-08-16 15:14 UTC (permalink / raw)
  To: Budi; +Cc: zsh-users

On Wed, Aug 16, 2023 at 4:00 PM Budi <budikusasi@gmail.com> wrote:
>
> How to hide Zsh bindkey -s group of commands echos when being invoked,
> so this'd behave or perform like Bash' bind -x ?

Something like this should do it:

    function bind-x() {
      local widget=bind-x-widget-$2
      functions[$widget]='zle -I; '$2' <"$TTY"'
      zle -N "$widget"
      bindkey "$1" "$widget"
    }

    # Readline equivalent: bind -x '"\C-T": echo hello'
    bind-x '^T' 'echo hello'

Roman.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-16 15:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-16 14:00 Hiding Zsh bindkey -s echo of commands Budi
2023-08-16 15:14 ` Roman Perepelitsa

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).