Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up environmental variables #77

Closed
thomaspaulmann opened this issue Nov 16, 2020 · 5 comments
Closed

Set up environmental variables #77

thomaspaulmann opened this issue Nov 16, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@thomaspaulmann
Copy link
Member

At the moment it isn't possible to set up custom environmental variables or load additional $PATH to the shell that executes script commands.

While you can specify to run scripts as login-shell (e.g. #!/bin/bash -l), this harms portability, usability and performance of script commands. It can also leak unrelated information into Raycast, which we want to avoid.

As agreed in our guidelines, we won't allow script commands that run in the login-shell in this repository. You can still use this option for your own setup. Instead, we will add preferences to allow injecting specific information, e.g. the PATH to your global node modules directory.

This is issue acts as reference for the additional preferences to set up environmental variables.

Created via Raycast

@unnamedd
Copy link
Collaborator

In agreement with Thomas, we don't need this issues opened any more, therefore, I'm closing it.

@MarcelBochtler
Copy link
Contributor

In agreement with Thomas, we don't need this issues opened any more, therefore, I'm closing it.

Can you elaborate why this is no longer required?
This issue has 14 upvotes as of now, and issues like #614 show that some tools require a specific $PATH, and users are confused if the scripts used by raycast use a different $PATH than the one used in the terminal.

@unnamedd
Copy link
Collaborator

Yes I can.
This issue is opened for more than a year and keep it opened here won't help / isn't helping much to improve the speed for a solution, after all the Raycast team has their internal backlog and they are working hard in things that has a bigger priority than this request here. When they implement a solution for problem described in this issue, they will announce in their proper channels.

As you also mentioned, there is the #614 with a nice discussion which I'm pretty sure they took in consideration, which to me, is another reason to not keep this issue opened.

And to finish my comment, there are other better ways to request changes/features in Raycast, two of those ways are: Raycast Slack Community or Send Feedback form (from inside of Raycast).

Hope to have your comprehension.

@MarcelBochtler
Copy link
Contributor

This issue is opened for more than a year and keep it opened here won't help / isn't helping much to improve the speed for a solution

Unfortunately, you're right about this.

As you also mentioned, there is the #614 with a nice discussion which I'm pretty sure they took in consideration, which to me, is another reason to not keep this issue opened.

#614 was closed because the root cause could be identified to be this issue mentioned here.
Closing the ticket and therefore reducing the visibility won't help to deal with future questions that come up caused by this issue.

@mreichelt
Copy link

mreichelt commented Mar 21, 2024

Just want to add our learning from today. We had a very tricky issue where a colleague had Android Studio not picking up the JAVA_HOME variable. After over 90min of debugging with two very experienced engineers, where we checked that all PATHs and shells etc. were set correctly, we found out that the issue was caused by launching Android Studio from Raycast.

If launched via Raycast, the JAVA_HOME variable was unset. But that's usually fine: Android Studio / IntelliJIDEA will run a shell and get the environment variables from there. That's where the second bit came in: even though the default shell was set as /bin/zsh everywhere, the SHELL variable provided by Raycast was /bin/sh.

Our current workaround: launch Android Studio from Finder/Spotlight instead of Raycast.

Just putting this here so affected Android / IntelliJ users can Google it and learn how to fix it :)

Two ideas how Raycast could help:

  1. Use the default shell to launch apps (or add an option to change shells)
  2. and/or: provide an option to launch apps with all default environment variables from the default shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants