-
Notifications
You must be signed in to change notification settings - Fork 641
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
macOS: Remember last focused window location for next startup #4233
Comments
My config file: But if I use |
I look forward to this being implemented. I tend to keep my terminal in the lower left corner of my workspace. I also utilize multiple "Spaces," usually one per project. So I end up creating multiple terminal windows, at least one per Space, and, while not a deal breaker, it gets tiresome having to manually move the new window to the location I typically keep it. |
@jsumners does the window-save-state = always
This works for me so far. |
Note this issue is different from |
Right. And I'm adding more information that the last focused window should also inform the position of the next new window created from the Dock icon's context menu. |
Note that on a technical level we cannot make this work on Linux, at least not just for Ghostty. GTK and Wayland explicitly do not allow windows to move themselves, because in Wayland the placement of each window is solely the responsibility of the compositor/window manager, and this functionality can only be implemented there. |
shell-integration = zsh i used these three on config file. (i used zsh) |
Thanks for this information, @mitchellh. Do you know where this fits for release on your roadmap? It's one of only two things about Ghostty that are really bothering me. It's an otherwise amazing terminal. Excellent work overall. |
Nothing can be released if no one PRs a fix. I do not see any PRs associated with this issue. I'm sure they'd welcome your contribution. |
Discussed in #4204
Originally posted by evertonstz December 31, 2024
I'm one of those guys that keeps closing and reopening their terminal during the day and that's one of the first things I noticed when using Ghostty: it doesn't remembers the size and position of the last closed window like most other MacOS apps.
It's been a long time since I used Linux with modern gnome, but I think that's also the expected behavior for apps there, right?
Research on Other Behavior
Terminal.app
andiTerm
both remember the position of the last focused window (not last created window) and restore it when restarting the app. Only the position is remembered, not the size.Note this is different from
window-save-state
. This isn't restoring any window. This is just remembering the position.This behavior isn't typical with Gnome applications, so this is tagged macOS only.
Implementation
Given this is a macOS only behavior, I'm inclined to leverage macOS APIs for this and put this information into
defaults
. I suspect that's where these programs are also doing it but verification required.I think we should solve this completely in the Swift code.
There are no configs currently to specify an initial window position, but in the future if/when we have those, those should always override this.
The text was updated successfully, but these errors were encountered: