Skip to content

Add keyboard shortcuts to rename tabs/windows and cycle tab color#672

Open
fabdelgado wants to merge 2 commits into
gnachman:masterfrom
fabdelgado:feature/quick-rename-and-tab-color-shortcuts
Open

Add keyboard shortcuts to rename tabs/windows and cycle tab color#672
fabdelgado wants to merge 2 commits into
gnachman:masterfrom
fabdelgado:feature/quick-rename-and-tab-color-shortcuts

Conversation

@fabdelgado

Copy link
Copy Markdown

Renaming a tab/window and setting a tab color already existed but were buried in the View menu with no key equivalents, which makes organizing a window full of tabs (e.g. many concurrent agents) slow.

This wires up default shortcuts and adds a one-keystroke color cycle:

  • Edit Tab Title: Ctrl-Cmd-R (reuses editTabTitle:)
  • Edit Window Title: Ctrl-Opt-Cmd-R (reuses editWindowTitle:)
  • Cycle Tab Color: Ctrl-Cmd-E (new cycleTabColor: action)

cycleTabColor: steps the current tab through the tabColorMenuOptions presets, then to no color, then wraps around. The shared "apply a color to every session in a tab" logic is hoisted into applyTabColor:toTab:, used by both the color menu and the new shortcut. Preset parsing is extracted to +[ColorsMenuItemView presetTabColors] so the menu and the cycle share one source of truth.

Renaming a tab/window and setting a tab color already existed but were
buried in the View menu with no key equivalents, which makes organizing a
window full of tabs (e.g. many concurrent agents) slow.

This wires up default shortcuts and adds a one-keystroke color cycle:

- Edit Tab Title:    Ctrl-Cmd-R   (reuses editTabTitle:)
- Edit Window Title: Ctrl-Opt-Cmd-R (reuses editWindowTitle:)
- Cycle Tab Color:   Ctrl-Cmd-E   (new cycleTabColor: action)

cycleTabColor: steps the current tab through the tabColorMenuOptions
presets, then to no color, then wraps around. The shared "apply a color to
every session in a tab" logic is hoisted into applyTabColor:toTab:, used by
both the color menu and the new shortcut. Preset parsing is extracted to
+[ColorsMenuItemView presetTabColors] so the menu and the cycle share one
source of truth.
@gnachman

Copy link
Copy Markdown
Owner

Can't use control-command or control-opt-command for a shortcut because they are reserved for creating new windows/tabs. Commit e376ba3 adds a spreadsheet documenting the existing shortcuts.

Cycle tab color is worth keeping, though. Just revert the shortcut changes.

Per review: Ctrl-Cmd and Ctrl-Opt-Cmd are reserved for creating
new windows/tabs, so the Edit Tab Title, Edit Window Title, and
Cycle Tab Color key equivalents are removed.

The cycleTabColor: action and its menu item are kept (now with no
default shortcut), along with the shared applyTabColor:toTab: and
+[ColorsMenuItemView presetTabColors] refactors.
@fabdelgado

Copy link
Copy Markdown
Author

Ready the changes!, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants