Describe the bug
:make does not appear to set v:shell_error as other external commands do.
To Reproduce
$ cat test.vim
set makeprg=exit\ 1
silent make
call assert_equal(1, v:shell_error)
set formatprg=exit\ 1
normal! gqip
call assert_equal(1, v:shell_error)
set equalprg=exit\ 1
normal! ==
call assert_equal(1, v:shell_error)
silent !exit 1
call assert_equal(1, v:shell_error)
echo v:errors
$ vim --clean -S test.vim
['/private/tmp/test.vim line 3: Expected 1 but got 0']
Expected behavior
I would expect the exit code of whatever makeprg returns when invoked via :make to set v:shell_error accordingly.
Environment (please complete the following information):
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 26 2020 11:57:03)
macOS version
Included patches: 1-640
Compiled by gbr...@lappy.local
Huge version without GUI. Features included (+) or not (-):
+acl -farsi +mouse_sgr +tag_binary
+arabic +file_in_path -mouse_sysmouse -tag_old_static
+autocmd +find_in_path +mouse_urxvt -tag_any_white
+autochdir +float +mouse_xterm -tcl
-autoservername +folding +multi_byte +termguicolors
-balloon_eval -footer +multi_lang +terminal
+balloon_eval_term +fork() -mzscheme +terminfo
-browse +gettext +netbeans_intg +termresponse
++builtin_terms -hangul_input +num64 +textobjects
+byte_offset +iconv +packages +textprop
+channel +insert_expand +path_extra +timers
+cindent +ipv6 -perl +title
-clientserver +job +persistent_undo -toolbar
+clipboard +jumplist +popupwin +user_commands
+cmdline_compl +keymap +postscript +vartabs
+cmdline_hist +lambda +printer +vertsplit
+cmdline_info +langmap +profile +virtualedit
+comments +libcall -python +visual
+conceal +linebreak -python3 +visualextra
+cryptv +lispindent +quickfix +viminfo
-cscope +listcmds +reltime +vreplace
+cursorbind +localmap +rightleft +wildignore
+cursorshape -lua -ruby +wildmenu
+dialog_con +menu +scrollbind +windows
+diff +mksession +signs +writebackup
+digraphs +modify_fname +smartindent -X11
-dnd +mouse -sound -xfontset
-ebcdic -mouseshape +spell -xim
+emacs_tags +mouse_dec +startuptime -xpm
+eval -mouse_gpm +statusline -xsmp
+ex_extra -mouse_jsbterm -sun_workshop -xterm_clipboard
+extra_search +mouse_netterm +syntax -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
2nd user vimrc file: "~/.vim/vimrc"
user exrc file: "$HOME/.exrc"
defaults file: "$VIMRUNTIME/defaults.vim"
fall-back for $VIM: "/Users/gbrown/local/vim/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DMACOS_X -DMACOS_X_DARWIN -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc -L/usr/local/lib -o vim -lm -lncurses -liconv -lintl -framework AppKit
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Works fine for me. What is the command that actually gets executed?
It should be something like ":!exit 1 |& tee /tmp/vt42YzR/6"
Perhaps your "tee" command does not pass on the exit value
Works fine for me. What is the command that actually gets executed?
It should be something like ":!exit 1 |& tee /tmp/vt42YzR/6"
It is indeed.
Perhaps your "tee" command does not pass on the exit value
I'm not sure what's meant by this? So far as I'm aware the only way to do this is with something like bash's set -o pipefail. I've tried doing using this and I v:shell_error is still 0 for me.
I've made things by tweaking shellpipe and makeef along with a bit of scripting.
When opening this I wanted my initial report to be high level. But getting into the implementation does Vim have to rely on tee? I.E. when invoking :make could Vim not read and print the errorfile itself? This would avoid relying on shell features (which may not be portable).
This may also alleviate the need to include a copy of tee in Vim's source for Windows systems.
—
You are receiving this because you commented.
Closing this as I've made things work for me.
—
You are receiving this because you commented.