You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Originally posted by lilyball November 14, 2024
macOS windows can be marked as "dirty", or edited. This is typically done in a document-based app to indicate that you've made changes to the document and that closing the window will prompt you to save your changes. This is displayed as a dot in the titlebar close button:
It also adds an indicator to the corresponding menuitem in the Window menu.
Terminal.app uses this to indicate that the window/tab will prompt if you try and close it, and that's very useful. Besides just giving me a cue before I close it, it also means I can glance at the Window menu to see if any terminal windows are doing something (I do this before e.g. telling my computer to reboot, so I can deal with it before it interrupts the shutdown). iTerm also appears to be doing this too (I haven't checked to make sure it corresponds with the prompt-on-close condition but I'd be surprised if it doesn't).
I think it would be really useful if Ghostty picked up this behavior too. I don't know how to do this in SwiftUI but I'm pretty sure this is the NSWindow.isDocumentEdited property in AppKit.
Implementation Notes
I think this will require a new apprt action so that apprt's are notified when their close state changes. Currently there is an API to pull this info but not an event-based API to push this info. So while this is tagged macOS, it will require some core work.
The text was updated successfully, but these errors were encountered:
Doing a bit of research on this one, one tricky state that will be hard to get edge triggered is whether the cursor is at a prompt. The reason that's tricky is because detection (at least) would have to happen on the termio thread which is directly responsible for IO throughput and not an area we want to slow down.
Discussed in #2678
Implementation Notes
I think this will require a new apprt action so that apprt's are notified when their close state changes. Currently there is an API to pull this info but not an event-based API to push this info. So while this is tagged
macOS
, it will require some core work.The text was updated successfully, but these errors were encountered: