From: frederik@ofb.net
To: Evgeny Zajcev <lg.zevlg@gmail.com>
Cc: zsh-users@zsh.org
Subject: Re: Calling interactive command inside widget
Date: Sat, 16 Apr 2016 01:21:21 -0700 [thread overview]
Message-ID: <20160416082121.GA29385@ofb.net> (raw)
In-Reply-To: <CAO=W_Zqi0zSqMbDODTwFBs1tb_i2j=BJvSpk0S8xKbdqOR8Qfg@mail.gmail.com>
This is a bit tangential to your bug, but I don't know if you know
about various run-help-CMD helper functions:
http://stackoverflow.com/questions/32293262/how-to-make-zsh-run-help-to-ignore-sudo-and-get-help-about-the-following-com
I just learned about these a month ago.
Cheers,
Frederick
On Wed, Apr 13, 2016 at 12:58:04AM +0300, Evgeny Zajcev wrote:
> 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
next prev parent reply other threads:[~2016-04-16 8:21 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-12 21:58 Evgeny Zajcev
2016-04-13 8:41 ` Peter Stephenson
2016-04-13 17:55 ` Bart Schaefer
2016-04-16 8:21 ` frederik [this message]
2016-04-20 8:44 ` Sebastian Gniazdowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160416082121.GA29385@ofb.net \
--to=frederik@ofb.net \
--cc=lg.zevlg@gmail.com \
--cc=zsh-users@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).