SublimeLinter: Path lookup failure due to slow shell startup

On my slightly older machine, and due to the inclusion of a few scripts (mainly related to virtual envs) in .bashrc, my bash doesn’t always start up that fast. However, the following code is in lint/utils.py:

    try:
        out, err = proc.communicate(timeout=1)
    except subprocess.TimeoutExpired:
        proc.kill()
        out = b''

causing a PATH failure lookup with the following error:

SublimeLinter: Could not parse shell PATH output: <empty>

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

@RR2DO2 My apologies, I didn’t have access to my computer when I made my comments earlier. It turns out we’re both right. Here’s the situation:

  • On Mac OS X, .profile/.bash_profile is run but .bashrc is never run unless bash is invoked with -i, which never happens in an ordinary Terminal window.
  • On Linux, .bashrc is run by default but .profile/.bash_profile is not unless the shell is a login shell, which by default it is not.

So, for an interactive shell:

  • On Mac OS X, .profile/.bash_profile must source .bashrc.
  • On Linux, .bashrc must source .profile/.bash_profile.

HOWEVER!!

You still don’t want stuff relating to interactive shells running in a non-interactive shell. So:

  • On Mac OS X, PATH stuff should be in .profile/.bash_profile, and source .bashrc in .profile/.bash_profile if it’s an interactive shell:

    # Set up PATH
    
    case $- in
        *i*) source ~/.bashrc;;
    esac
    
  • On Linux, PATH stuff should be in .profile/.bash_profile, and source that in .bashrc, which is only run when it’s a non-login shell.

I hope this makes it clearer. I’ll update the documentation with this info.