[vim/vim] `system()` call throws error on macOS when MacVim is launched by another process (SmartGit) (#6184)

69 views
Skip to first unread message

Hampus Liljekvist

unread,
Jun 2, 2020, 6:10:30 AM6/2/20
to vim/vim, Subscribed

Describe the bug
I'm having issues using MacVim as a difftool via SmartGit on macOS. When MacVim is launched by SmartGit for comparing files, the system() call used by various plugins stops working. Instead, an error message is output saying:

E484: Can't open file /var/folders/<number>/<random temp folder name generated by macOS>/T/<short hash generated by Vim?>/<number>

for example when I tried it with --clean just now:

E484: Can't open file /var/folders/43/dt48k_4j735_5ffkh7jv72f0hdq8j2/T/vfiKbls/0

Launching Vim manually, either via MacOS (GUI) or the terminal (zsh) does not seem to yield this issue, so I'm suspecting it's related to it being launched by an another process (SmartGit in this case).

When searching around for this error message I found some people mentioning that setting set shell=/bin/bash fixes it, although that has no effect in my case (and also seemed to be related to using the fish shell which I'm not using). Some plugins also seem to change this variable so I don't know how reliable that is.

To Reproduce
Detailed steps to reproduce the behavior:

  1. Configure MacVim as a difftool in SmartGit using /usr/local/bin/mvim with the arguments --clean -d ${leftFile} ${rightFile}
  2. Open a diff in the SmartGit GUI
  3. When MacVim launches, enter the command call system('ls') and notice the error above

Expected behavior
The system() call works on macOS regardless of which program opens Vim.

Environment (please complete the following information):

  • Vim version:
VIM - Vi IMproved 8.2 (2019 Dec 12, compiled May 26 2020 06:16:44)
macOS version
Included patches: 1-539
Compiled by Homebrew
  • OS: macOS 10.15.4
  • Terminal: Unknown (launched as diff tool via SmartGit), normally I use zsh
  • SmartGit version: 20.1.2 #15149, installed: #15128

Additional context
I'm unsure whether this is SmartGit-specific but I doubt it.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Yee Cheng Chin

unread,
Sep 16, 2020, 11:40:18 PM9/16/20
to vim/vim, Subscribed

@hlilje Please file MacVim bugs at https://github.com/macvim-dev/macvim/issues since they are not specific to core Vim. MacVim is a downstream fork of Vim and has specific code for handling OS integration.

Christian Brabandt

unread,
Sep 17, 2020, 2:41:57 AM9/17/20
to vim/vim, Subscribed

Closed #6184.

Christian Brabandt

unread,
Sep 17, 2020, 2:41:57 AM9/17/20
to vim/vim, Subscribed

closing then

Reply all
Reply to author
Forward
0 new messages