v:shell_error is 1 starting gvim

50 views
Skip to first unread message

Ni Va

unread,
Oct 27, 2020, 5:08:23 AM10/27/20
to vim_use
Hi,

v:shell_error is 1 starting vim, how can I retrieve last shell command executed ?

It broke plugin such as tagbar.vim

Thank you
NiVa

Christian Brabandt

unread,
Oct 27, 2020, 5:13:16 AM10/27/20
to vim_use

On Di, 27 Okt 2020, Ni Va wrote:

> Hi,
>
> v:shell_error is 1 starting vim, how can I retrieve last shell command executed
> ?
>
> It broke plugin such as tagbar.vim

Set the verbose option to 4 and verbosefile to log the verbose messages
and check the resulting logfile for the shell commands executed.


Best,
Christian
--
Trinkt der Bauer und fährt Traktor, wird er zum Gefahrenfaktor.

Ni Va

unread,
Oct 27, 2020, 5:31:44 AM10/27/20
to vim_use
https://drive.google.com/file/d/1fBZbpvmtfVMg65NdGOcxPbV_4q_3G407/view?usp=sharing
Here is the log. until the end of _vimrc loading I see v:shell_error=0
Don't see where it pass to 1

Ni Va

unread,
Oct 27, 2020, 5:37:59 AM10/27/20
to vim_use
I got that output executing this command :

5verbose let out=system(expand('$vimruntime/ctags.exe --version') ) | put=out | put=v:shell_error

Universal Ctags 5.9.0(5d000b1a), Copyright (C) 2015 Universal Ctags Team
Universal Ctags is derived from Exuberant Ctags.
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert
  Compiled: Oct 26 2020, 01:20:04
  Optional compiled features: +win32, +wildcards, +regex, +internal-sort, +unix-path-separator, +iconv, +option-directory, +xpath, +json, +interactive, +yaml, +case-insensitive-filenames, +packcc
0  

Le mardi 27 octobre 2020 à 10:13:16 UTC+1, cbl...@256bit.org a écrit :

Ni Va

unread,
Oct 27, 2020, 10:14:05 AM10/27/20
to vim_use
Got this verbose report in level 4 just after opening tagbar.vim and try toggle tagbar.

sourcing "D:\Logiciels\Vim\vimfiles\plugged\tagbar\autoload\tagbar.vim"
filetype detection:ON  plugin:ON  indent:ON
finished sourcing D:\Logiciels\Vim\vimfiles\plugged\tagbar\autoload\tagbar.vim
line 1: sourcing "D:\Logiciels\Vim\vimfiles\plugged\tagbar\autoload\tagbar\debug.vim"
finished sourcing D:\Logiciels\Vim\vimfiles\plugged\tagbar\autoload\tagbar\debug.vim
continuing in <SNR>148_ToggleWindow
Tagbar: Ctags doesn't seem to be Exuberant Ctags!
BSD ctags will NOT WORK. Please download Exuberant Ctags from ctags.sourceforge.net and install it in a directory in your $PATH or set g:tagbar_ctags_bin.
Executed command: "D:\Logiciels\Vim\vim82\ctags.exe --version"
Command output:
Universal Ctags 5.9.0(5d000b1a), Copyright (C) 2015 Universal Ctags Team^M
Universal Ctags is derived from Exuberant Ctags.^M
Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert^M
  Compiled: Oct 26 2020, 01:20:04^M
  Optional compiled features: +win32, +wildcards, +regex, +internal-sort, +unix-path-separator, +iconv, +option-directory, +xpath, +json, +interactive, +yaml, +case-insensitive-filenames, +packcc^M
Exit code: 1                           >> v:shell_error                                 

Gary Johnson

unread,
Oct 27, 2020, 1:13:12 PM10/27/20
to vim_use
As the error message says, the tagbar plugin was written to use
Exuberant Ctags and will not work with BSD ctags. The author tries
to verify that the required version of ctags is being used by
executing "ctags --version". The problem is that tagbar does not
recognize the Universal Ctags you are using, which is an improved
and supported derivative of Exuberant Ctags.

Universal Ctags should work as well if not better than Exuberant
Ctags. There is one irritating incompatibility between the two:
the author of Universal Ctags changed the spelling of the "--extra"
option "--extras". A plugin that uses that option but knows the
ctags version can work around that.

I think the best solution here is to modify tagbar.vim, either
yourself or by contacting the author, so that it accepts Universal
Ctags as well as Exuberant Ctags.

You could install Exuberant Ctags and make sure it is earlier in
your PATH than Universal Ctags, but since the former is unsupported
and not as capable, I wouldn't recommend that.

Regards,
Gary

Ni Va

unread,
Oct 27, 2020, 2:26:16 PM10/27/20
to vim_use

Hi Gary and thank you for your answer.

I have a different approach to the problem.

Looking at the code of the script tagbar.vim version 2.7, line 640 if v:shell_error ctags_output! Universal) Ctags'?
 I note that the author as elsewhere written in the help of tagbar, seeks to see if it is either Exuberant or Universal Ctags. So the two executables are compatible. 

And after a few tests I note that my problem comes from the condition v:shell_error which ends up at 1 for a reason unknown to me ... or at least I think it comes from one of my plugins:=>  because when I launch Vim with the option -u NONE, this variable is at 0

So I'm still in investigation. Thank you  

Ni Va

unread,
Oct 27, 2020, 3:20:40 PM10/27/20
to vim_use

Solved, after bisecting all plugins, I found in one of mine this instruction which return bad shell error:
"   let g:Explorer_RubyLibPath=substitute(fnamemodify(system('which '.g:Explorer_RubyLibName),":p"),':..',':',"")



Now tagbar works as it did with Universal Ctags, see:


Reply all
Reply to author
Forward
0 new messages