Loading ...
Sorry, an error occurred while loading the content.

Re: .bash_profile sourced when mvim is invoked

Expand Messages
  • J Irving
    Hi Ben Thanks for your response and explanation of bash s startup behaviour. It is, I agree, braindead. However, I m determined to stick with this for a while,
    Message 1 of 3 , Jun 30, 2011
    • 0 Attachment
      Hi Ben

      Thanks for your response and explanation of bash's startup behaviour.
      It is, I agree, braindead. However, I'm determined to stick with this
      for a while, rather than running back to zsh as normally happens...

      On Jun 27, 9:41 pm, Ben Schmidt <mail_ben_schm...@...> wrote:
      > MacVim starts a login shell when it spawns Vim processes, because that's
      > what most users expect, and what Terminal.app does when you open a new
      > window. The shell MacVim spawns is non-interactive, though, not
      > interactive, of course. However, it results in ~/.profile or
      > ~/.bash_profile being sourced.
      >
      > What a lot of people do is have ~/.profile or ~/.bash_profile do things
      > they want in all login shells, and have that *also* source ~/.bashrc to
      > do things they want only in interactive shells. Something like this:
      >
      > if echo $- | grep -q i ; then
      >    [ -r ~/.bashrc ] && source ~/.bashrc
      > fi

      This works. Thanks for your help.

      > Getting ssh logins to do something sane is another nightmare. I have
      > code for that if anyone is interested, as well as more extensive code to
      > integrate the same kind of behaviour system-wide using /etc/profile and
      > so on. Just let me know if you want a copy and I will gather it together
      > and send.

      That would be useful, thanks. No hurry though, I don't have a problem
      this would solve (yet).

      > Hope this helps!

      Very much.

      cheers, J

      --
      You received this message from the "vim_mac" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    Your message has been successfully submitted and would be delivered to recipients shortly.