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

IntelliJ detection misfires if the program has a command line containing the word "idea" #72

Closed
mikehearn opened this issue Oct 12, 2022 · 3 comments · Fixed by #73
Closed

Comments

@mikehearn
Copy link
Contributor

This line in TerminalDetection.kt:

getJavaProperty("sun.java.command")?.contains("idea", ignoreCase = true) == true

will cause terminal corruption if you run a program with the word "idea" anywhere in the command line arguments. (yup, debugging this one was fun 😆 ). I filed JetBrains/jediterm#253 to request a specific env var to be set, but for now, the sun.java.command check should probably be removed. The others look fairly specific but this one is too broad and will cause obscure bugs for any tool that is used on files in the default IntelliJ project directory (e.g. ~/IdeaProjects).

@ajalt
Copy link
Owner

ajalt commented Oct 12, 2022

Hm. That check is the only one that works on recent versions of IntelliJ, but I don't think we need to need to remove that check entirely. We could make it more specific by just looking at the binary name rather then the full path. I think it's unlikely that anyone will name their commands idea64.exe, for example.

@mikehearn
Copy link
Contributor Author

I think the issue is that sun.java.command contains the CLI arguments, and sometimes not even the program name at all. IIRC this property is what gets printed by jps -v and what I see is that the IDEA processes don't actually even have a program name, just the flags, and others use the main class name as the binary name.

@ajalt
Copy link
Owner

ajalt commented Oct 16, 2022

Ok, I went ahead and removed that check. Thanks for tracking the problem down!

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

Successfully merging a pull request may close this issue.

2 participants