wbond / sublime_terminal

Launch terminals from the current file or the root project folder
https://packagecontrol.io/packages/Terminal
MIT License
597 stars 117 forks source link

build system environment variables #194

Closed khevse closed 6 years ago

twolfson commented 6 years ago

Could you give us more context on the problem this is solving? I can only guess/assume so much =/

khevse commented 6 years ago

I'm a golang developer. I need to set up global variables $GOPATH, $GOBIN, $PATH relative to the project path. Also these are variables need for golang package manager.

Example: I need to install a new package. I open terminal and input command line:

go get <path to the github project>

golang package manager downloading project to the $GOPATH/src/github.com/..., make build and install project to the $GOBIN folder.

I added to the Terminal.sublime-settings (user file) this is content:


{
    "env": {
        "GOPATH": "${project_path:Default}:$GOPATH",
        "GOBIN": "${project_path:Default}/bin",
        "PATH": "${project_path:Default}/bin:$PATH"
    }
}

But these settings don't work in the current plugin version

twolfson commented 6 years ago

Okay, that makes sense. However, I think it's improperly using this repository. This is merely meant to open a terminal window -- not act as a command executor wrapper

If we wanted that, then we should use Sublime's built-in build system or a plugin which executes commands in a subshell

If we wanted this to be reusable in other projects, then we would embed that logic into our .bashrc or make it a command we run to enter the go context (either explicitly via setting or implicitly based on folder)

Additionally, there are support flaws here too -- some of our shells will open a new tab via the command but those never make their way back to the shell itself (e.g. iTerm2-v3.sh)

Going to close this as a wontfix =/