New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MANPAGER="env MAN_PN=1 nvim -M +MANPAGER -" doesn't work with man cd #1002

Open
edi9999 opened this Issue Aug 23, 2016 · 15 comments

Comments

Projects
None yet
6 participants
@edi9999

edi9999 commented Aug 23, 2016

Runned command :

export MANPAGER="env MAN_PN=1 vim -M +MANPAGER -" ; man cd

expected result :

see the manual of cd

actual result:

Cannot find a 'bash_builtins'.
Press ENTER or type command to continue

It works fine with non bash_builtins, for example man sort

Pressing ENTER brings you to the standard vim first screen.

My :version :

:version
VIM - Vi IMproved 7.4 (2013 Aug 10, compiled Jun  2 2016 10:02:17)
Included patches: 1-1868
Modified by <bugzilla@redhat.com>
Compiled by <bugzilla@redhat.com>
Huge version without GUI.  Features included (+) or not (-):
+acl             +cmdline_compl   +digraphs        +folding         +libcall         +mouse_dec       +netbeans_intg   +reltime         +tag_old_static  +vertsplit       -xfontset
+arabic          +cmdline_hist    -dnd             -footer          +linebreak       +mouse_gpm       +packages        +rightleft       -tag_any_white   +virtualedit     -xim
+autocmd         +cmdline_info    -ebcdic          +fork()          +lispindent      -mouse_jsbterm   +path_extra      +ruby/dyn        -tcl             +visual          -xsmp
-balloon_eval    +comments        +emacs_tags      +gettext         +listcmds        +mouse_netterm   +perl/dyn        +scrollbind      +termguicolors   +visualextra     -xterm_clipboard
-browse          +conceal         +eval            -hangul_input    +localmap        +mouse_sgr       +persistent_undo +signs           +terminfo        +viminfo         -xterm_save
++builtin_terms  +cryptv          +ex_extra        +iconv           +lua/dyn         -mouse_sysmouse  +postscript      +smartindent     +termresponse    +vreplace        -xpm
+byte_offset     +cscope          +extra_search    +insert_expand   +menu            +mouse_urxvt     +printer         +startuptime     +textobjects     +wildignore
+channel         +cursorbind      +farsi           +job             +mksession       +mouse_xterm     +profile         +statusline      +timers          +wildmenu
+cindent         +cursorshape     +file_in_path    +jumplist        +modify_fname    +multi_byte      +python/dyn      -sun_workshop    +title           +windows
-clientserver    +dialog_con      +find_in_path    +keymap          +mouse           +multi_lang      +python3/dyn     +syntax          -toolbar         +writebackup
-clipboard       +diff            +float           +langmap         -mouseshape      -mzscheme        +quickfix        +tag_binary      +user_commands   -X11
   system vimrc file: "/etc/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  fall-back for $VIM: "/etc"
 f-b for $VIMRUNTIME: "/usr/share/vim/vim74"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H     -O2 -g -pipe -Wall -Werror=format-security -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/u
sr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,--enable-new-dtags -Wl,-z,relro   -Wl,-z,relro -specs=/usr/l
ib/rpm/redhat/redhat-hardened-ld -L/usr/local/lib -Wl,--as-needed -o vim        -lm -lnsl  -lselinux   -lncurses -lacl -lattr -lgpm -ldl   -Wl,--enable-new-dtags -Wl,-z,relro  -Wl,-z,relro
-fstack-protector-strong -L/usr/local/lib  -L/usr/lib64/perl5/CORE -lperl -lpthread -lresolv -lnsl -ldl -lm -lcrypt -lutil -lc
@chrisbra

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Aug 23, 2016

Member

did you use vim or nvim?

Member

chrisbra commented Aug 23, 2016

did you use vim or nvim?

@edi9999

This comment has been minimized.

Show comment
Hide comment
@edi9999

edi9999 Aug 23, 2016

I used vim, sorry, my post was confusing (I edited it)

In neovim, the problem also appears, but my question is for vim.

edi9999 commented Aug 23, 2016

I used vim, sorry, my post was confusing (I edited it)

