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
22 changes: 19 additions & 3 deletions GhosttyTabs.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
objects = {

/* Begin PBXBuildFile section */
FE001101 /* FileExplorerStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE001001 /* FileExplorerStore.swift */; };
FE001102 /* FileExplorerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE001002 /* FileExplorerView.swift */; };
FE002101 /* FileExplorerRootResolverTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE002001 /* FileExplorerRootResolverTests.swift */; };
FE002102 /* FileExplorerStoreTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = FE002002 /* FileExplorerStoreTests.swift */; };
A5001001 /* cmuxApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5001011 /* cmuxApp.swift */; };
A5001002 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5001012 /* ContentView.swift */; };
E62155868BB29FEB5DAAAF25 /* SidebarSelectionState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9AD52285508B1D6A9875E7B3 /* SidebarSelectionState.swift */; };
Expand Down Expand Up @@ -205,6 +209,10 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
FE001001 /* FileExplorerStore.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileExplorerStore.swift; sourceTree = "<group>"; };
FE001002 /* FileExplorerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileExplorerView.swift; sourceTree = "<group>"; };
FE002001 /* FileExplorerRootResolverTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileExplorerRootResolverTests.swift; sourceTree = "<group>"; };
FE002002 /* FileExplorerStoreTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileExplorerStoreTests.swift; sourceTree = "<group>"; };
A5001000 /* cmux.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = cmux.app; sourceTree = BUILT_PRODUCTS_DIR; };
F1000002A1B2C3D4E5F60718 /* cmuxTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = cmuxTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
7E7E6EF344A568AC7FEE3715 /* cmuxUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = cmuxUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -518,6 +526,8 @@
A5001651 /* CmuxConfig.swift */,
A5001653 /* CmuxConfigExecutor.swift */,
A5001655 /* CmuxDirectoryTrust.swift */,
FE001001 /* FileExplorerStore.swift */,
FE001002 /* FileExplorerView.swift */,
);
path = Sources;
sourceTree = "<group>";
Expand Down Expand Up @@ -612,6 +622,8 @@
491751CE2321474474F27DCF /* TerminalControllerSocketSecurityTests.swift */,
10D684CFFB8CDEF89CE2D9E1 /* TabManagerSessionSnapshotTests.swift */,
C1A2B3C4D5E6F70800000002 /* CmuxConfigTests.swift */,
FE002001 /* FileExplorerRootResolverTests.swift */,
FE002002 /* FileExplorerStoreTests.swift */,
);
path = cmuxTests;
sourceTree = "<group>";
Expand Down Expand Up @@ -841,9 +853,11 @@
A5001610 /* SessionPersistence.swift in Sources */,
A5001640 /* RemoteRelayZshBootstrap.swift in Sources */,
A5001650 /* CmuxConfig.swift in Sources */,
A5001652 /* CmuxConfigExecutor.swift in Sources */,
A5001654 /* CmuxDirectoryTrust.swift in Sources */,
);
A5001652 /* CmuxConfigExecutor.swift in Sources */,
A5001654 /* CmuxDirectoryTrust.swift in Sources */,
FE001101 /* FileExplorerStore.swift in Sources */,
FE001102 /* FileExplorerView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
D1320AA0D1320AA0D1320AB0 /* Sources */ = {
Expand Down Expand Up @@ -912,6 +926,8 @@
8C4BBF2DEF6DF93F395A9EE7 /* TerminalControllerSocketSecurityTests.swift in Sources */,
2BB56A710BB1FC50367E5BCF /* TabManagerSessionSnapshotTests.swift in Sources */,
C1A2B3C4D5E6F70800000001 /* CmuxConfigTests.swift in Sources */,
FE002101 /* FileExplorerRootResolverTests.swift in Sources */,
FE002102 /* FileExplorerStoreTests.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
85 changes: 85 additions & 0 deletions Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -69323,6 +69323,91 @@
}
}
},
"shortcut.toggleFileExplorer.label": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Toggle File Explorer"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ファイルエクスプローラーを切替"
}
}
}
},
"fileExplorer.empty": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "No folder open"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "フォルダが開かれていません"
}
}
}
},
"fileExplorer.error.unavailable": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "File explorer is not available"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ファイルエクスプローラーは利用できません"
}
}
}
},
"titlebar.fileExplorer.accessibilityLabel": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Toggle File Explorer"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ファイルエクスプローラーを切替"
}
}
}
},
"titlebar.fileExplorer.tooltip": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Show or hide the file explorer"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ファイルエクスプローラーの表示/非表示"
}
}
}
},
"shortcut.toggleTerminalCopyMode.label": {
"extractionState": "manual",
"localizations": {
Expand Down
13 changes: 13 additions & 0 deletions Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2275,6 +2275,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
weak var tabManager: TabManager?
weak var notificationStore: TerminalNotificationStore?
weak var sidebarState: SidebarState?
weak var fileExplorerState: FileExplorerState?
weak var fullscreenControlsViewModel: TitlebarControlsViewModel?
weak var sidebarSelectionState: SidebarSelectionState?
var shortcutLayoutCharacterProvider: (UInt16, NSEvent.ModifierFlags) -> String? = KeyboardLayout.character(forKeyCode:modifierFlags:)
Expand Down Expand Up @@ -7100,11 +7101,14 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
cmuxConfigStore.wireDirectoryTracking(tabManager: tabManager)
cmuxConfigStore.loadAll()

let fileExplorerState = FileExplorerState()

let root = ContentView(updateViewModel: updateViewModel, windowId: windowId)
.environmentObject(tabManager)
.environmentObject(notificationStore)
.environmentObject(sidebarState)
.environmentObject(sidebarSelectionState)
.environmentObject(fileExplorerState)
.environmentObject(cmuxConfigStore)

// Use the current key window's size for new windows so Cmd+Shift+N
Expand Down Expand Up @@ -11065,6 +11069,15 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
return true
}

if matchConfiguredShortcut(event: event, action: .toggleFileExplorer) {
// Dispatch async to escape AppKit's performKeyEquivalent animation context.
// Without this, NSAnimationContext implicitly animates the layout change.
DispatchQueue.main.async { [weak self] in
self?.fileExplorerState?.toggle()
}
return true
}

if matchConfiguredShortcut(event: event, action: .sendFeedback) {
guard let targetContext = preferredMainWindowContextForShortcuts(event: event),
let targetWindow = targetContext.window ?? windowForMainWindowId(targetContext.windowId) else {
Expand Down
Loading
Loading