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

Unable to open file or directory from terminal #11

Closed
jwogrady opened this issue Nov 14, 2016 · 18 comments
Closed

Unable to open file or directory from terminal #11

jwogrady opened this issue Nov 14, 2016 · 18 comments
Labels
bug report 🐛 Something isn't working macOS 🍏 A macOS bug is loose. possibly fixed
Milestone

Comments

@jwogrady
Copy link

Thanks for all your work on this....

I'm unable to open a file or folder from a termination shell.

projects $ atom .
LSOpenURLsWithRole() failed for the application /Applications/Atom.app with error -10810.
projects $ atom README.md
LSOpenURLsWithRole() failed for the application /Applications/Atom.app with error -10810.

Everything works as expected if I run the commands outside of Atom in a standalone shell.

Using

  • macOS Sierra v 10.12.1
  • Atom 1.12.2
  • termination 0.3.2
@Fred-Barclay
Copy link
Collaborator

Hmmm... I see that too in Linux. I'll investigate it - thanks!

For reference, this is the Linux output:

$ atom /home/fred/Git/Astro/lunar_phase.py
$ /usr/share/atom/atom: bad option: --executed-from=/home/fred/Git/Astro
/usr/share/atom/atom: bad option: --pid=25889

@Fred-Barclay Fred-Barclay added the bug report 🐛 Something isn't working label Nov 14, 2016
@Fred-Barclay
Copy link
Collaborator

Fred-Barclay commented Nov 14, 2016

@jwogrady Can you see if the same behavior occurs with platformio-ide-terminal? That will help narrow down the search a lot.
If it is occurring with platformio-ide-terminal, could you open an issue on their page as well (but don't close this one!). They know their code the best, and while I'll definitely keep trying to track this down it would help to have another set of eyes looking at the problem. If they fix it before I do then I'll integrate the changes back here.

It's something to do with node being called instead of atom from inside termination. Compare atom --version from inside termination to what you see from a standalone shell and you'll see what I mean. 😄

Cheers!

@chrisallenmoore
Copy link

chrisallenmoore commented Nov 18, 2016

I'm getting the same error as @jwogrady. What's interesting is that I had a Java update right before I had this problem. Could the two be related?

Here is the java version i'm at now.

$ java -version
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
$ atom --version
Atom    : 1.12.3
Electron: 1.3.6
Chrome  : 52.0.2743.82
Node    : 6.3.0

@jwogrady
Copy link
Author

jwogrady commented Nov 18, 2016

@Fred-Barclay platformio-ide-terminal didn't seem to make a difference.

@chrisallenmoore what Java version are you using? Mine is as follows:

~ $ java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
~ $ atom --version
Atom    : 1.12.3
Electron: 1.3.6
Chrome  : 52.0.2743.82
Node    : 6.3.0

@Fred-Barclay
Copy link
Collaborator

@chrisallenmoore What OS are you using?
If it's a *nix, then what shell?

I haven't figured out the why yet, but for some reason termination (and platformio-ide-terminal, and possibly terminal-plus) replaces atom with node or nodejs.

@chrisallenmoore
Copy link

macOS Sierra
Version 10.12.2 Beta (16C48b)

@Fred-Barclay
Copy link
Collaborator

chrisallenmoore: thanks. 👍 What shell do you use?

@Fred-Barclay
Copy link
Collaborator

Update: there's a similar issue platformio/platformio-atom-ide-terminal#106 so I'll keep an eye on that as well.

@jwogrady What happens when you open the developer console (ctrl+shift+i though it might be cmd+shift+i for Mac) and run atom <some-file>? I get nothing on Linux but was wondering if there might be some output for Mac.

@chrisallenmoore
Copy link

chrisallenmoore commented Nov 19, 2016

I use the standard Mac Terminal. Atom will open from there, but not in Termination.

@Fred-Barclay
Copy link
Collaborator

What happens if you run sudo atom <some-command>?

@chrisallenmoore
Copy link

@Fred-Barclay that works. hmmm

@Fred-Barclay
Copy link
Collaborator

Temporary workaround: go to the settings for termination and set unset ELECTRON_RUN_AS_NODE to run on terminal initialisation.

@jwogrady
Copy link
Author

jwogrady commented Dec 1, 2016

Sweet, thanks for the workaround!

Just to follow up, the atom debug/console running on Mac didn't give me any output to share. This ancient article related to PHPStorm suggests a java versioning issue.

Your workaround shows a little output on mac every time I open a new instance of the terminal, but it works great.

unset ELECTRON_RUN_AS_NODE
project $ unset ELECTRON_RUN_AS_NODE
project $ 

I left the issue open in case you are still working on a final fix. From my standpoint though the issue is closed.

Thanks again for all your work on this!

@Fred-Barclay
Copy link
Collaborator

Thanks mate! I'm still working on a permanent fix but at least I now know this workaround is good for both Linux and Mac. 👍
I believe the offending code is this (in Atom): https://github.com/atom/atom/blob/master/src/buffered-node-process.js#L40
options.env.ELECTRON_RUN_AS_NODE = 1

So I'm working on how to undo that without breaking Atom in any way.

@DamnedScholar
Copy link

I've opened an issue on the Atom repo.

@Fred-Barclay
Copy link
Collaborator

Great! I was a little hesitant to do that myself since I didn't know if this was a bug in my code or an issue with Atom, hence my post on the Atom forums asking for help. Thanks for taking the initiative and opening the issue on the Atom repo! 😄

@Naki21
Copy link

Naki21 commented Feb 28, 2017

I have been having the same issues and I think I may have solved it. See my post in #33 .

It looks like ATOM_SHELL_INTERNAL_RUN_AS_NODE was renamed to ELECTRON_RUN_AS_NODE (atom/atom#11475)

In the terminal ide process.coffee file the filteredEnvironment function still uses ATOM_SHELL_INTERNAL_RUN_AS_NODE. I changed this to ELECTRON_RUN_AS_NODE and it seems to now run the terminal properly. Let me know if this helps!

@Fred-Barclay
Copy link
Collaborator

@Naki21 Thanks! I've pushed out a new release with ELECTRON_RUN_AS_NODE. 😄

@chrisallenmoore @jwogrady Please update to release 0.5.0 and let me know if this fixes the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report 🐛 Something isn't working macOS 🍏 A macOS bug is loose. possibly fixed
Development

No branches or pull requests

5 participants