macOS scrolling #2524
-
After playing around a bit with Ghostty, several things related to scrolling are missing or feel a bit off:
AppKit apps get all this for free when using an NSScrollView. I'm guessing since Ghostty renders using metal, using an NSScrollView isn't super convenient. But the suggestion from here is maybe workable: https://forums.developer.apple.com/forums/thread/651229 That is, have a dummy NSView as the NSScrollView's documentView and sync its size using a technique similar to https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/NSScrollViewGuide/Articles/SynchroScroll.html Apologies if this has been tried before and doesn't work due to performance issues. I tried looking around a bit but didn't find a discussion about this. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This is probably fixable today... depending on if AppKit sends some event to the macOS app. We learned we can't reliably detect Ghostty already has binding actions to jump scroll to top or up a single page so its just a matter of triggering that.
Yes, besides Terminal.app I think every Terminal implements a custom scroll curve because we don't get it for free (with the current raw NSView).
It hasn't. We can't use a full NSScrollView as you already ascertained but I haven't looked into the more creative approaches to it, so let me read on that a bit. As you can see with #111, I absolutely want to support a scollbar in the GUI for both macOS and Linux so this is relevant. |
Beta Was this translation helpful? Give feedback.
-
Upon further reading, I think this is a worthy approach to try. I'm going to post this over at #111 with some additional details. |
Beta Was this translation helpful? Give feedback.
#111
This is probably fixable today... depending on if AppKit sends some event to the macOS app. We learned we can't reliably detect
fn+<key>
at a low level but if AppKit sends a key equivalent or something for this then we can do it.Ghostty already has binding actions to jump scroll to top or up a single page so its just a matter of triggering that.
Yes, besides Terminal.app I think every Terminal implements a custom scroll curve because we don't get it for free (with th…