zsh-users
 help / color / mirror / code / Atom feed
* Calling interactive command inside widget
@ 2016-04-12 21:58 Evgeny Zajcev
  2016-04-13  8:41 ` Peter Stephenson
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Evgeny Zajcev @ 2016-04-12 21:58 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 904 bytes --]

I always had next widget in my zprofile

  my-run-help () {
      words=(${=BUFFER})
      if [[ $words[1] = sudo ]]
      then
          run-help $words[2]
      else
          run-help $words[1]
      fi
      zle reset-prompt
  }

  zle -N my-run-help
  bindkey "^[^[h" run-help

so when I type in prompt something like "sudo adduser xxx" and want
interactive help on adduser I just press M-h

It was always working, however on my fresh Ubuntu install, I've got:

  adduser is /usr/sbin/adduser
  Missing filename ("less --help" for help)


I'v created simple widget like:

  just-run-man () {
      man man
  }
  zle -N just-run-man
  bindkey "^[^[h" just-run-man

And also got

  Missing filename ("less --help" for help)

What should I do to get desired behaviour?

I'm using zsh 5.0.2 (x86_64-pc-linux-gnu) under Ubuntu, my PAGER is less

thanks

-- 
lg

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

end of thread, other threads:[~2016-04-20  8:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-12 21:58 Calling interactive command inside widget Evgeny Zajcev
2016-04-13  8:41 ` Peter Stephenson
2016-04-13 17:55   ` Bart Schaefer
2016-04-16  8:21 ` frederik
2016-04-20  8:44 ` Sebastian Gniazdowski

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).