Visitar URL original
Read interactive shell ENV on *nix systems · Issue #1795 · SublimeLinter/SublimeLinter · GitHub
Skip to content

Read interactive shell ENV on *nix systems #1795

Open

Description

@kaste

A recurring problem for *nix users is that the process environment Sublime runs in does not have everything set up as users think. Typically, for example nvm users see a different ENV per working dir.

Try to solve this and read a interactive bash shell to read the env in. Don't modify the global python env like #1509 did, instead read it keyed per working_dir and probably use the existing get_environment() to "distribute".

Related art: https://github.com/codexns/shellenv https://github.com/golang/sublime-config

For this to be of any use, refactor our which infrastructure to just use self.which with the enhanced PATH. Finally remove the global paths setting which is conceptually wrong anyway.

Activity

  1. tribals commented on Apr 27, 2023

    @tribals

    Possible solution would be to add dependency on a shellenv "Package Control dependency":

    Usage

    To have a package require shellenv, add a file named dependencies.json into
    the root folder of your Sublime Text package, and add the following:

    {
        "*": {
            "*": [
                "shellenv"
            ]
        }
    }

    This indicates that for all operating systems (*), and all versions of
    Sublime Text (nested *), require the shellenv dependency. You can also read
    the
    official documentation about dependencies.

    Examples

    The output of get_env() may be useful when launching a subprocess:

    import subprocess
    import shellenv
    
    _, env = shellenv.get_env(for_subprocess=True)
    proc = subprocess.Popen(['executable', '-arg'], env=env)

    Reference: https://github.com/codexns/shellenv#usage

  2. tribals commented on Apr 27, 2023

    @tribals

    See #1900.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions