Skip to content

Commit 85da3bb

Browse files
committed
feat: add Ctrl+Shift+{/} keyboard shortcuts to reorder session tabs
Matches WezTerm/terminal emulator tab reorder conventions. Uses the existing sessionOrder array and saveSessionOrder() for persistence.
1 parent 7b8b175 commit 85da3bb

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/web/public/app.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ class CodemanApp {
639639
{ key: '=', altKey: '+', ctrl: true, action: () => this.increaseFontSize() },
640640
{ key: '-', ctrl: true, action: () => this.decreaseFontSize() },
641641
{ key: 'V', ctrl: true, shift: true, action: () => VoiceInput.toggle() },
642+
{ key: '{', ctrl: true, shift: true, action: () => this.moveActiveTabLeft() },
643+
{ key: '}', ctrl: true, shift: true, action: () => this.moveActiveTabRight() },
642644
];
643645

644646
// Use capture to handle before terminal
@@ -2106,6 +2108,24 @@ class CodemanApp {
21062108
});
21072109
}
21082110

2111+
moveActiveTabLeft() {
2112+
if (!this.activeSessionId) return;
2113+
const idx = this.sessionOrder.indexOf(this.activeSessionId);
2114+
if (idx <= 0) return;
2115+
[this.sessionOrder[idx - 1], this.sessionOrder[idx]] = [this.sessionOrder[idx], this.sessionOrder[idx - 1]];
2116+
this.saveSessionOrder();
2117+
this._fullRenderSessionTabs();
2118+
}
2119+
2120+
moveActiveTabRight() {
2121+
if (!this.activeSessionId) return;
2122+
const idx = this.sessionOrder.indexOf(this.activeSessionId);
2123+
if (idx === -1 || idx >= this.sessionOrder.length - 1) return;
2124+
[this.sessionOrder[idx], this.sessionOrder[idx + 1]] = [this.sessionOrder[idx + 1], this.sessionOrder[idx]];
2125+
this.saveSessionOrder();
2126+
this._fullRenderSessionTabs();
2127+
}
2128+
21092129
// ═══════════════════════════════════════════════════════════════
21102130
// Session Lifecycle — select, close, navigate
21112131
// ═══════════════════════════════════════════════════════════════

0 commit comments

Comments
 (0)