Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Calling interactive command inside widget
- X-seq: zsh-users 21448
- From: frederik@xxxxxxx
- To: Evgeny Zajcev <lg.zevlg@xxxxxxxxx>
- Subject: Re: Calling interactive command inside widget
- Date: Sat, 16 Apr 2016 01:21:21 -0700
- Cc: zsh-users@xxxxxxx
- In-reply-to: <CAO=W_Zqi0zSqMbDODTwFBs1tb_i2j=BJvSpk0S8xKbdqOR8Qfg@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAO=W_Zqi0zSqMbDODTwFBs1tb_i2j=BJvSpk0S8xKbdqOR8Qfg@mail.gmail.com>
- Reply-to: frederik@xxxxxxx
- Sender: <frederik@xxxxxxx>
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author