On a multiuser environment, I added the ‘ps -fu’ bit to detect a gvim session, slightly more fool-resistant than just checking the result code of the –remote-send call.
My remotesplit:
ps -fu $LOGNAME | grep -v grep | grep gvim 2>/dev/null
if [ $? -ne 0 ]
then
gvim $*
else
gvim –remote-send “<ESC>:sp $CSCOPE_ROOT/$2<CR>:0<CR>:$1<CR>:-1<CR>” 2>/dev/null
fi