-
Notifications
You must be signed in to change notification settings - Fork 24
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
Does not work on IntelliJ IDEA 2020.2.3 (Ultimate Edition) #3
Comments
Created a new maven project, included a sample |
I just did the same (maven and gradle probably also others) and could reproduce the issue. As a workaround I I will add some debug output to the plugin. |
Do you mean in the terminal inside of intellij? I ran the allow command inside the of that terminal as well as inside of an external terminal, and still could not get it to work. Would be glad to provide any /all debug logs. Please let me know! ;) |
I think it does not matter which terminal you execute direnv in as long as it does not give any error. I am currently experiencing the same with Android Studio 4.2 Canary 16. Strange enough the plugin does work when launching AS during plugin development but not when running standalone... Could you please
Thank you! |
Wow, it seems only I can see draft releases... |
idea.log |
Thank you.
How do you call direnv in a terminal? What does I should disable the button if it is not available. |
I get this |
I want to detect if direnv is installed but this is only possible by looking for the executable in intellij-direnv/src/main/kotlin/systems/fehn/intellijdirenv/services/DirenvService.kt Lines 15 to 19 in 0ca8ba8
The result is an absolute path and is used to call direnv. Could you please post your Please test also this version which skips all tests whether direnv is available and just calls |
So this is what I got from the logs: ls -la /usr/local/bin/direnv |
OK, will have to spin up my MacBook to test this further. |
I didn't manage to set up my MacBook but could you please test this version: Direnv integration-0.1.0.zip This is probably due to a mismatch of environment variables between the shell and GUI programs on Mac. |
Yup, I think you are right ...
I can still access Perhaps try to hardcode this path in case you cannot find |
So, this is something like your personal build. It does not check whether direnv is available but calls Please, report back and post the log again. |
So seems like direnv works now, however ... my custom env var is still not showing up. I have this in my
|
In the logs I see multiple of these lines:
So the plugin does work now. Thank you very much for this debugging odyssey. I will soon release an update that should solve this issue for everyone. Probably you are hit by the same problem as me. The JetBrains guys wrote: /**
* <p>A wrapper layer around {@link System#getenv()}.</p>
*
* <p>On Windows, the returned map is case-insensitive (i.e. {@code map.get("Path") == map.get("PATH")} holds).</p>
*
* <p>On macOS, things are complicated.<br/>
* An app launched by a GUI launcher (Finder, Dock, Spotlight etc.) receives a pretty empty and useless environment,
* since standard Unix ways of setting variables via e.g. ~/.profile do not work. What's more important, there are no
* sane alternatives. This causes a lot of user complaints about tools working in a terminal not working when launched
* from the IDE. To ease their pain, the IDE loads a shell environment (see {@link #getShellEnv()} for gory details)
* and returns it as the result.<br/>
* And one more thing (c): locale variables on macOS are usually set by a terminal app - meaning they are missing
* even from a shell environment above. This again causes user complaints about tools being unable to output anything
* outside ASCII range when launched from the IDE. Resolved by adding LC_CTYPE variable to the map if it doesn't contain
* explicitly set locale variables (LANG/LC_ALL/LC_CTYPE). See {@link #setCharsetVar(Map)} for details.</p>
*
* @return unmodifiable map of the process environment.
*/ See also e.g. this issue: flutter/flutter-intellij#601 (comment) I guess when you run your code from the shell it should work (but of course, this plugin won't run then. So this can only work if you configured your shell to import from the I'm closing this issue as the second problem is not related to this plugin. |
Glad I could help! |
Honestly, I think it depends on which environment IntelliJ is passing to gradle/the You could compare the output of your app with the environment inside your shell ( |
I have the same problem as @yarco, and on MacOS, it means this plugin is sadly not compatible at all? Potentially an issue could be opened to Jetbrains to potentially find a solution, no? |
Details:
Build #IU-202.7660.26, built on October 6, 2020
Runtime version: 11.0.8+10-b944.34 x86_64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Trying to run a Java (Gradle) application using Run.. -> Application
env vars do not show up when running as well as when debugging.
Pressed the button a million times to no avail.
Would be happy to provide more info if needed. Please let me know.
Thanks for creating such a cool plugin!!!
The text was updated successfully, but these errors were encountered: