Skip to content
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

Kitty doesn't remember position on macOS screen #1119

Closed
iandol opened this issue Nov 3, 2018 · 21 comments
Closed

Kitty doesn't remember position on macOS screen #1119

iandol opened this issue Nov 3, 2018 · 21 comments

Comments

@iandol
Copy link

iandol commented Nov 3, 2018

Hi, using Kitty 0.12.3 on macOS 10.14.1 and remember_window_size enabled, when Kitty first starts it does not remember its position on screen. As I also have draw_minimal_border enabled I have to drag edges to get the window where I want it. It would be nice if kitty could remember its position as well as its size on a restart.

Thanks for a great minimalist terminal!

@kovidgoyal
Copy link
Owner

IMO window placement should be the responsibility of th eOS, not individual applications. For macOS I believe there are third party tools that allow you to save and restore window positions for individual applications, such as: https://www.macworld.com/article/2036191/mac-gems-stay-keeps-your-windows-exactly-where-you-want-them.html

@iandol
Copy link
Author

iandol commented Nov 3, 2018

@kovidgoyal — thanks for the reply, all other apps on macOS that I'm aware of do have their position remembered, I assume because they all use the OS API. I'm not a mac developer so cannot tell you how other apps do this, this was all I found, and it is part of the Cocoa frameworks:

https://developer.apple.com/documentation/appkit/nswindow/1526255-restorable
https://www.raywenderlich.com/613-windows-and-windowcontroller-tutorial-for-macos

Kitty's behaviour is currently different to most other apps, and yes this is a minor issue that can be worked around with 3rd party window managers.

@kovidgoyal
Copy link
Owner

The cocoa APIs are not really suitable, since kitty, being a terminal has special sizing requirements, its window size can either be remembered or depend on the font size, dpi and number of cells specified in its config. It's probably possible to make ethis work with cocoa api, but I'm afraid its too much work, at least for me. Patches are welcome.

@orthodoX
Copy link

Started experimenting with kitty recently and I'm amazed how light and fast it is. I know it's been a while since this issue was closed, I must agree with @iandol, it's a bit irritating to readjust the position and size of the window all the time or have a third party app only for managing kitty window 😞

@rix0rrr
Copy link

rix0rrr commented Jun 29, 2021

+1, I would consider dropping kitty over something as trivial as this. I don't need lots of tiny needle pricks added to my daily routine, all day every day.

@bogdancss
Copy link

any updates on this?

@chrisgrieser
Copy link

chrisgrieser commented Feb 24, 2022

I actually wanted to switch to kitty, and set up configs and a theme etc – but having to resize the window every time really is a deal breaker to me.

Also, apps like Stay aren't really a solution, since the move windows only with a slight delay, virtually diminishing the quick startup time kitty has.

@Luflosi
Copy link
Contributor

Luflosi commented Feb 25, 2022

The size can be adjusted. Look at the three options here: https://sw.kovidgoyal.net/kitty/conf/#opt-kitty.remember_window_size.
Only the position cannot.

@chrisgrieser
Copy link

when you remove window decorations from a mac app, the only way to move the window literally by resizing it though 🙈

@Luflosi
Copy link
Contributor

Luflosi commented Feb 25, 2022

There is a way: #84 (comment). It may not be super convenient, but seems to work. I heard that it is too difficult to find the right place to drag on high-dpi displays.

@Luflosi
Copy link
Contributor

Luflosi commented Feb 25, 2022

Also see #3683. Unfortunately I haven't found the motivation to continue the linked PR.

@chrisgrieser
Copy link

ah, I see. a bit better, but still requires moving the window every time 🙁

@yuri-urban
Copy link

yuri-urban commented Aug 10, 2022

still no update on this? this is really annoying. the window size isn't a problem, but dragging the position every time it opens is very annoying. considering to switch to another terminal, such a pity...

@webservices-network
Copy link

I ended up resorting to 3rd party software to change position after kitty starts. Shouldn't have to use mouse or 3rd party to accomplish this though. Great apart from this bugginess I call it ;)

@MurtadhaInit
Copy link

I know it's been years but it really is a shame that such a bug has been ignored. The terminal is great apart from this usability issue.

You can't just drag the window every time you open the terminal, especially if you have the title bar (window decorations) disabled.

@NathanCummings
Copy link

I would also like to register my interest in this feature. Even using a 3rd party app to manage window placement (Rectangle in my case), it's still a pain to have to reposition kitty when other apps remember their position.

@kobzar
Copy link

kobzar commented Jun 5, 2023

Any updates?

@AigenUK
Copy link

AigenUK commented Jun 5, 2023

Any updates?

Got a feeling this will never be fixed now. Ended up using Wezterm.

@lucifer9
Copy link

lucifer9 commented Jul 3, 2023

I managed to achive this using Apple Script.

if application "kitty" is running then
	tell application "System Events"
		set position of first window of application process "kitty" to {X_you_want, Y_you_want}
	end tell
end if

Use Script Editor to save the above to a file like ~/Documents/pos.scpt, then in your .bashrc or .zshrc add

osascript ~/Documents/pos.scpt

Remenber to add kitty.app and/or /usr/bin/osascript to Accessibility ( in System Settings -> Privacy & Security ).
One thing to note: new OS window created afterwards ( e.g. using ⌘ N ) will be positioned at the location specified in the previous Apple Script. This may cause confusion in some usage scenarios.

@deltakroneker
Copy link

deltakroneker commented Oct 18, 2023

@lucifer9

This is too slow, I did the same but with Rectangle app that can use keystroke Control+Option+C (that centers the window) and the following osascript:

osascript -e 'activate application "kitty"'; osascript -e 'tell application "System Events" to keystroke "c" using {control down, option down }'

But it's waaay to slow and I do not recommend it as a viable solution unless you like to see glitching movement every time you open new kitty terminal. It needs to be solved in a different way.

@truebit
Copy link

truebit commented Oct 19, 2023

with HammerSpoon app, below lua code would work:

local kitty =  hs.application.launchOrFocusByBundleID("net.kovidgoyal.kitty")
kitty:mainWindow():move(hs.geometry({x=0,y=0,w=1,h=0.3})) -- move kitty window on top

BTW, I made a gist to mimic iterm2 with top window and hotkey: https://gist.github.com/truebit/d79b8018666d65e95970f208d8f5d149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests