Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.
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

Closed

Description

@solbjorn

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.

Arch Linux x64, Atom 1.0.10 x64.

Activity

  1. changed the title [-]Open file from file manager[/-] [+]Atom doesn't respect saved session if opened with arguments[/+] on Sep 2, 2015
  2. 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
  3. solbjorn commented on Sep 2, 2015

    @solbjorn
    Author

    Any ideas here? Since 0.207.0 nothing has been changed here unfortunately.

  4. mnquintana commented on Sep 2, 2015

    @mnquintana
    Contributor

    @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. 😄

  5. solbjorn commented on Sep 2, 2015

    @solbjorn
    Author

    @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.

  6. facundoq commented on Dec 4, 2015

    @facundoq

    @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.

  7. thedaniel commented on Dec 7, 2015

    @thedaniel
    Contributor

    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.

  8. ladamski commented on Aug 12, 2016

    @ladamski

    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.

  9. 2E0PGS commented on Aug 5, 2017

    @2E0PGS

    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

  10. solbjorn commented on Aug 5, 2017

    @solbjorn
    Author

    @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.

  11. 2E0PGS commented on Aug 5, 2017

    @2E0PGS

    @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.

  12. 2E0PGS commented on Aug 5, 2017

    @2E0PGS

    @solbjorn still same behavior after update. However I haven't found that option your on about yet. Please explain where I can find it?

  13. 2E0PGS commented on Aug 5, 2017

    @2E0PGS

    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.
    screenshot from 2017-08-05 16-55-26

  14. winstliu commented on Aug 7, 2017

    @winstliu
    Contributor

    Issue seems to have been resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions