Atom doesn't remember the window size


#1

Every time I close and reopen Atom the window size is reset to default (fits the screen vertically).
Is it possible to save the last window size?


Request: Restore window positions on restart
#2

Agree, it would be great to be able to modify/update the default window size.


#3

This is pretty much the only thing that annoys me at the moment, but it is very annoying. Is there some hidden way to tweak this?


#4

You could try setting the window size in your init.coffee with the atom.setWindowDimensions() function perhaps.


#5

Thank you. Where can I found the docs? This does not exist.

EDIT:
Ok, I figure it out

atom.setWindowDimensions({"width": 1180, "height": 900})

I could save the size in a file with getWindowDimensions and the load it.
How can I run code before a window closes?


#6

That part I don’t know, sadly. I’ll poke around and see what I can find.


#7

That can be easily be done in a package, I’m resisting the urge to create one.

You can save the window dimensions on deactivate and set the window dimensions on activate.

{x, y, width, height} = atom.getWindowDimensions()

#8

I created a little package, feel free to fork, send a PR, or report an issue.

https://atom.io/packages/remember-window


#9

I’m glad you did it, because I was probably going to cave this weekend and do it if you didn’t :laughing:


#10

Thank you. I will fork it.


#11

Thanks for that it works really well. Is there any chance you could extend this to remember the sidebar width as well?


#12

#13

Now this function work in core? but with version 1.9.0 not work for me. =/