Git Product home page Git Product logo

Comments (25)

mpeterson2 avatar mpeterson2 commented on July 25, 2024

You didn't miss any steps. I'm guessing the issue is the path separator for files is different for Windows. Windows uses \, while everyone else else /.

Can you let me know if there are files in ~/.atom/packages/save-session/projects? Also are there any issues in the console coming from save-session when you launch Atom?

from save-session.

davidtheclark avatar davidtheclark commented on July 25, 2024

Yes. I'm getting some buggy behavior and I'd bet it's all because of Windows ...

The directory ~/.atom/packages/save-session/projects looks to be empty.

In my devTools console I don't have any errors from save-session, but I do get a couple of other errors related to unexpect \ --- so maybe the rest of Atom hasn't worked out this path thing either.

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

I've made some changes that should fix the file separating issue. Let me know if this helps.

from save-session.

davidtheclark avatar davidtheclark commented on July 25, 2024

I installed v0.7.2 but unfortunately see no difference. The projects folder is still empty. Still no save-session-specific errors in the console.

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

Okay. If you don't mind, I'm going to have to ask you to do a few things since I don't have a Windows computer readily available.

  1. Before we get too far, do you have any packages that may conflict? A while ago someone submitted an issue, but it ended up being another package that tried to do similar things. They removed the other package and things worked correctly then.
  2. What is the path for Data Save Folder? It'll show up in your settings for Save Session.
  3. Is your Project setting filled in? Is it using the correct path separator?
  4. Open Atom's console (cmd + option + i) and type atom.workspace.getActiveEditor().getPath(), does that contain the correct path separator?
  5. What about X, Y, Width, Height or Tree Size?
  6. Open the console in Atom and enter process.platform. What is the output (should be win32)?

I think that should be enough information to figure it out. Let me know.

from save-session.

davidtheclark avatar davidtheclark commented on July 25, 2024
  1. Here is my list of packages (I don't think any should be conflicting):
  1. Data Save Folder = ~.atom\packages\save-session\projects
  2. I don't see any Project setting that there could be a path in. The only
    path I see in the seeings is for Data Save Folder.
  3. atom.workspace.getActiveEditor() is undefined, so I can't run
    getPath().
  4. Are those also method from what is returned by getActiveEditor()? If
    so, can't get to them. If not, where are they?
  5. The process.platform is indeed win32.

Hope that helps.

On Thu, Oct 9, 2014 at 3:24 PM, Michael Peterson [email protected]
wrote:

Okay. If you don't mind, I'm going to have to ask you to do a few things
since I don't have a Windows computer readily available.

Before we get too far, do you have any packages that may conflict? A
while ago someone submitted an issue, but it ended up being another package
that tried to do similar things. They removed the other package and things
worked correctly then.
2.

What is the path for Data Save Folder? It'll show up in your settings
for Save Session.
3.

Is your Project setting filled in? Is it using the correct path
separator?
4.

Open Atom's console (cmd + option + i) and type
atom.workspace.getActiveEditor().getPath(), does that contain the
correct path separator?
5.

What about X, Y, Width, Height or Tree Size?
6.

Open the console in Atom and enter process.platform. What is the
output (should be win32)?

I think that should be enough information to figure it out. Let me know.


Reply to this email directly or view it on GitHub
#20 (comment)
.

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

Sorry about that, I should have looked over what I wrote better...

For 3, the Project setting gets saved if you open a project/folder, so if the plugin is failing or you never opened a project then it wouldn't be there.

Number 4 I forgot to mention that you need to open a file before you run the command.

Number 5, I meant to put after 3. They are in Save Session's settings. This should just confirm that the package has at least loaded.

Your Data Save Folder seems strange. Mine is /Users/Michael/.atom/..., not ~/.atom/.... Part of this path is grabbed by Atom's method atom.packages.getPackageDirPaths(), which may not work for Windows yet. Can you set it to the full system path (starting with the driver letter of course) of it's current path and see if that helps?

from save-session.

davidtheclark avatar davidtheclark commented on July 25, 2024

Ok, let me try again ...

  1. Was fine.
  2. Actual saved data folder is c:\Users\david.clark\.atom\packages\save-session\projects. I just used the ~ to abbreviate, sorry.
  3. Project path is filled in and correct.
  4. atom.workspace.getActiveEditor().getPath() = c:\workspaces\trunk-css\connect\connect-htcweb\src\main\style\components\_Frame.scss --- so it's using \, the correct path separator.
  5. All those settings are populated with numbers.

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

Okay. That pretty much rules out the path being incorrect... I don't have other ideas right now unfortunately. I'll try to test out a Windows machine when I get a chance and see what I can find.

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

I just tested it on a Windows computer and it worked just fine. Here's what I did:

  • Downloaded and extracted Atom
  • Installed Save Session through the settings Gui (but that shouldn't matter)
  • Messed around a bit
  • Closed Atom through various ways
  • Reopened Atom and saw that everything was restored

I guess I'm not sure what to tell you. You could try reinstalling Atom and Save Session, but I'm not sure if it'll help or not.

from save-session.

RJHsiao avatar RJHsiao commented on July 25, 2024

I have almost same problem...

In my case, I opened a folder, open some files from tree view, save files, and close atom by file->exit.
After I re-open atom, I saw the tree view that show the folder I opened before correctly, but nothing else. And there is nothing in my %HomePath%\.atom\packages\save-session\projects. I didn't see any error message in the console.

I tried to remove this package, remove and install atom by choco, and install this package before.
My atom is in 0.136.0, and the save-session I installed is in 0.8.1. All options in the package settings are keep on default values.
The other packages I installed are:

%HomePath%\.atom\packages (9)
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] (disabled)
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

from save-session.

gerane avatar gerane commented on July 25, 2024

I think I know what the issue is. If the setting "Restore Open Files Per Project" is selected, this will not work. It tries to save the project.json file to the following directory:

c:\Users\username.atom\packages\save-session\projects\c:\Users\username\Documents\GitHub\project.json

In that example, "C:\Users\username\Documents\Github" is the Project directory. When it is trying to create the directory it can't due to the bad path. If you disable the "Restore Open Files Per Project" then it will save the project.json file like normal in the "undefined" folder in the \save-session\projects folder.

I am not very familiar with coffeescript but what I think can likely be done is to create a new variable that selects everything after the first \ or / in the atom.project.path. Then call that variable in the saveFile instead of atom.project.path. You could also add another "if process.platform is 'win32'" and have the windows save path be slightly different.

If anyone else is having issues, temporarily try to disable "Restore Open Files Per Project"

I am dabbling with a fork to see if I can try to make a fix, but I am pretty new to the language.

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

Ah yes, that sounds like it would cause an issue.

I think it's important to keep the drive letter for Windows for people who use multiple drives. Maybe just remove the colon and when it is restored then the first part of the path is the drive letter?

from save-session.

RJHsiao avatar RJHsiao commented on July 25, 2024

@gerane It really works! Thank you!
And it doesn't work after I update save-session to 0.8.3, but it works again after I tried to remove this package, remove and install atom by choco, and install this package again.

@mpeterson2 Yes, it's important to keep the drive letter. Maybe someone has directories with same name and same path between two (or more?) drives...LOL
I think "just remove the colon" is a simply and effectively solution to resolve this issue.

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

Oops, didn't want to actually close that without some feedback, Let me know if this is fixed now.

from save-session.

RJHsiao avatar RJHsiao commented on July 25, 2024

@mpeterson2 Still not work after I re-install to this update version.
The console panel in developer tools show some error message when I tried to exit atom in the first time, but I can't catch them because the window closed immediately after the error message is shown, and I can't get the error message again when I try to reproduce the situation.

And it not work even "Restore Open Files Per Project" is unchecked.

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

Whoops, I missed an @ symbol before the function name. Try the newest version.

from save-session.

RJHsiao avatar RJHsiao commented on July 25, 2024

No...It still not work if "Restore Open Files Per Project" is checked.
But it work fine now when "Restore Open Files Per Project" is unchecked.
I'm already re-install atom and save-session before...Atom and save-session are all in the newest version (atom 0.137.0 is released today).

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

Okay, thanks for testing. I'll have to do some debugging on a Windows machine when I get a chance then.

from save-session.

RJHsiao avatar RJHsiao commented on July 25, 2024

Bad news...

I found the same problem on Mac OS X 10.10 with the newest atom and newest save-session.
It not work when I checked the "Restore Open Files Per Project".
But this time, there are some error message shown on console panel. I can reproduce those error message by following this steps:

  1. Be sure the "Restore Open Files Per Project" option is unchecked when atom is opened, and already opened a folder.
  2. Open Preference, go to save session's settings page, and checked the "Restore Open Files Per Project" option.
  3. Try to close some tabs. You can open some tabs right now or on step 1.
    Then you will see the error message when you close a tab: Uncaught TypeError: undefined is not a function $HOME/.atom/packages/save-session/lib/config.coffee:72. Sometimes it may show the almost same message but the line number is 70 at the first time you close a tab.

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

Sorry about that, I wrote the function in a different spot and moved it, but I somehow forgot to update it correctly. It should be good now...

from save-session.

davidtheclark avatar davidtheclark commented on July 25, 2024

I just got version 0.8.8. It doesn't seem to be working, and here's a nice console log error that might help:

Failed to activate package named 'save-session' TypeError: undefined is not a function
  at Object.module.exports.saveFile (c:\Users\david.clark\.atom\packages\save-session\lib\config.coffee:72:15)
  at Object.module.exports.activate (c:\Users\david.clark\.atom\packages\save-session\lib\save-session.coffee:87:22)
  at Package.module.exports.Package.activateNow (c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\package.js:198:27)
  at c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\package.js:184:28
  at Package.module.exports.Package.measure (c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\package.js:130:15)
  at Package.module.exports.Package.activate (c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\package.js:178:14)
  at PackageManager.module.exports.PackageManager.activatePackage (c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\package-manager.js:404:21)
  at PackageManager.module.exports.PackageManager.activatePackages (c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\package-manager.js:393:14)
  at PackageManager.module.exports.PackageManager.activate (c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\package-manager.js:379:19)
  at Atom.module.exports.Atom.startEditorWindow (c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\atom.js:516:21)
  at Object.<anonymous> (c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\window-bootstrap.js:14:8)
  at Object.<anonymous> (c:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\src\window-bootstrap.js:29:4)
  at Module._compile (module.js:468:26)
  at Object.Module._extensions..js (module.js:486:10)
  at Module.load (C:\ProgramData\chocolatey\lib\Atom.0.136.0\tools\Atom\resources\app\node_modules\coffee-script\lib\coffee-script\register.js:45:36)
  at Function.Module._load (module.js:318:12)
  at Module.require (module.js:373:17)
  at require (module.js:392:17)
  at window.onload (file:///C:/ProgramData/chocolatey/lib/Atom.0.136.0/tools/Atom/resources/app/static/index.js:20:25)

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

I'm not sure how I'm missing these... Try the new version.

from save-session.

RJHsiao avatar RJHsiao commented on July 25, 2024

Great!
It work fine for me in my Windows 8.1 and Mac OS X 10.10 now!
Maybe I'll try it on my Ubuntu 14.04 later...

from save-session.

mpeterson2 avatar mpeterson2 commented on July 25, 2024

Awesome. I'm going to close the issue then, but feel free to open it again if you run into more issues.

from save-session.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.