`Atom` command does not work in atom terminal packages


#1

Hey mates! I’ve been trying to solve this myself for some time now, but I’ve exhausted all of my (meager) knowledge so I’m hoping someone here can help. :slight_smile:

I maintain the termination package which provides a terminal instance in Atom – it was forked from platformio-terminal and looks like terminal-plus, if you’re familiar with either, and this “bug” affects all of them. The trouble I’m
having is that it is impossible to open a file with the atom command or otherwise manipulate atom:
From Linux:

$ atom AUTHORS
$ electron: bad option: --app=/usr/lib/atom
electron: bad option: --executed-from=/home/fred/Git/Termination
electron: bad option: --pid=3824

From macOS:

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.

After doing some digging it appears that electron is being set to run as node (and then this affects Atom - I’m not sure exactly how yet) so that when atom is passed into the terminal, node is called instead. You can see this when you compare the output of commands run inside termination:

$ atom --version 
v6.5.0
$ electron --version
v6.5.0
$ node --version
v7.3.0

to commands run in a dedicated system terminal

$ atom --version
Atom    : 1.12.7
Electron: 1.4.13
Chrome  : 53.0.2785.143
Node    : 6.5.0
$ electron --version
v1.4.13
$ node --version
v7.3.0

I believe that this is the Atom code that causes this to happen.
Further supporting this is the fact that if unset ELECTRON_RUN_AS_NODE is run from inside termination, atom and other commands behave ordinarily.

I’d like to remove this behavior, but I’m not sure exactly how to go about that. I’ve tried setting up the termination initialisation code to pass unset ELECTRON_RUN_AS_NODE through the system shell whenever a terminal is generated, but that seemed to just freeze termination.

I’ve also tried modifying process.coffee to contain env.ELECTRON_RUN_AS_NODE = 0 but this has had absolutely no effect.

So…
can someone please help me figure out what’s going on here and what I should do so that atom doesn’t run as electron/node? I’d be extremely grateful for any help!

Relevant issues and discussions:





Thanks!


Opening a file from a terminal in Atom
#2

I’ve made an issue to try to get some movement from this and consolidate the discussion instead of having disparate threads in each of the package repos and the forum for something that’s a bug with the editor itself.


#3

Thanks! I wasn’t sure if it was a problem with Atom or my code so I didn’t want to open an issue (though I’m glad you did.) :slight_smile:
Cheers!