Bundled vim in Mac OS X 10.5 and Exit code

449 views
Skip to first unread message

Jjgod Jiang

unread,
Nov 3, 2007, 5:43:26 AM11/3/07
to vim mac
Hi,

I seemed to have an issue running the bundled vim (/usr/bin/vim), for
example:

$ /usr/bin/vim
...
:w foo.txt
:q

$ echo $?
1

But if I use vim built by myself:

$ /Applications/Vim.app/Contents/MacOS/Vim
...
:w bar.txt
:q

$ echo $?
0

This will cause a problem when I use EDITOR=vim for most VCS,
because they use exit code of editor to determinate whether a commit
message is successfully written.

Do some one else occur to have the same problem?

- Jiang

Rainer Schmid

unread,
Nov 3, 2007, 6:21:36 AM11/3/07
to vim...@googlegroups.com
Hi,

> I seemed to have an issue running the bundled vim (/usr/bin/vim), for
> example:

This is on Leopard? Then I had the same (or a similar problem). I
solved the problem by updating the a.vim plugin to the latest version.
I basically did a binary search by deleting my .vimrc and files in
.vim to find which plugin/configuration filed caused the problem.

Rainer

george...@googlemail.com

unread,
Nov 4, 2007, 3:40:54 AM11/4/07
to vim_mac
Me too though when I thought I'd got it finally, it still caused me
issues if I launched vi.

I set EDITOR to vim and kept the fixes that made that work.

George

Bram Moolenaar

unread,
Nov 4, 2007, 12:02:33 PM11/4/07
to Jjgod Jiang, vim mac

Jjgod Jiang wrote:

Vim returns a non-zero exit code when there was any error while editing.
This is because of Posix compatibility. However, this should only
happen when in Ex mode, thus using "vim -e" or after "Q". It's unclear
why it would happen when starting vim and using ":q" from Normal mode.
I can't reproduce it.

--
hundred-and-one symptoms of being an internet addict:
86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

jrray

unread,
Apr 19, 2009, 1:39:58 AM4/19/09
to Bram Moolenaar, vim...@googlegroups.com

This happens to me on 10.5.6 (vim 7.2.22).

Running "vim", searching for a non-existent string "/asdf<CR>", then
quitting ":q<CR>" will produce an exit code of 1.

For some reason this only happens when I run "vim", and not "/usr/bin/
vim".

Here's a shell log of me doing the above steps with the two different
process names:

octopus:~ jrray$ vim || echo failed
failed
octopus:~ jrray$ /usr/bin/vim || echo failed
octopus:~ jrray$ which vim
/usr/bin/vim

This continues to happen after I move my ~/.vim dir and ~/.vimrc file
out of the way.

Yongwei Wu

unread,
Apr 21, 2009, 9:50:10 AM4/21/09
to vim...@googlegroups.com, Bram Moolenaar
2009/4/19 jrray <jrobe...@gmail.com>:

>> Vim returns a non-zero exit code when there was any error while editing.
>> This is because of Posix compatibility.  However, this should only
>> happen when in Ex mode, thus using "vim -e" or after "Q".  It's unclear
>> why it would happen when starting vim and using ":q" from Normal mode.
>> I can't reproduce it.
>
> This happens to me on 10.5.6 (vim 7.2.22).
>
> Running "vim", searching for a non-existent string "/asdf<CR>", then
> quitting ":q<CR>" will produce an exit code of 1.
>
> For some reason this only happens when I run "vim", and not "/usr/bin/
> vim".
>
> Here's a shell log of me doing the above steps with the two different
> process names:
>
> octopus:~ jrray$ vim || echo failed
> failed
> octopus:~ jrray$ /usr/bin/vim || echo failed
> octopus:~ jrray$ which vim
> /usr/bin/vim
>
> This continues to happen after I move my ~/.vim dir and ~/.vimrc file
> out of the way.

Interesting. Thanks for find that out. Now I see why my "svn commit"
always has this strange failure. It seems I can at least use "export
EDITOR=/usr/bin/vim" as a workaround, before the root cause is
identified.

--
Wu Yongwei
URL: http://wyw.dcweb.cn/

Reply all
Reply to author
Forward
0 new messages