-
-
Notifications
You must be signed in to change notification settings - Fork 990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mac OS: kitty doesn't restore #1197
Comments
kitty has no code to restore window positions, so I am surprised it would ever have happened. As I recall, cocoa has some special APIs for saving/restoring application state. These are not wrapped by glfw (the toolkit kitty uses) so they would need to be implement in kitty/cocoa_window.m instead. This is too much effort for me personally, but patches are welcome. |
I assume this holds for applescript control as well? How hard/easy would it be to build kitty? Maybe I can git bisect to find where the behavior was lost? |
No idea about aplescript control. Isn't applescript going to be retired by apple? opening at startup is the same thing as far as i know. see https://sw.kovidgoyal.net/kitty/build.html for how to build from source |
It would be very nice to have this feature. :) |
After looking into this a little, I think this is the necessary related documentation. setFrameAutosaveName might also work to solve it too, apparently. Here is the related StackOverflow where I found them. It took a while to figure out the right thing to search for. |
This is the only missing feature blocked me using kitty in Mac, after reboot the workspace will be gone. |
@kovidgoyal my preferred way for you to implement something like this, if you ever did, would be to have the opposite of
In an ideal world, A less good implementation could be some sort of |
While I'm not usually intentionally restoring, the restore feature comes in very handy when the OS crashes (which does happen...). Even if the windows aren't resized/placed correctly, at least having them all pop up again with the previous scrollback content is really, really useful. I also wish there were a CMD+SHIFT+T "restore closed tab" feature for when I fat finger CMD+W. Restoring working directories probably requires something like #3091. |
To be clear, my original issue report is just about restoring window size and location. |
If anyone is interested, I wrote a script which converts the output of # Dump the current kitty session:
$ kitty @ ls > kitty-dump.json
# Convert this JSON file into a kitty session file:
$ cat kitty-dump.json | python3 ./kitty-convert-dump.py > kitty-session.kitty
# Start kitty from that session file:
$ kitty --session kitty-session.kitty It's here if anyone wants to use it: https://github.com/dflock/kitty-save-session |
This is essentially the same as opening a new tab, because when you close the tab, the shell in there is killed, the terminal could show the scroll back buffer, and reopen trhe shell in the old directory, but it is not the same. After a restart, I think there is no way to get back shell state, though scroll back can be dumped then restored. It would have to handle the case of running something like vim or less. |
@kovidgoyal do we have any updates on this? I would have loved if kitty could restore directories at least automatically if someone quits and reopens it. |
I'm having this issue when my Mac wakes up from sleep. Kitty has stopped rendering and displays a still image, however the application has not stopped responding to the OS. Killing and restarting Kitty shows that TMUX has been receiving the keystrokes and the state has updated accordingly, it was only the rendering that was frozen. |
For anyone that might tackle the window position restore issue, GLFW seems to have support for it on macOS with the window hint This also might be a clue in glfw's source for cocoa_window.m |
I use https://github.com/kasper/phoenix/ to launch kitty app in quake like style with just a shortcut. It can remember window size and position. |
Mac OS offers the option to resume all your open apps after a shutdown, Apple's version of hibernate, I guess. Terminal.app actually restores the ouput/history in the windows that were open when you shut the system down.
While that's nice, just restoring windows to the positions and sizes they had when shutting down would be plenty for me. Previous versions of kitty restored the positions, not the size. The current version (0.12.3) doesn't for me.
Note that I don't like the
remember_window_size
setting, I want new terminals to open at 80x24, it's just some long running terminals I'd like to restore to whatever size I made them.On a similar note, I've been unable to change kitty windows's sizes using applescript, this was a nice QoL improvement with Terminal.app because the Mac OS window manager is so impotent.
The text was updated successfully, but these errors were encountered: