Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
5252adc
Add workspace hidden state and CLI commands
austinywang May 16, 2026
c10a3ca
Add sidebar hidden workspace accordion
austinywang May 16, 2026
96bbc5c
Cover workspace visibility persistence
austinywang May 16, 2026
4749a8c
Fix hidden workspace focus and history
austinywang May 17, 2026
1d18aad
Address hidden workspace review feedback
austinywang May 17, 2026
ea7abe0
Tighten hidden workspace edge cases
austinywang May 17, 2026
8bfed01
Fix sidebar action bundle compile errors
austinywang May 17, 2026
722ba74
Tighten hidden workspace selection handling
austinywang May 17, 2026
bec89c4
Merge remote-tracking branch 'origin/main' into issue-4261-snooze-hid…
austinywang May 18, 2026
9611bd1
Address workspace visibility review feedback
austinywang May 18, 2026
969e450
Merge remote-tracking branch 'origin/main' into issue-4261-snooze-hid…
austinywang May 18, 2026
079ff14
Merge remote-tracking branch 'origin/main' into issue-4261-snooze-hid…
austinywang May 18, 2026
ce0c66d
Centralize visible workspace reordering
austinywang May 18, 2026
a8d025a
Disable dragging hidden workspace rows
austinywang May 18, 2026
28799b7
Cache sidebar workspace drop state
austinywang May 18, 2026
af71440
Merge remote-tracking branch 'origin/main' into issue-4261-snooze-hid…
austinywang May 18, 2026
e4b04e7
Tighten hidden workspace drop and index handling
austinywang May 18, 2026
f1e6508
Address workspace visibility review feedback
austinywang May 18, 2026
5dac3f2
Align v1 workspace list indices with visible selection
austinywang May 18, 2026
c388024
Address follow-up workspace visibility review feedback
austinywang May 18, 2026
de30266
Preserve sidebar selection anchor after drops
austinywang May 18, 2026
e0b3538
Align workspace actions with visible workspace ordering
austinywang May 18, 2026
298c60f
Align Japanese wake workspace wording
austinywang May 18, 2026
6be122e
Preserve hidden slots when moving workspaces to top
austinywang May 18, 2026
726c998
Keep sidebar row equality local
austinywang May 18, 2026
c0d0946
Align socket workspace visibility semantics
austinywang May 18, 2026
570c6e7
Merge branch 'main' of https://github.com/manaflow-ai/cmux into issue…
austinywang May 19, 2026
728d481
Merge main into workspace visibility PR
austinywang Jun 4, 2026
9d5c481
Fix sidebar hidden workspace reordering
austinywang Jun 4, 2026
25cd2e8
Restore visible workspace selection API
austinywang Jun 4, 2026
db48f1d
Fix Bonsplit empty area workspace drops
austinywang Jun 4, 2026
627702d
Fix sidebar autoscroll deinit cleanup
austinywang Jun 4, 2026
b39bb0e
Reveal hidden workspaces on selection
austinywang Jun 4, 2026
ff8f320
Reconcile sidebar selection after snooze
austinywang Jun 4, 2026
22bcff5
Avoid find focus side effects for inactive targets
austinywang Jun 4, 2026
9a99e94
Share sidebar selection reconciliation after row actions
austinywang Jun 4, 2026
2871bb0
Tighten command shortcut keycode fallback
austinywang Jun 4, 2026
0229219
Block punctuation shortcut fallback mismatches
austinywang Jun 4, 2026
5208881
Allow shifted punctuation physical fallback
austinywang Jun 4, 2026
6b6b7dc
Localize workspace snooze strings
austinywang Jun 4, 2026
42851f9
Merge origin/main into workspace visibility PR
austinywang Jun 6, 2026
36f2457
Add regression for show workspace index resolution
austinywang Jun 6, 2026
786be67
Fix workspace visibility command edge cases
austinywang Jun 6, 2026
30df65d
Merge origin/main into workspace visibility PR
austinywang Jun 6, 2026
bc2218d
Fix detach result return type
austinywang Jun 6, 2026
ae5a306
Add regression for selecting hidden workspace refs
austinywang Jun 6, 2026
dec325c
Resolve hidden workspace refs on select
austinywang Jun 6, 2026
91a3239
Focus workspace after context-menu wake
austinywang Jun 6, 2026
255ffc4
Merge remote-tracking branch 'origin/main' into issue-4261-snooze-hid…
austinywang Jun 6, 2026
eb28d5c
Merge remote-tracking branch 'origin/main' into issue-4261-snooze-hid…
austinywang Jun 10, 2026
d539a37
Refresh Swift file length budget after merging main
austinywang Jun 10, 2026
c97be1e
Merge remote-tracking branch 'origin/main' into issue-4261-snooze-hid…
austinywang Jun 10, 2026
c26d90b
Refresh Swift file length budget after merging main
austinywang Jun 10, 2026
10d9abc
Clamp out-of-range visible workspace reorder index
austinywang Jun 10, 2026
8258cd9
Bump Swift file length budget for reorder clamp fix
austinywang Jun 10, 2026
4bb4fc9
Fix hidden-workspace interactions with workspace groups and focus paths
austinywang Jun 10, 2026
a21dc30
Advance ghostty submodule to main's SHA (34cbf180d)
austinywang Jun 10, 2026
315c6c3
Route socket workspace.action move/close through visible list
austinywang Jun 10, 2026
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
118 changes: 113 additions & 5 deletions CLI/cmux.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3141,6 +3141,26 @@ struct CMUXCLI {
case "reorder-workspace":
try runReorderWorkspace(commandArgs: commandArgs, client: client, jsonOutput: jsonOutput, idFormat: idFormat)

case "hide-workspace":
try runWorkspaceVisibilityCommand(
commandName: "hide-workspace",
commandArgs: commandArgs,
client: client,
jsonOutput: jsonOutput,
idFormat: idFormat,
hidden: true
)

case "show-workspace":
try runWorkspaceVisibilityCommand(
commandName: "show-workspace",
commandArgs: commandArgs,
client: client,
jsonOutput: jsonOutput,
idFormat: idFormat,
hidden: false
)

case "workspace-action":
try runWorkspaceAction(commandArgs: commandArgs, client: client, jsonOutput: jsonOutput, idFormat: idFormat, windowOverride: windowId)
case "tab-action":
Expand All @@ -3151,7 +3171,18 @@ struct CMUXCLI {
try runRenameTab(commandArgs: commandArgs, client: client, jsonOutput: jsonOutput, idFormat: idFormat, windowOverride: windowId)

case "list-workspaces":
let payload = try client.sendV2(method: "workspace.list")
let includeHidden = hasFlag(commandArgs, name: "--include-hidden")
if let unknown = commandArgs.first(where: { $0.hasPrefix("--") && $0 != "--include-hidden" }) {
throw CLIError(message: "list-workspaces: unknown flag '\(unknown)'")
}
if let unexpected = commandArgs.first(where: { !$0.hasPrefix("--") }) {
throw CLIError(message: "list-workspaces: unexpected argument '\(unexpected)'")
}
let params: [String: Any] = includeHidden ? ["include_hidden": true] : [:]
let payload = try client.sendV2(
method: "workspace.list",
params: params
)
if jsonOutput {
print(jsonString(formatIDs(payload, mode: idFormat)))
} else {
Expand All @@ -3174,8 +3205,9 @@ struct CMUXCLI {
}()
let prefix = selected ? "* " : " "
let selTag = selected ? " [selected]" : ""
let hiddenTag = (ws["hidden"] as? Bool) == true ? " [hidden]" : ""
let titlePart = title.isEmpty ? "" : " \(title)"
print("\(prefix)\(handle)\(titlePart)\(remoteTag)\(selTag)")
print("\(prefix)\(handle)\(titlePart)\(remoteTag)\(hiddenTag)\(selTag)")
}
}
}
Expand Down Expand Up @@ -4493,7 +4525,8 @@ struct CMUXCLI {
_ raw: String?,
client: SocketClient,
windowHandle: String? = nil,
allowCurrent: Bool = false
allowCurrent: Bool = false,
includeHidden: Bool = false
) throws -> String? {
guard let raw else {
if !allowCurrent { return nil }
Expand All @@ -4514,6 +4547,9 @@ struct CMUXCLI {
if let windowHandle {
params["window_id"] = windowHandle
}
if includeHidden {
params["include_hidden"] = true
}
let listed = try client.sendV2(method: "workspace.list", params: params)
let items = listed["workspaces"] as? [[String: Any]] ?? []
for item in items where intFromAny(item["index"]) == wantedIndex {
Expand Down Expand Up @@ -4893,6 +4929,46 @@ struct CMUXCLI {
printV2Payload(payload, jsonOutput: jsonOutput, idFormat: idFormat, fallbackText: summary)
}

private func runWorkspaceVisibilityCommand(
commandName: String,
commandArgs: [String],
client: SocketClient,
jsonOutput: Bool,
idFormat: CLIIDFormat,
hidden: Bool
) throws {
let (workspaceOpt, rem0) = parseOption(commandArgs, name: "--workspace")
let (windowOpt, remaining) = parseOption(rem0, name: "--window")
if let unknown = remaining.first(where: { $0.hasPrefix("--") }) {
throw CLIError(message: "\(commandName): unknown flag '\(unknown)'")
}
let workspaceRaw = workspaceOpt ?? remaining.first
guard let workspaceRaw else {
throw CLIError(message: "\(commandName) requires --workspace <id|ref|index>")
}
if remaining.count > (workspaceOpt == nil ? 1 : 0) {
throw CLIError(message: "\(commandName): unexpected argument '\(remaining[workspaceOpt == nil ? 1 : 0])'")
}

let windowHandle = try normalizeWindowHandle(windowOpt, client: client)
let workspaceHandle = try normalizeWorkspaceHandle(
workspaceRaw,
client: client,
windowHandle: windowHandle,
includeHidden: !hidden
)

var params: [String: Any] = [:]
if let workspaceHandle { params["workspace_id"] = workspaceHandle }
if let windowHandle { params["window_id"] = windowHandle }

let method = hidden ? "workspace.hide" : "workspace.show"
let payload = try client.sendV2(method: method, params: params)
let action = hidden ? "hidden" : "shown"
let summary = "OK workspace=\(formatHandle(payload, kind: "workspace", idFormat: idFormat) ?? "unknown") \(action)"
printV2Payload(payload, jsonOutput: jsonOutput, idFormat: idFormat, fallbackText: summary)
}

private func runWorkspaceAction(
commandArgs: [String],
client: SocketClient,
Expand Down Expand Up @@ -9780,6 +9856,32 @@ struct CMUXCLI {
cmux reorder-workspace --workspace workspace:2 --index 0
cmux reorder-workspace --workspace workspace:3 --after workspace:1
"""
case "hide-workspace":
return """
Usage: cmux hide-workspace [--workspace <id|ref|index> | <id|ref|index>] [--window <id|ref|index>]

Hide a workspace from the sidebar without stopping notifications.

Flags:
--workspace <id|ref|index> Workspace to hide (required unless passed positionally)
--window <id|ref|index> Window context for numeric workspace indices

Example:
cmux hide-workspace --workspace workspace:2
"""
case "show-workspace":
return """
Usage: cmux show-workspace [--workspace <id|ref|index> | <id|ref|index>] [--window <id|ref|index>]

Show a hidden workspace in the sidebar again.

Flags:
--workspace <id|ref|index> Workspace to show (required unless passed positionally)
--window <id|ref|index> Window context for numeric workspace indices

Example:
cmux show-workspace --workspace workspace:2
"""
case "workspace-action":
return """
Usage: cmux workspace-action --action <name> [flags]
Expand Down Expand Up @@ -9900,12 +10002,16 @@ struct CMUXCLI {
"""
case "list-workspaces":
return """
Usage: cmux list-workspaces
Usage: cmux list-workspaces [--include-hidden]

List workspaces in the current window.

Flags:
--include-hidden Include hidden workspaces.

Example:
cmux list-workspaces
cmux list-workspaces --include-hidden
"""
case "ssh":
return """
Expand Down Expand Up @@ -24154,9 +24260,11 @@ export default function cmuxPiSessionExtension(pi: ExtensionAPI) {
close-window --window <id>
move-workspace-to-window --workspace <id|ref> --window <id|ref>
reorder-workspace --workspace <id|ref|index> (--index <n> | --before <id|ref|index> | --after <id|ref|index>) [--window <id|ref|index>]
hide-workspace --workspace <id|ref|index> [--window <id|ref|index>]
show-workspace --workspace <id|ref|index> [--window <id|ref|index>]
workspace-action --action <name> [--workspace <id|ref|index>] [--title <text>] [--color <name|#hex>] [--description <text>]
move-tab-to-new-workspace [--tab <id|ref|index>] [--surface <id|ref|index>] [--workspace <id|ref|index>] [--title <text>] [--focus <true|false>]
list-workspaces
list-workspaces [--include-hidden]
new-workspace [--name <title>] [--description <text>] [--cwd <path>] [--command <text>] [--layout <json>] [--window <id|ref|index>] [--focus <true|false>]
ssh <destination> [--name <title>] [--port <n>] [--identity <path>] [--ssh-option <opt>] [--no-focus] [-- <remote-command-args>]
remote-daemon-status [--os <darwin|linux>] [--arch <arm64|amd64>]
Expand Down
153 changes: 153 additions & 0 deletions Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -3079,6 +3079,40 @@
}
}
},
"sidebar.hiddenWorkspaces.title.one": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Hidden Workspace (1)"
Comment thread
cubic-dev-ai[bot] marked this conversation as resolved.
Resolved
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "非表示のワークスペース(1)"
}
}
}
},
"sidebar.hiddenWorkspaces.title.other": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Hidden Workspaces (%d)"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "非表示のワークスペース(%d)"
}
}
}
},
"sidebar.help.button": {
"extractionState": "manual",
"localizations": {
Expand Down Expand Up @@ -24567,6 +24601,57 @@
}
}
},
"command.snoozeWorkspace.title": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Snooze Workspace"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ワークスペースをスヌーズ"
}
}
}
},
"command.wakeWorkspace.subtitle": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Unhide the first hidden workspace"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "最初の非表示ワークスペースを再表示"
}
}
}
},
"command.wakeWorkspace.title": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Wake Workspace"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ワークスペースを起こす"
}
}
}
},
"command.previousTabInPane.subtitle": {
"extractionState": "manual",
"localizations": {
Expand Down Expand Up @@ -36419,6 +36504,40 @@
}
}
},
"contextMenu.snoozeWorkspace": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Snooze Workspace"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ワークスペースをスヌーズ"
}
}
}
},
"contextMenu.snoozeWorkspaces": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Snooze Workspaces"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ワークスペースをスヌーズ"
}
}
}
},
"contextMenu.removeCustomWorkspaceName": {
"extractionState": "manual",
"localizations": {
Expand Down Expand Up @@ -36895,6 +37014,40 @@
}
}
},
"contextMenu.wakeWorkspace": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Wake Workspace"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ワークスペースを表示"
}
}
}
},
"contextMenu.wakeWorkspaces": {
"extractionState": "manual",
"localizations": {
"en": {
"stringUnit": {
"state": "translated",
"value": "Wake Workspaces"
}
},
"ja": {
"stringUnit": {
"state": "translated",
"value": "ワークスペースを表示"
}
}
}
},
"contextMenu.workspaceColor": {
"extractionState": "manual",
"localizations": {
Expand Down
5 changes: 4 additions & 1 deletion Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11838,7 +11838,10 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
// goto_tab fallback from creating a new window when the index is out of bounds.
if let digit = numberedConfiguredShortcutDigit(event: event, action: .selectWorkspaceByNumber) {
if let manager = tabManager,
let targetIndex = WorkspaceShortcutMapper.workspaceIndex(forDigit: digit, workspaceCount: manager.tabs.count) {
let targetIndex = WorkspaceShortcutMapper.workspaceIndex(
forDigit: digit,
workspaceCount: manager.visibleWorkspaceTabs.count
) {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
#if DEBUG
cmuxDebugLog(
"shortcut.action name=workspaceDigit digit=\(digit) targetIndex=\(targetIndex) manager=\(debugManagerToken(manager)) \(debugShortcutRouteSnapshot(event: event))"
Expand Down
2 changes: 2 additions & 0 deletions Sources/CmuxSocketEventMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ enum CmuxSocketEventMapper {
publishResult(name: "workspace.renamed", category: "workspace", method: method, params: params, result: result)
case "workspace.reorder":
publishResult(name: "workspace.reordered", category: "workspace", method: method, params: params, result: result)
case "workspace.hide", "workspace.show":
publishResult(name: "workspace.visibility_changed", category: "workspace", method: method, params: params, result: result)
case "workspace.move_to_window":
publishResult(name: "workspace.moved", category: "workspace", method: method, params: params, result: result)
case "workspace.action":
Expand Down
Loading
Loading