snapcrafters / atom

:atom: A community-maintained package to easily install Atom on Linux
https://snapcraft.io/atom
MIT License
25 stars 10 forks source link

atom opens "ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=false" as file on start up #59

Closed PhillipSz closed 4 years ago

PhillipSz commented 4 years ago

See https://discuss.atom.io/t/whenever-i-start-atom-it-opens-a-file-weird-file/75721 for more informations and also a way to fix it.

Happens on ubuntu 20.04 with latest atom/snap version, when I start the app from the user interface. Starting form command lines does not have the issue. Thanks a lot!

rotsee commented 4 years ago

Workarounds also discussed on AskUbuntu: https://askubuntu.com/questions/1251308/snap-version-of-atom-doesnt-save-state-on-20-04

geozeke commented 4 years ago

Same. Also tries to open an empty file called /usr/bin/atom. The workaround addresses the issue, but it looks like it's just a broken launcher script in the snap version of atom. Running atom from the command line doesn't present the issue. The current atom versions on atom.io and snap are the same (1.48.0), so this will have to be fixed in the snap store.

The script in question is this one:

/var/lib/snapd/desktop/applications/atom_atom.desktop

The broken line in the script is this:

Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/atom_atom.desktop /snap/bin/atom ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=false /usr/bin/atom %F

The corrected line is this:

Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/atom_atom.desktop /snap/bin/atom %F
xard-dev commented 4 years ago

Hello,

Noticed the same issue when trying to launch atom using desktop launcher. Launching atom from terminal works fine and comparing to previous snap version the key difference is on Exec line.

Previously it was: Exec=env ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=false /usr/bin/atom %F

But update changed it to: Exec=atom ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=false /usr/bin/atom %F

Which does not set the environment value but tries to launch atom and open files named after environment and the binary location.

Update: I'm not familiar with inner workings of snap but I can cofirm that the corrected line presented by geozeke does work and fixes the internal snap desktop entry

sean-fitzpatrick commented 4 years ago

The snap just updated yesterday and that line reappeared in the .desktop file. It's really annoying to have to go in and fix this every time there's an update to the snap. (Especially because snap updates silently in the background, so you don't know this has happened. You just go to resume your project one day, and boom, it's gone, and replaced by these two files.)

xard-dev commented 4 years ago

I can confirm that a silent update silently broke the atom desktop launcher yet again.

Lonniebiz commented 4 years ago

I'm running the Atom snap in Kubuntu 20.04.

I wish someone would fix this issue. Every time I fix it, it only lasts for a little while.

At this point, I've probably had to do these steps 3 or more times:

#Open this file:
sudo nano /var/lib/snapd/desktop/applications/atom_atom.desktop

# Replace this line:
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/atom_atom.desktop /snap/bin/atom ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT=false /usr/bin/atom %F

# With this line:
Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/atom_atom.desktop /snap/bin/atom %F

Can the snap maintainer please fix this in permanent way?

Each time I have to do this again, I'm going to come back here an update the log below: 2020-09-09 : I had to do the fix above again (4th time total). 2020-10-16 : I had to do the fix above again (5th time total).

xard-dev commented 4 years ago

Sigh...

This already 3rd or 4th time this happens. It looks like the maintainers are not at least following these Github tickets.

PhillipSz commented 4 years ago

@popey can you help out here? Thanks a lot!

xard-dev commented 4 years ago

As it seems that the cycle is continuing here's the repair procedure in script form which can be applied if giving correct output using sudo and sed operator -i.

sed 's/^Exec=env.*/Exec=env BAMF_DESKTOP_FILE_HINT=\/var\/lib\/snapd\/desktop\/applications\/atom_atom.desktop \/snap\/bin\/atom %F/' /var/lib/snapd/desktop/applications/atom_atom.desktop
vpal commented 4 years ago

Would be nice to have this fixed, thanks in advance.

moonsift commented 4 years ago

Just adding my voice to this, since it's a recurring problem for me too. Also linking in this thread which explains the problem very nicely including a solution to keep the environment variable ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT:

https://stackoverflow.com/questions/62681150/atom-opens-a-new-file-called-atom-disable-shelling-out-for-environment-false/62681675#62681675

brunobord commented 4 years ago

