mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: make close the terminal button non-destructive
So that "return" works.
This commit is contained in:
@ -213,6 +213,7 @@ extension Ghostty {
|
|||||||
let pub = center.publisher(for: Notification.ghosttyNewSplit, object: leaf.surface)
|
let pub = center.publisher(for: Notification.ghosttyNewSplit, object: leaf.surface)
|
||||||
let pubClose = center.publisher(for: Notification.ghosttyCloseSurface, object: leaf.surface)
|
let pubClose = center.publisher(for: Notification.ghosttyCloseSurface, object: leaf.surface)
|
||||||
let pubFocus = center.publisher(for: Notification.ghosttyFocusSplit, object: leaf.surface)
|
let pubFocus = center.publisher(for: Notification.ghosttyFocusSplit, object: leaf.surface)
|
||||||
|
|
||||||
SurfaceWrapper(surfaceView: leaf.surface)
|
SurfaceWrapper(surfaceView: leaf.surface)
|
||||||
.onReceive(pub) { onNewSplit(notification: $0) }
|
.onReceive(pub) { onNewSplit(notification: $0) }
|
||||||
.onReceive(pubClose) { onClose(notification: $0) }
|
.onReceive(pubClose) { onClose(notification: $0) }
|
||||||
@ -220,7 +221,7 @@ extension Ghostty {
|
|||||||
.confirmationDialog(
|
.confirmationDialog(
|
||||||
"Close Terminal?",
|
"Close Terminal?",
|
||||||
isPresented: $confirmClose) {
|
isPresented: $confirmClose) {
|
||||||
Button("Close the Terminal", role: .destructive) {
|
Button("Close the Terminal") {
|
||||||
confirmClose = false
|
confirmClose = false
|
||||||
requestClose = true
|
requestClose = true
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user