In neovim, the problem also appears, but my question is for vim.

@edi9999

This comment has been minimized.

Show comment
Hide comment
@edi9999

edi9999 Aug 23, 2016

I'm running the command inside bash, if that can have an influence

bash --version
GNU bash, version 4.3.42(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

edi9999 commented Aug 23, 2016

I'm running the command inside bash, if that can have an influence

bash --version
GNU bash, version 4.3.42(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
@edi9999

This comment has been minimized.

Show comment
Hide comment
@edi9999

edi9999 Aug 23, 2016

I have the same "issue" with other non standard commands, for example :

aws help s3-config

gives, inside vim :

Vim: Reading from stdin...

Cannot find a 'aws'.

edi9999 commented Aug 23, 2016

I have the same "issue" with other non standard commands, for example :

aws help s3-config

gives, inside vim :

Vim: Reading from stdin...

Cannot find a 'aws'.
@chrisbra

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Aug 23, 2016

Member

looks like your shell is not correctly setup. What are the various shell options?

Member

chrisbra commented Aug 23, 2016

looks like your shell is not correctly setup. What are the various shell options?

@edi9999

This comment has been minimized.

Show comment
Hide comment
@edi9999

edi9999 Aug 23, 2016

What do you mean by shell options ? shopt ??

In case you meant shopt, here are my settings :

autocd          off
cdable_vars     off
cdspell         off
checkhash       off
checkjobs       off
checkwinsize    off
cmdhist         on
compat31        off
compat32        off
compat40        off
compat41        off
compat42        off
complete_fullquote  on
direxpand       off
dirspell        off
dotglob         off
execfail        off
expand_aliases  on
extdebug        off
extglob         on
extquote        on
failglob        off
force_fignore   on
globstar        off
globasciiranges off
gnu_errfmt      off
histappend      on
histreedit      off
histverify      off
hostcomplete    off
huponexit       off
interactive_comments    on
lastpipe        off
lithist         off
login_shell     on
mailwarn        off
no_empty_cmd_completion off
nocaseglob      off
nocasematch     off
nullglob        off
progcomp        on
promptvars      on
restricted_shell    off
shift_verbose   off
sourcepath      on
xpg_echo        off

edi9999 commented Aug 23, 2016

What do you mean by shell options ? shopt ??

In case you meant shopt, here are my settings :

autocd          off
cdable_vars     off
cdspell         off
checkhash       off
checkjobs       off
checkwinsize    off
cmdhist         on
compat31        off
compat32        off
compat40        off
compat41        off
compat42        off
complete_fullquote  on
direxpand       off
dirspell        off
dotglob         off
execfail        off
expand_aliases  on
extdebug        off
extglob         on
extquote        on
failglob        off
force_fignore   on
globstar        off
globasciiranges off
gnu_errfmt      off
histappend      on
histreedit      off
histverify      off
hostcomplete    off
huponexit       off
interactive_comments    on
lastpipe        off
lithist         off
login_shell     on
mailwarn        off
no_empty_cmd_completion off
nocaseglob      off
nocasematch     off
nullglob        off
progcomp        on
promptvars      on
restricted_shell    off
shift_verbose   off
sourcepath      on
xpg_echo        off
@edi9999

This comment has been minimized.

Show comment
Hide comment
@edi9999

edi9999 Aug 23, 2016

Even if I empty my .bashrc, I still get the same error.

edi9999 commented Aug 23, 2016

Even if I empty my .bashrc, I still get the same error.

@edi9999

This comment has been minimized.

Show comment
Hide comment
@edi9999

edi9999 Aug 23, 2016

If I just do : export MANPAGER="vim -M +MANPAGER -" ; man cd, it works fine

So it seems that env MAN_PN=1 is the cause of the error

edi9999 commented Aug 23, 2016

If I just do : export MANPAGER="vim -M +MANPAGER -" ; man cd, it works fine

So it seems that env MAN_PN=1 is the cause of the error

@chrisbra

This comment has been minimized.

Show comment
Hide comment
@chrisbra

chrisbra Aug 23, 2016

Member

no I meant the various Vim options that start with shell

Member

chrisbra commented Aug 23, 2016

no I meant the various Vim options that start with shell

@edi9999

This comment has been minimized.

Show comment
Hide comment
@edi9999

edi9999 Aug 24, 2016

I still don't understand what you're talking about ...

export MANPAGER="vim -M +MANPAGER -"

so the vim options are -M +MANPAGER -

I have also tried to empty my .vimrc and it doesn't change anything

edi9999 commented Aug 24, 2016

I still don't understand what you're talking about ...

export MANPAGER="vim -M +MANPAGER -"

so the vim options are -M +MANPAGER -

I have also tried to empty my .vimrc and it doesn't change anything

@Grimy

This comment has been minimized.

Show comment
Hide comment
@Grimy

Grimy Sep 5, 2016

Try running the following command in Vim and post the results:

:set shell? shellcmdflag? shellpipe? shellquote? shellredir? shelltemp? shellxquote? shellxescape?

Grimy commented Sep 5, 2016

Try running the following command in Vim and post the results:

:set shell? shellcmdflag? shellpipe? shellquote? shellredir? shelltemp? shellxquote? shellxescape?
@edi9999

This comment has been minimized.

Show comment
Hide comment
@edi9999

edi9999 Sep 5, 2016

  shell=/bin/bash
  shellcmdflag=-c
  shellpipe=2>&1| tee
  shellquote=
  shellredir=>%s 2>&1
  shelltemp
  shellxquote=
  shellxescape=

edi9999 commented Sep 5, 2016

  shell=/bin/bash
  shellcmdflag=-c
  shellpipe=2>&1| tee
  shellquote=
  shellredir=>%s 2>&1
  shelltemp
  shellxquote=
  shellxescape=
@lambdalisue

This comment has been minimized.

Show comment
Hide comment
@lambdalisue

lambdalisue Sep 5, 2016

In case if my implementation works for you: https://github.com/lambdalisue/vim-manpager

lambdalisue commented Sep 5, 2016

In case if my implementation works for you: https://github.com/lambdalisue/vim-manpager

@edi9999

This comment has been minimized.

Show comment
Hide comment
@edi9999

edi9999 Sep 6, 2016

It indeed does

edi9999 commented Sep 6, 2016

It indeed does

@Konfekt

This comment has been minimized.

Show comment
Hide comment
@Konfekt

Konfekt Sep 6, 2016

Please see the message from the 1st of september at the vim_dev mailing list:

Mysteriously, the $MANPATH was empty when vim was called as manpager and caused the
issue of this thread. Setting

export MANPAGER="env MANPATH=${MANPATH} vim -RM +MANPAGER -"

worked around it.

Also,

export MANPAGER="env LANGUAGE=${LANG} $vim -RM +MANPAGER -"

ensures that the manpages are displayed in the user's preferred language.

Thus the question: Should the documentation :help manpager recommend setting

export MANPAGER="env MAN_PN=1 MANPATH=${MANPATH} LANGUAGE=${LANG} vim -RM +MANPAGER -"

(instead of export MANPAGER="env MAN_PN=1 vim -RM +MANPAGER -") ?

Konfekt commented Sep 6, 2016

Please see the message from the 1st of september at the vim_dev mailing list:

Mysteriously, the $MANPATH was empty when vim was called as manpager and caused the
issue of this thread. Setting

export MANPAGER="env MANPATH=${MANPATH} vim -RM +MANPAGER -"

worked around it.

Also,

export MANPAGER="env LANGUAGE=${LANG} $vim -RM +MANPAGER -"

ensures that the manpages are displayed in the user's preferred language.

Thus the question: Should the documentation :help manpager recommend setting

export MANPAGER="env MAN_PN=1 MANPATH=${MANPATH} LANGUAGE=${LANG} vim -RM +MANPAGER -"

(instead of export MANPAGER="env MAN_PN=1 vim -RM +MANPAGER -") ?

@k-takata k-takata added the runtime label Oct 12, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment