You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
Atom doesn't respect saved session if opened with file arguments #7186
If Atom opens without arguments, it restores session with all tabs and project folders. If launch Atom with file arguments (via terminal or shorctut association) and it's already opened, it only opens a new tab for file and keeps current project folders and other tabs.
But if launch Atom with file arguments and no other instance is opened, all saved session becomes lost, it changes project folder to file's root and opens only one tab for executed file.
For example, Sublime respects saved session in that case too.
changed the title [-]Atom doesn't respect saved session if opened with arguments[/-][+]Atom doesn't respect saved session if opened with file arguments[/+]on Sep 2, 2015
@solbjorn That's how it was intended to work - the "restore session" feature only works if you launch Atom without arguments (either from the command line or from your desktop shell). This could change, but I wanted to at least let you know that it was intentional and not a bug. 😄
@mnquintana OK, i see. But IMO it's very uncomfortable if you have one or more "permanent" projects opened (and saved as session) that you work on, then you open (with closed Atom) one file through shell (for example, some config not related to your projects), and then - BOOM! - you lost all your working tree, opened projects etc.
There might be at least an option for that, i think.
@mnquintana I agree with @solbjorn, this makes using atom as both project editor and random text file editor difficult. And I think it goes in line with #1722, that is, when atom is already open, opening a file does not open a new window but opens a tab in the open window. It's incoherent imho that opening a file when atom is closed doesn't restore the session and open a tab for the file.
Some people do expect this behavior, but a few others have reported it as a bug, as it also happens when opening a file from finder/explorer. If someone in the community wants to take this on (and add a config setting to toggle the behavior between the current default and the new default) that would be awesome. It probably won't make it on the core team's roadmap in the near future, though.
Agreed, this different behavior from every other IDE I've used. They all restore the previous session AND open the new file.
I've lost work due to this bug several times now (since not all files are saved upon exit, just session restored). So I've stopped using Atom and gone back to Sublime.
Yes also getting this, It seems if I open a file from random location I had a session of open tabs before it will restore that session. However if I open Atom via launcher icon it will restore a different session that has tabs from when I launch it via that mode. It's like the editor stores different sessions for different file locations you open it in.
Very strange, imo no matter where I open it from or how it should always restore one session that I last used and add another tab if I launched it by double clicking a file to open or gave command line args to open a file. The only other time it should launch a different session is perhaps if ran as another user e.g. root!
System info:
OS: Ubuntu Linux 16.04 x64
Atom Version: 1.14.4
@2E0PGS, very old Atom version. There's new option in recent versions, "Always restore saved session", that had completely fixed topic subject. If there'll be no more complains on session management, I'll close this in a few days.
@solbjorn ok I guess I will try new update and see how it goes. Why does Atom not update with system... Does it not install a PPA during Deb installation. That should be added imo.
Ok seems new update has some kind of auto update feature lets hope that works. Anyway I found this new option it is actually called something different! I have attached screenshot to help others. This does indeed seem to fix the issue. Thanks.
Activity
[-]Open file from file manager[/-][+]Atom doesn't respect saved session if opened with arguments[/+][-]Atom doesn't respect saved session if opened with arguments[/-][+]Atom doesn't respect saved session if opened with file arguments[/+]solbjorn commentedon Sep 2, 2015
Any ideas here? Since 0.207.0 nothing has been changed here unfortunately.
mnquintana commentedon Sep 2, 2015
@solbjorn That's how it was intended to work - the "restore session" feature only works if you launch Atom without arguments (either from the command line or from your desktop shell). This could change, but I wanted to at least let you know that it was intentional and not a bug. 😄
solbjorn commentedon Sep 2, 2015
@mnquintana OK, i see. But IMO it's very uncomfortable if you have one or more "permanent" projects opened (and saved as session) that you work on, then you open (with closed Atom) one file through shell (for example, some config not related to your projects), and then - BOOM! - you lost all your working tree, opened projects etc.
There might be at least an option for that, i think.
facundoq commentedon Dec 4, 2015
@mnquintana I agree with @solbjorn, this makes using atom as both project editor and random text file editor difficult. And I think it goes in line with #1722, that is, when atom is already open, opening a file does not open a new window but opens a tab in the open window. It's incoherent imho that opening a file when atom is closed doesn't restore the session and open a tab for the file.
thedaniel commentedon Dec 7, 2015
Some people do expect this behavior, but a few others have reported it as a bug, as it also happens when opening a file from finder/explorer. If someone in the community wants to take this on (and add a config setting to toggle the behavior between the current default and the new default) that would be awesome. It probably won't make it on the core team's roadmap in the near future, though.
ladamski commentedon Aug 12, 2016
Agreed, this different behavior from every other IDE I've used. They all restore the previous session AND open the new file.
I've lost work due to this bug several times now (since not all files are saved upon exit, just session restored). So I've stopped using Atom and gone back to Sublime.
2E0PGS commentedon Aug 5, 2017
Yes also getting this, It seems if I open a file from random location I had a session of open tabs before it will restore that session. However if I open Atom via launcher icon it will restore a different session that has tabs from when I launch it via that mode. It's like the editor stores different sessions for different file locations you open it in.
Very strange, imo no matter where I open it from or how it should always restore one session that I last used and add another tab if I launched it by double clicking a file to open or gave command line args to open a file. The only other time it should launch a different session is perhaps if ran as another user e.g. root!
System info:
OS: Ubuntu Linux 16.04 x64
Atom Version: 1.14.4
solbjorn commentedon Aug 5, 2017
@2E0PGS, very old Atom version. There's new option in recent versions, "Always restore saved session", that had completely fixed topic subject. If there'll be no more complains on session management, I'll close this in a few days.
2E0PGS commentedon Aug 5, 2017
@solbjorn ok I guess I will try new update and see how it goes. Why does Atom not update with system... Does it not install a PPA during Deb installation. That should be added imo.
2E0PGS commentedon Aug 5, 2017
@solbjorn still same behavior after update. However I haven't found that option your on about yet. Please explain where I can find it?
2E0PGS commentedon Aug 5, 2017
Ok seems new update has some kind of auto update feature lets hope that works. Anyway I found this new option it is actually called something different! I have attached screenshot to help others. This does indeed seem to fix the issue. Thanks.

winstliu commentedon Aug 7, 2017
Issue seems to have been resolved.