agileflow 4.0.0-alpha.11 → 4.0.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/runtime/launch/tabs.js +24 -2
- package/src/runtime/launch/tmux.js +24 -9
package/package.json
CHANGED
|
@@ -259,9 +259,11 @@ function buildTabFormat(opts = {}) {
|
|
|
259
259
|
*/
|
|
260
260
|
const TAB_KEYBINDS = [
|
|
261
261
|
{
|
|
262
|
-
|
|
262
|
+
// Alt+t = new tab. Matches Chrome/Safari's Ctrl+T / Cmd+T —
|
|
263
|
+
// browser muscle memory carries straight over.
|
|
264
|
+
key: "M-t",
|
|
263
265
|
action: ["new-window"],
|
|
264
|
-
hint: "Alt+
|
|
266
|
+
hint: "Alt+t → new tab",
|
|
265
267
|
},
|
|
266
268
|
{
|
|
267
269
|
// -I prefills the prompt with the current name so the user can
|
|
@@ -309,6 +311,26 @@ const TAB_KEYBINDS = [
|
|
|
309
311
|
action: ["select-window", "-t", `:${n}`],
|
|
310
312
|
hint: `Alt+${n} → switch to tab ${n}`,
|
|
311
313
|
})),
|
|
314
|
+
// Browser-style cycling. Bind M-S-Tab AND M-BTab — terminals split
|
|
315
|
+
// on which escape sequence they emit for Shift+Tab, so binding both
|
|
316
|
+
// covers either path. Note: some window managers (GNOME, KDE)
|
|
317
|
+
// intercept Alt+Tab before it reaches tmux; works fine in fullscreen
|
|
318
|
+
// terminals on macOS and most tiling WMs.
|
|
319
|
+
{
|
|
320
|
+
key: "M-Tab",
|
|
321
|
+
action: ["next-window"],
|
|
322
|
+
hint: "Alt+Tab → next tab",
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
key: "M-S-Tab",
|
|
326
|
+
action: ["previous-window"],
|
|
327
|
+
hint: "Alt+Shift+Tab → previous tab",
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
key: "M-BTab",
|
|
331
|
+
action: ["previous-window"],
|
|
332
|
+
hint: "Alt+Shift+Tab → previous tab (alt encoding)",
|
|
333
|
+
},
|
|
312
334
|
];
|
|
313
335
|
|
|
314
336
|
module.exports = {
|
|
@@ -197,15 +197,29 @@ function detectTmuxVersion(runner) {
|
|
|
197
197
|
* @returns {{ applied: boolean, stderr: string }}
|
|
198
198
|
*/
|
|
199
199
|
function applyTabFormat(sessionName, runner, opts = {}) {
|
|
200
|
+
const theme = { ...tabs.DEFAULT_TAB_THEME, ...(opts.theme || {}) };
|
|
200
201
|
const format = tabs.buildTabFormat({
|
|
201
202
|
tmuxVersion: opts.tmuxVersion,
|
|
202
203
|
theme: opts.theme,
|
|
203
204
|
});
|
|
205
|
+
// Override tmux's default green status-style so the strip's dark
|
|
206
|
+
// background isn't broken up by tmux's stock green bar. Also clear
|
|
207
|
+
// status-left / status-right — they default to session info + clock
|
|
208
|
+
// on green; the tab strip already shows what the user needs.
|
|
209
|
+
runner.runSync([
|
|
210
|
+
"set-option",
|
|
211
|
+
"-t",
|
|
212
|
+
sessionName,
|
|
213
|
+
"status-style",
|
|
214
|
+
`bg=${theme.stripBg} fg=${theme.inactiveFg}`,
|
|
215
|
+
]);
|
|
216
|
+
runner.runSync(["set-option", "-t", sessionName, "status-left", ""]);
|
|
217
|
+
runner.runSync(["set-option", "-t", sessionName, "status-right", ""]);
|
|
204
218
|
const result = runner.runSync([
|
|
205
219
|
"set-option",
|
|
206
220
|
"-t",
|
|
207
221
|
sessionName,
|
|
208
|
-
"status-format[
|
|
222
|
+
"status-format[0]",
|
|
209
223
|
format,
|
|
210
224
|
]);
|
|
211
225
|
return {
|
|
@@ -538,8 +552,9 @@ async function launchInTmux(opts) {
|
|
|
538
552
|
// Re-apply the tab strip every attach so prefs / theme changes
|
|
539
553
|
// since session creation take effect (and so a session created by
|
|
540
554
|
// an older agileflow without a strip picks one up on reattach).
|
|
541
|
-
//
|
|
542
|
-
|
|
555
|
+
// Single dark status line — the tab strip on line[0] replaces
|
|
556
|
+
// tmux's default green status bar entirely.
|
|
557
|
+
runner.runSync(["set-option", "-t", base, "status", "1"]);
|
|
543
558
|
applyTabFormat(base, runner, { tmuxVersion });
|
|
544
559
|
log(`agileflow launch: resuming session ${base}`);
|
|
545
560
|
return attachSession(base, runner);
|
|
@@ -604,7 +619,7 @@ async function launchInTmux(opts) {
|
|
|
604
619
|
log(`agileflow launch: keybind skipped — ${f.hint}`);
|
|
605
620
|
}
|
|
606
621
|
}
|
|
607
|
-
runner.runSync(["set-option", "-t", name, "status", "
|
|
622
|
+
runner.runSync(["set-option", "-t", name, "status", "1"]);
|
|
608
623
|
applyTabFormat(name, runner, { tmuxVersion });
|
|
609
624
|
return attachSession(name, runner);
|
|
610
625
|
}
|
|
@@ -624,11 +639,11 @@ async function launchInTmux(opts) {
|
|
|
624
639
|
log(`agileflow launch: keybind skipped — ${f.hint}`);
|
|
625
640
|
}
|
|
626
641
|
}
|
|
627
|
-
//
|
|
628
|
-
//
|
|
629
|
-
//
|
|
630
|
-
// the attach.
|
|
631
|
-
runner.runSync(["set-option", "-t", name, "status", "
|
|
642
|
+
// Single dark status line — the tab strip on status-format[0]
|
|
643
|
+
// replaces tmux's default green status bar entirely. Per-session
|
|
644
|
+
// so other tmux clients are unaffected. Then write the tab format
|
|
645
|
+
// itself. Both are best-effort; failure shouldn't block the attach.
|
|
646
|
+
runner.runSync(["set-option", "-t", name, "status", "1"]);
|
|
632
647
|
applyTabFormat(name, runner, { tmuxVersion });
|
|
633
648
|
log(`agileflow launch: starting new session ${name}`);
|
|
634
649
|
return attachSession(name, runner);
|