0

When I am using vim-figitive it often shells out for commands like git push and so on.

Every time it opens a shell I see some leftovers from the previous session, something like:

Press ENTER or type command to continue

It sets me off every time because I can't figure out if this is the output from the current session or the previous one.

Is there a way to mark it with some sort of line every time I shell out from vim? Something like this in .zshrc would do it I think:

if [ -n $VIM ]; then
  echo "----------------------------------------------------------------------------------"
fi

Update It works when I run :sh, but not when I run commands from vim-fugitive. Is there is a way to intercept system() calls or whatever it is using?

firedev
  • 20,898
  • 20
  • 64
  • 94
  • Yes, subshells have a few Vim-specific environment variables set: `$VIM`, `VIMRUNTIME`, `$MYVIMRC` that you can use in your init script. – romainl Oct 10 '14 at 08:24
  • You could patch the plugin to use the shell in the way that you like. – DBedrenko Oct 10 '14 at 13:42

1 Answers1

0

From @tpope:

My recommendation would be to look into disabling the "alternate screen" for your terminal emulator (or terminal multiplexor). That's what I do.

Just add the following to tmux.conf

# tmux.conf
# For tmux , the alternate-screen option defaults to on
set-window-option -g alternate-screen off
firedev
  • 20,898
  • 20
  • 64
  • 94