From 46fef7718cb5c53dc983aa301599887ec398c624 Mon Sep 17 00:00:00 2001 From: Lukas <134181853+bo2themax@users.noreply.github.com> Date: Sun, 12 Apr 2026 11:57:15 +0200 Subject: [PATCH] macOS: move `pwd` to `OSSurfaceView` --- macos/Sources/Ghostty/Surface View/OSSurfaceView.swift | 4 ++++ macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift | 4 ---- macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift | 3 --- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift b/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift index b21b6e64f..0ad89faf8 100644 --- a/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift +++ b/macos/Sources/Ghostty/Surface View/OSSurfaceView.swift @@ -8,6 +8,10 @@ extension Ghostty { /// Unique ID per surface let id: UUID + // The current pwd of the surface as defined by the pty. This can be + // changed with escape codes. + @Published var pwd: String? + init(id: UUID?, frame: CGRect) { self.id = id ?? UUID() super.init(frame: frame) diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift index db41f1f6a..37c08d6f5 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView_AppKit.swift @@ -21,10 +21,6 @@ extension Ghostty { } } - // The current pwd of the surface as defined by the pty. This can be - // changed with escape codes. - @Published var pwd: String? - // The cell size of this surface. This is set by the core when the // surface is first created and any time the cell size changes (i.e. // when the font size changes). This is used to allow windows to be diff --git a/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift b/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift index 3751257e7..39201c396 100644 --- a/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift +++ b/macos/Sources/Ghostty/Surface View/SurfaceView_UIKit.swift @@ -9,9 +9,6 @@ extension Ghostty { // to the app level and it is set from there. @Published var title: String = "👻" - // The current pwd of the surface. - @Published var pwd: String? - // The cell size of this surface. This is set by the core when the // surface is first created and any time the cell size changes (i.e. // when the font size changes). This is used to allow windows to be