Coder Social home page Coder Social logo

Use env option about terminus HOT 10 OPEN

randy3k avatar randy3k commented on July 17, 2024
Use env option

from terminus.

Comments (10)

randy3k avatar randy3k commented on July 17, 2024

What shell are you using? A better solution is to specify the path in your shell.

from terminus.

gepd avatar gepd commented on July 17, 2024

I'm using cmd but I need a solution not os dependent. I want to include your package in my plugin Deviot but In some cases I need to modify the env, so I need a solution to be configured by the plugin it self, not by the user. My idea was to use the shell_configs option of your plugin, do you think there is another way to achieve that?

from terminus.

randy3k avatar randy3k commented on July 17, 2024

Is this what you want?

path = new_path + ":" + old_path
window.run_command("terminus_open", {"cmd": "whatever", "env": {"PATH": path }})

However, the PATH variable only makes sense in Unix system.

from terminus.

gepd avatar gepd commented on July 17, 2024

However, the PATH variable only makes sense in Unix system.

Why would be that?

With your command I got the results I do expected, however what would be the best way to get the cmd used by the os, I mean in windows is cmd.exe in unix system the bash, there is a way to let your plugin decide this and only modify the PATH?

from terminus.

randy3k avatar randy3k commented on July 17, 2024

Ai, actually Windows also uses PATH. But there are 2 issues.

  1. Windows uses ; to separate paths instead of :

  2. A more important issue is to support WSL. So it means you need to also define WSLENV it seems that the PATH variable is passed automatically.

from terminus.

gepd avatar gepd commented on July 17, 2024
  1. I've been dealing with it using os.pathsep (link) when I've need it
  2. you mean by ST?

Cause your last command worked but I only wish to avoid manually "select" the cmd

from terminus.

randy3k avatar randy3k commented on July 17, 2024

os.pathsep is a better solution. I meant from cmd.exe to wsl.exe.

from terminus.

gepd avatar gepd commented on July 17, 2024

It works with cmd.exe but not with wsl.exe, I've just checked it

from terminus.

gepd avatar gepd commented on July 17, 2024

I've checked again and it's working with wsl.exe too

After output the wsl paths with echo $PATH I realized that my paths were there, so I guess shouldn't be a problem using the env feature

from terminus.

randy3k avatar randy3k commented on July 17, 2024

Ya, it was also what I have figaured out.

from terminus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.