Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion macos/Sources/Features/Terminal/TerminalController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1850,13 +1850,19 @@ class TerminalController: BaseTerminalController, TabGroupCloseCoordinator.Contr
)
if let window = window as? TerminalWindow {
window.titlebarFont = lastTitlebarFont
window.setDiffSidebarButtonState(willShow)
}
}
}

@objc func closeGitDiff(_ sender: Any?) {
guard #available(macOS 26.0, *) else { return }
Task { await gitDiffSidebarState.setVisible(false, cwd: nil) }
Task {
await gitDiffSidebarState.setVisible(false, cwd: nil)
if let window = window as? TerminalWindow {
window.setDiffSidebarButtonState(false)
}
}
}

@objc func openInEditor(_ sender: Any?) {
Expand Down
19 changes: 13 additions & 6 deletions macos/Sources/Features/Terminal/Window Styles/TerminalWindow.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ class TerminalWindow: NSWindow {
private(set) var derivedConfig: DerivedConfig = .init()

/// Sets up our tab context menu
private var tabMenuObserver: NSObjectProtocol? = nil
private var titlebarFontTabGroupObservation: NSKeyValueObservation? = nil
private var titlebarFontTabBarObservation: NSKeyValueObservation? = nil
private var lastTitlebarFontState: TitlebarFontState? = nil
private var lastAppliedAppearance: AppearanceState? = nil
private var tabMenuObserver: NSObjectProtocol?
private var titlebarFontTabGroupObservation: NSKeyValueObservation?
private var titlebarFontTabBarObservation: NSKeyValueObservation?
private var lastTitlebarFontState: TitlebarFontState?
private var lastAppliedAppearance: AppearanceState?

/// Whether this window supports the update accessory. If this is false, then views within this
/// window should determine how to show update notifications.
Expand Down Expand Up @@ -178,7 +178,7 @@ class TerminalWindow: NSWindow {
button.controlSize = .large
button.target = terminalController
button.action = #selector(TerminalController.toggleGitDiffSidebar(_:))
button.setButtonType(.momentaryPushIn)
button.setButtonType(.pushOnPushOff)

container.addSubview(button)
NSLayoutConstraint.activate([
Expand Down Expand Up @@ -452,6 +452,13 @@ class TerminalWindow: NSWindow {
return label
}()

// MARK: Diff Sidebar Toggle

/// Update the diff sidebar toggle button to reflect visibility state.
func setDiffSidebarButtonState(_ isOn: Bool) {
diffSidebarButton?.state = isOn ? .on : .off
}

// MARK: Surface Zoom

/// Set to true if a surface is currently zoomed to show the reset zoom button.
Expand Down
Loading