This issue keeps on being annoying, at each upgrade of the snap, our only solution is to manually edit a file owned by root. For tech-savvy people, it's easily doable, albeit a bit ugly. For other users, it might be beyond their knowledge and they could drop atom, not because of the code editor, but because of the snap install.

(I'm a bit sorry for being unable to help, I know nothing about building snap packages...)

xard-dev commented 4 years ago

Annoying part here is that even if fix can be applied using sed with relative ease the state of the opened documents is every time lost.

vpal commented 4 years ago

@xard-dev

Annoying part here is that even if fix can be applied using sed with relative ease the state of the opened documents is every time lost.

You fortunately can: Menu: File / Reopen Project

xard-dev commented 4 years ago

Thanks @vpal for pointing out the project folders. I remembered that Atom saved the project folders but not that it saved the state of the open windows in the project as well. However the information about which project was opened last time is lost. (okay, this is not as significant)

I might be wrong but I think by default Atom does not have any open project folders and if you open tabs there that state might be lost.

Lonniebiz commented 4 years ago

Hey, this bug has been reported for a good while now.

Someone is obviously updating the snap package to distribute newer versions of Atom regularly (and each time they do that we have to do this manual fix again). Why is it that this active project never seems to resolve this particular bug?

If any of you know the person who is making these version updates, to the snap, at-sign him to this issue. Maybe this person is simply never coming across this issue and maybe it can be fixed pretty easily if the right person saw this issue.

xard-dev commented 4 years ago

According to this Github page @flexiondotorg should be the maintainer. However the latest master branch commit is done by "Ubuntu" without any mention of an actual user.

Perhaps the upstreaming process has running automated for quite a while?

Lonniebiz commented 4 years ago

@xard-dev You bring up an interesting point. If the Atom upgrades are really being automated into the new snap releases, then hopefully @flexiondotorg , or someone he knows, can modify that automation to fix this bug permanently. I hear that Mark Shuttleworth answers to this guy, so he might make Mark Shuttleworth fix it or else. j/k

lukasmu commented 4 years ago

And again there is a new release that still contains the issue and requires the workaround 🙈 @flexiondotorg @popey any chance that you can look into this?

sean-fitzpatrick commented 4 years ago

The update I got on my machine yesterday didn't bring back the problem, but it did cause the desktop icon to disappear! I now have an empty spot on my favourites bar that I can click to launch Atom. Might be time to ditch the snap

Lonniebiz commented 4 years ago

@sean-fitzpatrick What are you running? I'm running Kubuntu 20.04. The update you're talking about cause the same old issue for me; my icon is still there, however.

sean-fitzpatrick commented 4 years ago

I'm on Ubuntu 20.04. (upgraded from an OEM install of 18.04 on a Dell XPS) Icon disappeared two days ago I think. Maybe there's another update lurking the next time I'm on that computer

xard-dev commented 4 years ago

Well... On Ubuntu 20.04 the same issue is still present after update :frowning_face:

sean-fitzpatrick commented 4 years ago

I've decided that the easiest solution is to uninstall the snap and then download the .deb installer from the Atom website.

Lonniebiz commented 4 years ago

Can someone please address this issue with the ATOM snap? @CanonicalLtd @ubuntu @snapcore @flexiondotorg

It seems this project is managed by artificial intelligence that is not sophisticated enough to read issues and solve simple bugs. We need a human being to manage this project!

This is probably a very easy bug to fix, but no one who can fix it is even reading this project's issues. We've been waiting since June 21st 2020 and it seems our reports are being completely ignored by anyone who can actually fix it.

This bug happens every single time the snap package updates. Please, at the very least, can the busy maintainer please acknowledge his awareness of this bug?

benonymus commented 4 years ago

Yes this issue is very annoying, and you need to do a manual fix every time you update!

user23498723452 commented 4 years ago

Can someone please make an attempt to fix this issue? This is impacting many users, including users on Ubuntu 18.04 like myself.

popey commented 4 years ago

Apologies for missing this. Fix in the works.

popey commented 4 years ago

This has now landed in stable. Once again, apologies for missing this. :pray:

geozeke commented 3 years ago

Much appreciated. Thanks!

xard-dev commented 3 years ago

Thank you so much!