-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtmux_masterclass.html
More file actions
1770 lines (1581 loc) · 93.5 KB
/
tmux_masterclass.html
File metadata and controls
1770 lines (1581 loc) · 93.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tmux Masterclass — The Terminal Multiplexer</title>
<meta property="og:title" content="tmux Masterclass — The Terminal Multiplexer">
<meta property="og:description" content="Master tmux — sessions, panes, windows, and workflows for productive terminal-based development.">
<meta property="og:image" content="../mathsGraph.jpg">
<meta property="og:type" content="article">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=VT323&family=Fira+Code:wght@300;400;500;600;700&family=Inconsolata:wght@300;400;500;700&display=swap" rel="stylesheet">
<style>
:root {
--crt: #080c08;
--crt2: #0a100a;
--crt3: #0d160d;
--crt4: #112011;
--crt5: #172817;
--phos: #39ff14;
--phos2: #2dd10f;
--phos3: #60ff44;
--phos-dim: #0a2206;
--amber: #ffb000;
--amber2: #ffd060;
--amb-dim: #2a1c00;
--cyan: #00ffdd;
--cyan-dim: #002a24;
--red: #ff3344;
--red-dim: #2a0508;
--blue: #4488ff;
--blue-dim: #0a1a3a;
--border: rgba(57,255,20,0.15);
--border2: rgba(57,255,20,0.06);
--text: #c0e8b0;
--text2: #5a8050;
--text3: #2a4025;
--mono: 'Fira Code', monospace;
--alt: 'Inconsolata', monospace;
--display: 'VT323', monospace;
--glow-sm: 0 0 8px rgba(57,255,20,0.4);
--glow-md: 0 0 16px rgba(57,255,20,0.25);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
background: var(--crt);
color: var(--text);
font-family: var(--mono);
font-size: 14px;
line-height: 1.7;
min-height: 100vh;
overflow-x: hidden;
position: relative;
}
/* ── SCANLINE + PHOSPHOR GLOW ── */
body::before {
content: '';
position: fixed; inset: 0;
background: repeating-linear-gradient(
0deg,
transparent,
transparent 2px,
rgba(0,0,0,0.08) 2px,
rgba(0,0,0,0.08) 4px
);
pointer-events: none; z-index: 0;
}
body::after {
content: '';
position: fixed; inset: 0;
background:
radial-gradient(ellipse 100% 100% at 50% 50%, rgba(57,255,20,0.03) 0%, transparent 70%),
linear-gradient(rgba(57,255,20,0.025) 1px, transparent 1px),
linear-gradient(90deg, rgba(57,255,20,0.025) 1px, transparent 1px);
background-size: 100% 100%, 32px 32px, 32px 32px;
pointer-events: none; z-index: 0;
}
/* ── HEADER — tmux status bar style ── */
header {
position: sticky; top: 0; z-index: 200;
background: var(--phos);
border-bottom: 2px solid var(--phos2);
}
.header-inner {
max-width: 1500px; margin: 0 auto;
padding: 0 1rem;
display: flex; align-items: center; height: 28px;
font-family: var(--display); font-size: 1.1rem;
}
.tmux-left {
display: flex; align-items: center; gap: 0;
flex-shrink: 0;
}
.tmux-session-block {
background: var(--crt);
color: var(--phos);
padding: 0 14px;
height: 28px;
display: flex; align-items: center;
letter-spacing: 0.04em;
font-size: 1rem;
border-right: 1px solid var(--phos2);
}
.tmux-win {
padding: 0 12px; height: 28px;
display: flex; align-items: center; gap: 6px;
cursor: pointer; transition: all 0.1s;
border-right: 1px solid rgba(0,0,0,0.2);
color: var(--crt);
font-size: 0.95rem;
letter-spacing: 0.02em;
background: none;
border: none;
}
.tmux-win:hover { background: rgba(0,0,0,0.15); }
.tmux-win.active {
background: var(--crt);
color: var(--phos);
}
.tmux-win .wnum { opacity: 0.7; font-size: 0.8rem; }
.tmux-spacer { flex: 1; }
.tmux-right {
flex-shrink: 0;
display: flex; align-items: center; gap: 0;
background: var(--crt);
height: 28px;
}
.tmux-r-block {
padding: 0 12px;
height: 28px; display: flex; align-items: center;
font-family: var(--display); font-size: 0.95rem;
border-left: 1px solid var(--phos2);
letter-spacing: 0.04em;
}
.rb-phos { color: var(--phos); }
.rb-amber { background: var(--amber); color: var(--crt); }
.rb-dim { color: var(--text3); font-size: 0.85rem; }
/* ── LAYOUT ── */
.wrapper { max-width: 1500px; margin: 0 auto; padding: 2rem; position: relative; z-index: 1; }
section { display: none; animation: blink-in 0.15s ease; }
section.active { display: block; }
@keyframes blink-in { 0%{opacity:0} 30%{opacity:0.7} 60%{opacity:0.4} 100%{opacity:1} }
/* ── SECTION HEADER ── */
.section-header { margin-bottom: 2rem; }
.prompt-line {
font-family: var(--display); font-size: 1.2rem;
color: var(--phos); letter-spacing: 0.06em; margin-bottom: 0.25rem;
display: flex; align-items: center; gap: 8px;
}
.prompt-line::before { content: '$ '; color: var(--text3); }
.section-title {
font-family: var(--display); font-size: 3.2rem;
color: var(--phos); letter-spacing: 0.12em; line-height: 1;
margin-bottom: 0.5rem;
text-shadow: var(--glow-md);
}
.section-title em { color: var(--amber); font-style: normal; text-shadow: 0 0 12px rgba(255,176,0,0.5); }
.section-sub {
font-family: var(--alt); font-size: 0.9rem;
color: var(--text2); max-width: 760px; line-height: 1.7; font-weight: 300;
}
.section-rule {
height: 1px; margin: 1.25rem 0 2rem;
background: linear-gradient(90deg, var(--phos), rgba(57,255,20,0.1), transparent);
box-shadow: var(--glow-sm);
}
/* ── GRIDS ── */
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.g3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.g12 { display: grid; grid-template-columns: 1fr 2fr; gap: 1.5rem; }
.g21 { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
@media(max-width:960px){.g2,.g3,.g12,.g21{grid-template-columns:1fr}}
/* ── TERMINAL PANE (the card) ── */
.tpane {
background: var(--crt2);
border: 1px solid var(--border);
position: relative;
padding: 0;
overflow: hidden;
}
.tpane:hover { border-color: rgba(57,255,20,0.3); }
.tpane-bar {
background: var(--phos);
color: var(--crt);
font-family: var(--display); font-size: 0.95rem;
padding: 0 10px;
height: 22px; display: flex; align-items: center;
letter-spacing: 0.06em;
}
.tpane-body { padding: 1rem 1.25rem; }
.tpane-label {
font-family: var(--display); font-size: 0.85rem;
color: var(--text3); margin-bottom: 0.5rem;
letter-spacing: 0.1em; text-transform: uppercase;
display: flex; align-items: center; gap: 0.5rem;
}
.tpane-label::before { content: '#'; color: var(--phos); }
/* ── CODE BLOCKS ── */
.code-wrap { background: rgba(0,0,0,0.6); border: 1px solid var(--border); margin: 1rem 0; overflow: hidden; }
.code-header {
display: flex; align-items: center; justify-content: space-between;
background: var(--crt3); border-bottom: 1px solid var(--border);
padding: 0.35rem 1rem;
}
.code-fname { font-family: var(--display); font-size: 0.95rem; color: var(--phos); letter-spacing: 0.06em; }
.code-lang {
font-family: var(--display); font-size: 0.85rem; color: var(--amber);
background: var(--amb-dim); border: 1px solid rgba(255,176,0,0.2);
padding: 0 8px; letter-spacing: 0.06em;
}
pre {
padding: 1rem 1.25rem; overflow-x: auto;
font-family: var(--mono); font-size: 0.8rem; line-height: 1.85;
color: var(--text); tab-size: 2;
scrollbar-width: thin; scrollbar-color: var(--crt4) transparent;
}
pre::-webkit-scrollbar { height: 4px; }
pre::-webkit-scrollbar-thumb { background: var(--crt4); }
/* Syntax */
.kw { color: var(--phos); font-weight: 600; }
.fn { color: var(--cyan); }
.st { color: #88ff44; }
.cm { color: var(--text3); font-style: italic; }
.jj { color: var(--amber); }
.nm { color: var(--phos3); }
.op { color: var(--phos2); }
.nu { color: var(--amber2); }
.dc { color: var(--cyan); }
.py { color: var(--amber); font-weight: 700; }
.ty { color: #88ffcc; }
.re { color: var(--red); }
.ke { color: var(--phos); font-weight: 700; } /* keybinding */
.pr { color: var(--phos3); } /* prompt */
.co { color: #44ff88; } /* command */
.fl { color: var(--text3); } /* flag */
/* ── CALLOUTS ── */
.callout {
border-left: 2px solid; padding: 0.8rem 1rem; margin: 1rem 0;
font-size: 0.87rem; line-height: 1.65; font-family: var(--alt);
}
.callout strong {
display: block; font-family: var(--display); font-size: 1rem;
letter-spacing: 0.1em; margin-bottom: 0.3rem;
}
.c-phos { border-color: var(--phos2); background: rgba(57,255,20,0.05); color: var(--phos3); }
.c-amber { border-color: var(--amber); background: rgba(255,176,0,0.05); color: var(--amber); }
.c-cyan { border-color: var(--cyan); background: rgba(0,255,221,0.05); color: var(--cyan); }
.c-red { border-color: var(--red); background: rgba(255,51,68,0.05); color: var(--red); }
.c-blue { border-color: var(--blue); background: rgba(68,136,255,0.05); color: var(--blue); }
/* ── KEYBINDING TABLE ── */
.key-grid {
display: grid; grid-template-columns: auto 1fr;
gap: 0; border: 1px solid var(--border); margin: 0.5rem 0;
}
.key-row {
display: contents;
}
.key-row:hover .key-k, .key-row:hover .key-d { background: rgba(57,255,20,0.06); }
.key-k {
padding: 0.4rem 0.85rem;
border-bottom: 1px solid var(--border2);
border-right: 1px solid var(--border);
font-family: var(--display); font-size: 1rem;
background: var(--crt3); color: var(--phos);
white-space: nowrap; letter-spacing: 0.04em;
display: flex; align-items: center;
}
.key-d {
padding: 0.4rem 0.85rem;
border-bottom: 1px solid var(--border2);
font-family: var(--alt); font-size: 0.83rem;
color: var(--text2); display: flex; align-items: center;
}
.key-row:last-child .key-k,
.key-row:last-child .key-d { border-bottom: none; }
kbd {
display: inline-flex; align-items: center;
font-family: var(--display); font-size: 1rem;
background: var(--phos-dim); border: 1px solid var(--phos2);
color: var(--phos); padding: 0 6px;
letter-spacing: 0.04em; margin: 0 2px;
box-shadow: var(--glow-sm);
}
kbd.amb { background: var(--amb-dim); border-color: var(--amber); color: var(--amber); }
kbd.red { background: var(--red-dim); border-color: var(--red); color: var(--red); }
kbd.cyn { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); }
/* ── SESSION TREE VISUAL ── */
.tree {
font-family: var(--display); font-size: 1.05rem;
letter-spacing: 0.04em; line-height: 2;
background: rgba(0,0,0,0.5); border: 1px solid var(--border);
padding: 1rem 1.25rem; overflow-x: auto;
}
.tree-server { color: var(--amber); }
.tree-session { color: var(--phos); }
.tree-window { color: var(--cyan); }
.tree-pane { color: var(--text2); }
.tree-active { color: var(--phos3); font-weight: 700; }
.tree-indent { color: var(--text3); }
.tree-note { font-family: var(--alt); font-size: 0.75rem; color: var(--text3); margin-left: 1rem; }
/* ── PANE LAYOUT DIAGRAMS ── */
.layout-vis {
border: 1px solid var(--border); background: rgba(0,0,0,0.6);
display: inline-flex; flex-direction: column;
overflow: hidden; margin: 0.5rem 0.5rem 0.5rem 0;
}
.lv-row { display: flex; }
.lv-pane {
border: 1px solid rgba(57,255,20,0.2);
font-family: var(--display); font-size: 0.8rem;
color: var(--text3); display: flex; align-items: center;
justify-content: center; flex-direction: column; gap: 2px;
padding: 4px;
}
.lv-pane.active-p { border-color: var(--phos); color: var(--phos); }
.lv-pane.p-b { border-color: rgba(0,255,221,0.2); color: var(--cyan-dim); }
.lv-n { font-size: 0.65rem; opacity: 0.7; }
/* ── STATUS BAR ANATOMY ── */
.sb-demo {
background: var(--crt3); border: 1px solid var(--border);
font-family: var(--display); font-size: 1.05rem;
letter-spacing: 0.04em; display: flex;
align-items: center; padding: 0; overflow: hidden; margin: 0.5rem 0;
}
.sb-seg {
padding: 4px 12px; white-space: nowrap;
display: flex; align-items: center; gap: 6px;
}
.sbs-phos { background: var(--phos); color: var(--crt); }
.sbs-dim { background: var(--crt4); color: var(--text2); }
.sbs-win { background: var(--crt3); color: var(--text3); border-right: 1px solid var(--border); }
.sbs-winact{ background: var(--phos-dim); color: var(--phos); border-right: 1px solid var(--border); }
.sbs-sp { flex: 1; background: var(--crt2); }
.sbs-amber { background: var(--amb-dim); color: var(--amber); border-left: 1px solid var(--border); }
.sbs-cyan { background: var(--cyan-dim); color: var(--cyan); border-left: 1px solid var(--border); }
/* ── AGENT PANE VIS ── */
.agent-grid {
background: rgba(0,0,0,0.6); border: 1px solid var(--border);
display: grid; gap: 2px; padding: 2px; margin: 1rem 0;
}
.agent-pane {
background: var(--crt2); border: 1px solid var(--border2);
padding: 0.6rem 0.75rem; position: relative; overflow: hidden;
}
.agent-pane.ap-active { border-color: var(--phos); }
.agent-pane.ap-busy { border-color: var(--amber); }
.agent-pane.ap-done { border-color: rgba(57,255,20,0.3); }
.agent-pane.ap-err { border-color: var(--red); }
.ap-title {
font-family: var(--display); font-size: 0.9rem; margin-bottom: 4px;
display: flex; align-items: center; gap: 6px;
}
.ap-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-phos { background: var(--phos); box-shadow: var(--glow-sm); animation: pulseGlow 1.5s infinite; }
.dot-amber { background: var(--amber); animation: pulseAmb 0.8s infinite; }
.dot-dim { background: var(--text3); }
.dot-red { background: var(--red); }
@keyframes pulseGlow { 0%,100%{opacity:1;box-shadow:0 0 6px rgba(57,255,20,0.8)} 50%{opacity:0.5;box-shadow:none} }
@keyframes pulseAmb { 0%,100%{opacity:1} 50%{opacity:0.4} }
.ap-cmd { font-family: var(--display); font-size: 0.8rem; color: var(--text3); line-height: 1.4; }
.ap-log { font-family: var(--display); font-size: 0.75rem; color: var(--text3); margin-top: 4px; }
.ap-cursor::after { content: '▋'; color: var(--phos); animation: blink 1s step-end infinite; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
/* ── PERF ROW ── */
.perf-row { display: grid; grid-template-columns: 180px 1fr 80px; gap: 1rem; align-items: center; padding: 0.45rem 0; border-bottom: 1px solid var(--border2); }
.perf-label { font-family: var(--display); font-size: 0.95rem; color: var(--text2); }
.perf-track { height: 6px; background: var(--crt4); border: 1px solid var(--border2); overflow: hidden; }
.perf-fill { height: 100%; transition: width 1.2s cubic-bezier(.4,0,.2,1); }
.perf-val { font-family: var(--display); font-size: 0.85rem; color: var(--text3); text-align: right; }
/* ── TABLES ── */
table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
th {
font-family: var(--display); font-size: 0.95rem; letter-spacing: 0.1em;
color: var(--phos); border-bottom: 1px solid var(--border);
padding: 0.4rem 0.85rem; text-align: left; background: var(--crt3);
}
td { padding: 0.5rem 0.85rem; border-bottom: 1px solid var(--border2); color: var(--text2); font-family: var(--alt); font-size: 0.83rem; }
tr:last-child td { border-bottom: 1px solid var(--border); }
tr:hover td { background: rgba(57,255,20,0.04); }
td:first-child { color: var(--text); font-family: var(--display); font-size: 0.95rem; }
td code, p code, li code, span code {
font-family: var(--mono); font-size: 0.8em;
background: var(--crt3); border: 1px solid var(--border);
padding: 0 4px; color: var(--phos);
}
/* ── PILLS / TABS ── */
.pills { display: flex; gap: 2px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.pill {
font-family: var(--display); font-size: 0.95rem; padding: 0.2rem 0.85rem;
cursor: pointer; border: 1px solid var(--border);
background: none; color: var(--text3);
transition: all 0.1s; letter-spacing: 0.06em;
}
.pill:hover { border-color: var(--phos); color: var(--phos); }
.pill.active { background: var(--phos-dim); border-color: var(--phos); color: var(--phos); box-shadow: var(--glow-sm); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }
/* ── STAT STRIP ── */
.stat-strip {
display: grid; grid-template-columns: repeat(auto-fit,minmax(110px,1fr));
border: 1px solid var(--border); margin-bottom: 2rem;
background: var(--crt2);
}
.stat { padding: 1rem; text-align: center; border-right: 1px solid var(--border); transition: background 0.12s; }
.stat:last-child { border-right: none; }
.stat:hover { background: var(--crt3); }
.stat-num { font-family: var(--display); font-size: 2.4rem; line-height: 1; margin-bottom: 0.2rem; text-shadow: var(--glow-sm); }
.stat-label { font-family: var(--display); font-size: 0.8rem; color: var(--text3); letter-spacing: 0.08em; }
/* ── SEP ── */
.sep { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
/* ── TEXT ── */
p { margin-bottom: 0.85rem; color: var(--text2); font-family: var(--alt); font-weight: 300; }
p:last-child { margin-bottom: 0; }
h3 { font-family: var(--display); font-size: 1.6rem; letter-spacing: 0.08em; color: var(--phos); margin: 1.75rem 0 0.6rem; text-shadow: var(--glow-sm); }
h3:first-child { margin-top: 0; }
h4 { font-family: var(--display); font-size: 1rem; color: var(--text3); letter-spacing: 0.12em; margin: 1.2rem 0 0.5rem; }
ul,ol { padding-left: 1.5rem; color: var(--text2); font-family: var(--alt); font-weight: 300; }
li { margin-bottom: 0.35rem; }
strong { color: var(--phos3); font-weight: 600; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--crt2); }
::-webkit-scrollbar-thumb { background: var(--crt4); }
</style>
</head>
<body>
<nav style="font-family:'DM Mono',monospace;font-size:0.7rem;padding:8px 16px;background:#1c1a16;color:#b8b0a4;border-bottom:1px solid #333;letter-spacing:0.03em;position:sticky;top:0;z-index:9999;">
<a href="../index.html" style="color:#cc4400;text-decoration:none;">KeGG</a>
<span style="color:#555;margin:0 6px;">/</span>
<span style="color:#b8b0a4;">Masterclasses</span>
<span style="color:#555;margin:0 6px;">/</span>
<span style="color:#f2ece0;">tmux Masterclass — The Terminal Multiplexer</span>
</nav>
<!-- ── HEADER MIMICS A TMUX STATUS BAR ── -->
<header>
<div class="header-inner">
<div class="tmux-left">
<div class="tmux-session-block">[agents]</div>
<button class="tmux-win active" onclick="show('orient',0)"><span class="wnum">0</span> orient</button>
<button class="tmux-win" onclick="show('bindings',1)"><span class="wnum">1</span> keys</button>
<button class="tmux-win" onclick="show('sessions',2)"><span class="wnum">2</span> sessions</button>
<button class="tmux-win" onclick="show('panes',3)"><span class="wnum">3</span> panes</button>
<button class="tmux-win" onclick="show('script',4)"><span class="wnum">4</span> scripting</button>
<button class="tmux-win" onclick="show('agents',5)"><span class="wnum">5</span> agents</button>
<button class="tmux-win" onclick="show('config',6)"><span class="wnum">6</span> config</button>
<button class="tmux-win" onclick="show('plugins',7)"><span class="wnum">7</span> plugins</button>
</div>
<div class="tmux-spacer"></div>
<div class="tmux-right">
<div class="tmux-r-block rb-dim">Sun Apr 5 2026</div>
<div class="tmux-r-block rb-amber">LLM×8</div>
<div class="tmux-r-block rb-phos">tmux 3.4</div>
</div>
</div>
</header>
<div class="wrapper">
<!-- ══════════════════════════════════════
0 — ORIENT
══════════════════════════════════════ -->
<section id="orient" class="active">
<div class="section-header">
<div class="prompt-line">man tmux | head -1</div>
<div class="section-title">THE <em>TERMINAL OS</em></div>
<div class="section-sub">In April 2026, the terminal is the primary interface. Every LLM agent, every pipeline, every dev tool has gone CLI. tmux is no longer optional — it's the window manager, process supervisor, session store, and agent orchestration layer all in one. You need to own it completely.</div>
</div>
<div class="section-rule"></div>
<div class="stat-strip">
<div class="stat"><div class="stat-num" style="color:var(--phos)">1</div><div class="stat-label">server proc</div></div>
<div class="stat"><div class="stat-num" style="color:var(--amber)">∞</div><div class="stat-label">sessions</div></div>
<div class="stat"><div class="stat-num" style="color:var(--cyan)">∞</div><div class="stat-label">windows</div></div>
<div class="stat"><div class="stat-num" style="color:var(--phos)">∞</div><div class="stat-label">panes</div></div>
<div class="stat"><div class="stat-num" style="color:var(--amber)">C-b</div><div class="stat-label">default prefix</div></div>
<div class="stat"><div class="stat-num" style="color:var(--cyan)">C-a</div><div class="stat-label">power-user prefix</div></div>
</div>
<div class="g2">
<div>
<h3>The Object Hierarchy</h3>
<div class="tree">
<span class="tree-server">tmux server</span> <span class="tree-note">─ one daemon process, survives disconnects</span>
<span class="tree-indent">├── </span><span class="tree-session">session: agents</span> <span class="tree-note">─ named workspace</span>
<span class="tree-indent">│ ├── </span><span class="tree-window">window 0: orchestrator</span> <span class="tree-note">─ named tab</span>
<span class="tree-indent">│ │ ├── </span><span class="tree-active">pane 0 [ACTIVE] ← 60%</span>
<span class="tree-indent">│ │ └── </span><span class="tree-pane">pane 1 ← 40%</span>
<span class="tree-indent">│ ├── </span><span class="tree-window">window 1: workers</span>
<span class="tree-indent">│ │ ├── </span><span class="tree-pane">pane 0</span>
<span class="tree-indent">│ │ ├── </span><span class="tree-pane">pane 1</span>
<span class="tree-indent">│ │ └── </span><span class="tree-pane">pane 2</span>
<span class="tree-indent">│ └── </span><span class="tree-window">window 2: logs</span>
<span class="tree-indent">│ └── </span><span class="tree-pane">pane 0</span>
<span class="tree-indent">├── </span><span class="tree-session">session: devenv</span>
<span class="tree-indent">│ └── </span><span class="tree-window">window 0: editor</span>
<span class="tree-indent">└── </span><span class="tree-session">session: monitor</span>
<span class="tree-indent">└── </span><span class="tree-window">window 0: htop + kubectl</span>
</div>
<div class="callout c-phos">
<strong>THE CORE INSIGHT: SESSIONS OUTLIVE YOUR TERMINAL</strong>
When you close your terminal window, your SSH connection drops, or your laptop lid shuts — the tmux server and all sessions keep running. Detach with <kbd>C-b d</kbd>, do anything, reattach later. This is why tmux is non-negotiable for long-running agent jobs — your agent is running inside tmux, not inside your terminal emulator.
</div>
</div>
<div>
<h3>Getting Oriented Fast</h3>
<div class="code-wrap">
<div class="code-header"><span class="code-fname">First 10 commands to learn</span><span class="code-lang">bash</span></div>
<pre><span class="cm"># ── START / ATTACH ────────────────────────────────────</span>
<span class="co">tmux</span> <span class="cm"># new unnamed session</span>
<span class="co">tmux new -s agents</span> <span class="cm"># new named session "agents"</span>
<span class="co">tmux attach -t agents</span> <span class="cm"># attach to session "agents"</span>
<span class="co">tmux a</span> <span class="cm"># attach to most recent session</span>
<span class="co">tmux ls</span> <span class="cm"># list all sessions</span>
<span class="cm"># ── INSIDE TMUX: PREFIX KEY ───────────────────────────</span>
<span class="cm"># Default prefix: Ctrl-b (we'll change to Ctrl-a in config)</span>
<span class="cm"># Every tmux command: PREFIX then the key</span>
<span class="ke">C-b d</span> <span class="cm">→ detach (session keeps running!)</span>
<span class="ke">C-b c</span> <span class="cm">→ create new window</span>
<span class="ke">C-b "</span> <span class="cm">→ split pane horizontally (top/bottom)</span>
<span class="ke">C-b %</span> <span class="cm">→ split pane vertically (left/right)</span>
<span class="ke">C-b arrow</span> <span class="cm">→ move between panes</span>
<span class="ke">C-b z</span> <span class="cm">→ zoom pane to full window (toggle)</span>
<span class="ke">C-b [</span> <span class="cm">→ enter scroll/copy mode (q to exit)</span>
<span class="ke">C-b ?</span> <span class="cm">→ show all keybindings</span>
<span class="ke">C-b :</span> <span class="cm">→ command prompt (type any tmux command)</span>
<span class="cm"># ── POWERFUL COMBOS RIGHT NOW ─────────────────────────</span>
<span class="ke">C-b s</span> <span class="cm">→ interactive session tree (arrow keys + enter)</span>
<span class="ke">C-b w</span> <span class="cm">→ interactive window tree</span>
<span class="ke">C-b $</span> <span class="cm">→ rename current session</span>
<span class="ke">C-b ,</span> <span class="cm">→ rename current window</span></pre>
</div>
<div class="callout c-amber">
<strong>PREFIX KEY MUSCLE MEMORY</strong>
Every single tmux action goes through the prefix key first. The default <kbd>C-b</kbd> (Ctrl+b) is uncomfortable — your pinky stretches. Pros remap to <kbd>C-a</kbd> (Ctrl+a) — same as GNU Screen. The config section covers this. But first, internalize that EVERY tmux key is: <strong>PREFIX → key</strong>. That's it.
</div>
</div>
</div>
<hr class="sep">
<h3>Why Everything Lives in tmux Now (April 2026)</h3>
<div class="g3">
<div class="tpane">
<div class="tpane-bar">session persistence</div>
<div class="tpane-body">
<div class="tpane-label">agents don't care about your ssh session</div>
<p>Run <code>claude --agent research-task</code> inside tmux. Disconnect, travel, reconnect. Agent is still running. Without tmux: SSH drops → agent dies → you start over.</p>
</div>
</div>
<div class="tpane">
<div class="tpane-bar">parallel visibility</div>
<div class="tpane-body">
<div class="tpane-label">see 8 agents at once</div>
<p>Split into a 4×2 grid. Watch all 8 LLM agents simultaneously. One pane per agent: see their output, status, errors — all without switching contexts.</p>
</div>
</div>
<div class="tpane">
<div class="tpane-bar">scripted orchestration</div>
<div class="tpane-body">
<div class="tpane-label">spawn environments in 1 command</div>
<p><code>tmux new-session -d</code> + <code>send-keys</code> lets you write shell scripts that build entire workspace layouts. One script → 8 panes, 3 sessions, all agents running.</p>
</div>
</div>
</div>
</section>
<!-- ══════════════════════════════════════
1 — KEY BINDINGS
══════════════════════════════════════ -->
<section id="bindings">
<div class="section-header">
<div class="prompt-line">tmux list-keys | wc -l</div>
<div class="section-title">KEY <em>BINDINGS</em></div>
<div class="section-sub">The complete reference. Every binding organized by domain. Learn these in order of frequency — sessions first, then panes, then windows, then copy mode.</div>
</div>
<div class="section-rule"></div>
<div class="pills" id="kb-pills">
<button class="pill active" onclick="showTab('kb','sessions',this)">Sessions</button>
<button class="pill" onclick="showTab('kb','windows',this)">Windows</button>
<button class="pill" onclick="showTab('kb','panes',this)">Panes</button>
<button class="pill" onclick="showTab('kb','copy',this)">Copy Mode</button>
<button class="pill" onclick="showTab('kb','misc',this)">Misc</button>
</div>
<div id="kb-sessions" class="tab-pane active">
<div class="g2">
<div>
<div class="key-grid">
<div class="key-row"><div class="key-k"><kbd>C-b d</kbd></div><div class="key-d">Detach from session (session keeps running)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b s</kbd></div><div class="key-d">Interactive session switcher (tree view)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b $</kbd></div><div class="key-d">Rename current session</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b (</kbd></div><div class="key-d">Switch to previous session</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b )</kbd></div><div class="key-d">Switch to next session</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b L</kbd></div><div class="key-d">Switch to last (most recently used) session</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b $</kbd></div><div class="key-d">Rename session</div></div>
</div>
<div class="code-wrap" style="margin-top:1rem">
<div class="code-header"><span class="code-fname">tmux session CLI commands</span><span class="code-lang">bash</span></div>
<pre><span class="co">tmux new-session -s agents</span> <span class="cm"># new session named agents</span>
<span class="co">tmux new-session -s workers -d</span> <span class="cm"># new session, detached (background)</span>
<span class="co">tmux attach-session -t agents</span> <span class="cm"># attach to agents</span>
<span class="co">tmux switch-client -t devenv</span> <span class="cm"># switch to another session</span>
<span class="co">tmux kill-session -t agents</span> <span class="cm"># destroy session + all its windows</span>
<span class="co">tmux kill-server</span> <span class="cm"># nuke everything</span>
<span class="co">tmux list-sessions</span> <span class="cm"># ls alias: tmux ls</span>
<span class="co">tmux rename-session -t old new</span> <span class="cm"># rename from outside</span>
<span class="cm"># Attach or create (the professional entry point):</span>
<span class="co">tmux attach -t agents || tmux new -s agents</span></pre>
</div>
</div>
<div>
<div class="callout c-cyan">
<strong>NAMED SESSIONS — THE PROFESSIONAL PATTERN</strong>
Always name your sessions. <code>tmux new -s agents</code> not <code>tmux</code>. With names: you can attach to the right session by name, script session creation, and glance at <code>tmux ls</code> to understand your workspace instantly. Unnamed sessions are for beginners.
</div>
<h3>Session Grouping</h3>
<div class="code-wrap">
<div class="code-header"><span class="code-fname">Grouped sessions — shared windows</span><span class="code-lang">bash</span></div>
<pre><span class="cm"># Session groups: two clients viewing same windows
# Use case: pair programming, monitoring from two terminals</span>
<span class="cm"># Create first session:</span>
<span class="co">tmux new-session -s main</span>
<span class="cm"># Create second session, join the group:</span>
<span class="co">tmux new-session -s monitor -t main</span>
<span class="cm"># Now both sessions share windows but can independently:
# - Be focused on different windows
# - Have different sizes (useful: big monitor + laptop)
# Changes in one appear in the other in real time</span></pre>
</div>
</div>
</div>
</div>
<div id="kb-windows" class="tab-pane">
<div class="g2">
<div>
<div class="key-grid">
<div class="key-row"><div class="key-k"><kbd>C-b c</kbd></div><div class="key-d">Create new window</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b ,</kbd></div><div class="key-d">Rename current window</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b n</kbd></div><div class="key-d">Next window</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b p</kbd></div><div class="key-d">Previous window</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b l</kbd></div><div class="key-d">Last (most recently used) window</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b 0–9</kbd></div><div class="key-d">Jump to window by number</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b w</kbd></div><div class="key-d">Interactive window picker</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b &</kbd></div><div class="key-d">Kill current window (confirm prompt)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b f</kbd></div><div class="key-d">Find window by name or content</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b .</kbd></div><div class="key-d">Move window to a different index number</div></div>
</div>
</div>
<div>
<div class="code-wrap">
<div class="code-header"><span class="code-fname">Window management from CLI</span><span class="code-lang">bash</span></div>
<pre><span class="cm"># Create named window in a session:</span>
<span class="co">tmux new-window -t agents -n "workers"</span>
<span class="cm"># Create window and run a command in it:</span>
<span class="co">tmux new-window -t agents -n "logs" -c ~/projects</span>
<span class="cm"># Move window from one session to another:</span>
<span class="co">tmux move-window -s agents:2 -t monitor</span>
<span class="cm"># Link window (mirror it across sessions):</span>
<span class="co">tmux link-window -s agents:0 -t monitor:0</span>
<span class="cm"># Kill a specific window without being inside it:</span>
<span class="co">tmux kill-window -t agents:workers</span>
<span class="cm"># Swap two windows:</span>
<span class="co">tmux swap-window -s agents:1 -t agents:3</span>
<span class="cm"># Reorder all windows (renumber from 0):</span>
<span class="co">tmux move-window -r</span></pre>
</div>
<div class="callout c-phos">
<strong>WINDOW NAMING DISCIPLINE</strong>
Always name windows immediately after creation: <kbd>C-b ,</kbd>. In an agent workspace with 8 windows, "agents:0" tells you nothing — "agents:orchestrator" tells you everything. Name for what the window does, not what's running: "logs", "workers", "api", "monitor".
</div>
</div>
</div>
</div>
<div id="kb-panes" class="tab-pane">
<div class="g2">
<div>
<div class="key-grid">
<div class="key-row"><div class="key-k"><kbd>C-b "</kbd></div><div class="key-d">Split horizontal (new pane below)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b %</kbd></div><div class="key-d">Split vertical (new pane right)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b ←→↑↓</kbd></div><div class="key-d">Navigate between panes</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b z</kbd></div><div class="key-d">Zoom/unzoom current pane (fullscreen toggle)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b x</kbd></div><div class="key-d">Kill current pane</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b !</kbd></div><div class="key-d">Break pane out into its own window</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b q</kbd></div><div class="key-d">Show pane numbers (type number to jump)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b o</kbd></div><div class="key-d">Rotate through panes</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b {</kbd></div><div class="key-d">Swap pane with previous</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b }</kbd></div><div class="key-d">Swap pane with next</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b C-←→↑↓</kbd></div><div class="key-d">Resize pane (hold Ctrl, tap arrow)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b space</kbd></div><div class="key-d">Cycle through built-in layouts</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b Alt-1–5</kbd></div><div class="key-d">Jump to specific built-in layout</div></div>
</div>
</div>
<div>
<h3>Built-in Layouts</h3>
<div style="display:flex;flex-wrap:wrap;gap:8px;margin-bottom:1rem">
<div>
<div class="layout-vis" style="width:100px;height:70px">
<div class="lv-row" style="flex:1">
<div class="lv-pane active-p" style="flex:1">even-horizontal<div class="lv-n">Alt-1</div></div>
<div class="lv-pane" style="flex:1"></div>
</div>
</div>
</div>
<div>
<div class="layout-vis" style="width:100px;height:70px">
<div class="lv-row" style="height:50%">
<div class="lv-pane active-p" style="flex:1">even-vert<div class="lv-n">Alt-2</div></div>
</div>
<div class="lv-row" style="height:50%">
<div class="lv-pane p-b" style="flex:1"></div>
</div>
</div>
</div>
<div>
<div class="layout-vis" style="width:100px;height:70px">
<div class="lv-row" style="flex:1">
<div class="lv-pane active-p" style="flex:2">main-horiz<div class="lv-n">Alt-3</div></div>
<div style="display:flex;flex-direction:column;flex:1">
<div class="lv-pane p-b" style="flex:1"></div>
<div class="lv-pane p-b" style="flex:1"></div>
</div>
</div>
</div>
</div>
<div>
<div class="layout-vis" style="width:100px;height:70px">
<div class="lv-row" style="height:60%">
<div class="lv-pane active-p" style="flex:1">main-vert<div class="lv-n">Alt-4</div></div>
</div>
<div class="lv-row" style="height:40%">
<div class="lv-pane p-b" style="flex:1"></div>
<div class="lv-pane p-b" style="flex:1"></div>
</div>
</div>
</div>
<div>
<div class="layout-vis" style="width:100px;height:70px">
<div class="lv-row" style="flex:1">
<div class="lv-pane active-p" style="flex:1">tile<div class="lv-n">Alt-5</div></div>
<div class="lv-pane p-b" style="flex:1"></div>
</div>
<div class="lv-row" style="flex:1">
<div class="lv-pane p-b" style="flex:1"></div>
<div class="lv-pane p-b" style="flex:1"></div>
</div>
</div>
</div>
</div>
<div class="code-wrap">
<div class="code-header"><span class="code-fname">Pane operations from CLI</span><span class="code-lang">bash</span></div>
<pre><span class="cm"># Split pane from CLI (great for scripts):</span>
<span class="co">tmux split-window -h</span> <span class="cm"># split horizontal</span>
<span class="co">tmux split-window -v -p 30</span> <span class="cm"># split vertical, new pane 30% tall</span>
<span class="co">tmux split-window -h -c ~/src</span> <span class="cm"># split, start in directory</span>
<span class="cm"># Move pane to another window:</span>
<span class="co">tmux join-pane -s agents:1.0 -t agents:2</span>
<span class="cm"># Resize precisely:</span>
<span class="co">tmux resize-pane -t 0 -x 80</span> <span class="cm"># set pane 0 to exactly 80 cols</span>
<span class="co">tmux resize-pane -Z</span> <span class="cm"># toggle zoom (same as C-b z)</span>
<span class="cm"># Apply a layout by name:</span>
<span class="co">tmux select-layout tiled</span>
<span class="co">tmux select-layout main-vertical</span></pre>
</div>
</div>
</div>
</div>
<div id="kb-copy" class="tab-pane">
<div class="g2">
<div>
<h3>Copy Mode — The Terminal Pager</h3>
<div class="callout c-phos">
<strong>Copy Mode = vim/emacs Inside Terminal</strong>
Press <kbd>C-b [</kbd> to enter copy mode. You're now in a scrollable buffer of your terminal's entire output history. Navigate with vim keys (or emacs if configured). Select text, copy it, paste with <kbd>C-b ]</kbd>. This replaces your mouse for every text operation in the terminal.
</div>
<div class="key-grid">
<div class="key-row"><div class="key-k"><kbd>C-b [</kbd></div><div class="key-d">Enter copy/scroll mode</div></div>
<div class="key-row"><div class="key-k"><kbd>q</kbd></div><div class="key-d">Exit copy mode</div></div>
<div class="key-row"><div class="key-k"><kbd>Space</kbd></div><div class="key-d">Start selection (vi mode)</div></div>
<div class="key-row"><div class="key-k"><kbd>Enter</kbd></div><div class="key-d">Copy selection and exit</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b ]</kbd></div><div class="key-d">Paste buffer</div></div>
<div class="key-row"><div class="key-k"><kbd>g / G</kbd></div><div class="key-d">Jump to top / bottom of history</div></div>
<div class="key-row"><div class="key-k"><kbd>/ text</kbd></div><div class="key-d">Search forward</div></div>
<div class="key-row"><div class="key-k"><kbd>? text</kbd></div><div class="key-d">Search backward</div></div>
<div class="key-row"><div class="key-k"><kbd>n / N</kbd></div><div class="key-d">Next / previous search result</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b =</kbd></div><div class="key-d">Choose from paste buffer list</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b #</kbd></div><div class="key-d">List all paste buffers</div></div>
</div>
</div>
<div>
<div class="code-wrap">
<div class="code-header"><span class="code-fname">vi-mode copy config (put in .tmux.conf)</span><span class="code-lang">bash</span></div>
<pre><span class="cm"># Enable vi keys in copy mode:</span>
set-window-option -g mode-keys vi
<span class="cm"># vi-style selection and copy:</span>
bind-key -T copy-mode-vi v send-keys -X begin-selection
bind-key -T copy-mode-vi y send-keys -X copy-selection-and-cancel
bind-key -T copy-mode-vi C-v send-keys -X rectangle-toggle
<span class="cm"># Mouse: click to select, double-click word, drag to select:</span>
set -g mouse on
<span class="cm"># System clipboard integration (macOS):</span>
bind-key -T copy-mode-vi y \
send-keys -X copy-pipe-and-cancel "pbcopy"
<span class="cm"># System clipboard integration (Linux/X11):</span>
bind-key -T copy-mode-vi y \
send-keys -X copy-pipe-and-cancel "xclip -selection clipboard"
<span class="cm"># System clipboard integration (Linux/Wayland):</span>
bind-key -T copy-mode-vi y \
send-keys -X copy-pipe-and-cancel "wl-copy"
<span class="cm"># Increase scrollback buffer (default is only 2000 lines!):</span>
set -g history-limit 50000</pre>
</div>
<div class="callout c-amber">
<strong>SCROLLBACK LIMIT IS 2000 BY DEFAULT</strong>
The default history limit is laughably small for agent workloads. Set <code>history-limit 50000</code> or even higher. At 50k lines of terminal output per pane, 8 agent panes = 400k lines in RAM — totally fine on modern hardware. Your agent's 3-hour log output needs to be searchable.
</div>
</div>
</div>
</div>
<div id="kb-misc" class="tab-pane">
<div class="g2">
<div>
<div class="key-grid">
<div class="key-row"><div class="key-k"><kbd>C-b ?</kbd></div><div class="key-d">Show all keybindings (searchable)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b :</kbd></div><div class="key-d">Command prompt — type any tmux command</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b t</kbd></div><div class="key-d">Show a clock in current pane</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b ~</kbd></div><div class="key-d">Show tmux message log</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b r</kbd></div><div class="key-d">Reload config (after bind-key r below)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b C-z</kbd></div><div class="key-d">Suspend the tmux client</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b i</kbd></div><div class="key-d">Display pane info (index, size, command)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b D</kbd></div><div class="key-d">Choose client to detach (multi-client)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b m</kbd></div><div class="key-d">Mark current pane (for join-pane later)</div></div>
<div class="key-row"><div class="key-k"><kbd>C-b M</kbd></div><div class="key-d">Clear the marked pane</div></div>
</div>
</div>
<div>
<div class="code-wrap">
<div class="code-header"><span class="code-fname">show-options — inspect current config</span><span class="code-lang">bash</span></div>
<pre><span class="cm"># From inside tmux command prompt (C-b :)
# or from shell with tmux prefix:</span>
<span class="co">tmux show-options -g</span> <span class="cm"># all global options</span>
<span class="co">tmux show-options -g prefix</span> <span class="cm"># current prefix key</span>
<span class="co">tmux show-window-options -g</span> <span class="cm"># window-specific options</span>
<span class="co">tmux show-environment</span> <span class="cm"># tmux environment variables</span>
<span class="co">tmux display-message '#{session_name}'</span> <span class="cm"># current session name</span>
<span class="co">tmux display-message '#{window_index}'</span> <span class="cm"># current window index</span>
<span class="co">tmux display-message '#{pane_current_command}'</span> <span class="cm"># running command</span>
<span class="co">tmux display-message '#{pane_pid}'</span> <span class="cm"># PID of shell in pane</span>
<span class="cm"># List all format variables:</span>
<span class="co">tmux display-message -a | less</span> <span class="cm"># 200+ variables available</span></pre>
</div>
</div>
</div>
</div>
</section>
<!-- ══════════════════════════════════════
2 — SESSIONS
══════════════════════════════════════ -->
<section id="sessions">
<div class="section-header">
<div class="prompt-line">tmux ls</div>
<div class="section-title">SESSION <em>MASTERY</em></div>
<div class="section-sub">Sessions are your persistent workspaces. Design them with intent. One session per project, per client, per agent cluster. Name them. Script their creation. Never lose context again.</div>
</div>
<div class="section-rule"></div>
<div class="g2">
<div>
<h3>Session Design Patterns</h3>
<div class="code-wrap">
<div class="code-header"><span class="code-fname">Professional session layout</span><span class="code-lang">bash</span></div>
<pre><span class="cm"># Pattern: one session per project or concern
# tmux ls output of a mature workspace:</span>
<span class="pr">$</span> <span class="co">tmux ls</span>
agents: 3 windows (created Mon Apr 5 09:00:26 2026)
devenv: 2 windows (created Mon Apr 5 08:45:01 2026) (attached)
monitor: 1 window (created Mon Apr 5 08:45:55 2026)
infra: 4 windows (created Sun Apr 4 22:15:00 2026)
<span class="cm"># Switch between sessions instantly:
# C-b s → interactive tree
# C-b ( → previous session
# C-b ) → next session
# C-b L → last used session
# C-b :switch-client -t agents → by name</span>
<span class="cm"># Quick-switch with fzf (add to shell .zshrc/.bashrc):</span>
<span class="co">alias ts='tmux switch-client -t $(tmux ls -F "#{session_name}" | fzf)'</span>
<span class="co">alias ta='tmux attach -t $(tmux ls -F "#{session_name}" | fzf)'</span>
<span class="cm"># The "attach or create" pattern — put in a shell alias:</span>
<span class="kw">function</span> <span class="fn">t</span>() {
<span class="kw">if</span> [ -z "<span class="jj">$1</span>" ]; <span class="kw">then</span>
<span class="co">tmux attach</span> <span class="nu">2>/dev/null</span> || <span class="co">tmux new-session -s main</span>
<span class="kw">else</span>
<span class="co">tmux attach -t</span> "<span class="jj">$1</span>" <span class="nu">2>/dev/null</span> || <span class="co">tmux new-session -s</span> "<span class="jj">$1</span>"
<span class="kw">fi</span>
}
<span class="cm"># Usage: t → attach to most recent
# t agents → attach or create "agents"</span></pre>
</div>
</div>
<div>
<h3>Session Persistence Beyond Reboots</h3>
<div class="callout c-red">
<strong>tmux dies on system reboot</strong>
The tmux server is a process — it survives disconnects but not reboots. For true persistence: use <code>tmux-resurrect</code> (saves/restores session layout) + <code>tmux-continuum</code> (auto-saves every N minutes). The Plugins section covers this. This is critical for long-running agent pipelines.
</div>
<div class="code-wrap">
<div class="code-header"><span class="code-fname">Session environment + variables</span><span class="code-lang">bash</span></div>
<pre><span class="cm"># Set environment variable visible to all panes in session:</span>
<span class="co">tmux set-environment -t agents OPENAI_API_KEY sk-proj-...</span>
<span class="co">tmux set-environment -g LOG_LEVEL debug</span> <span class="cm"># global (all sessions)</span>
<span class="cm"># Remove a variable:</span>
<span class="co">tmux set-environment -r OPENAI_API_KEY</span>
<span class="cm"># Show session environment:</span>
<span class="co">tmux show-environment -t agents</span>
<span class="cm"># Access in shell (new panes inherit at creation time):</span>
<span class="pr">$</span> <span class="co">echo $OPENAI_API_KEY</span> <span class="cm"># works in new panes</span>
<span class="cm"># Lock a session (password-protect it):</span>
<span class="co">tmux lock-session -t sensitive</span>
<span class="cm"># Set a session-specific working directory:</span>
<span class="co">tmux new-session -s agents -c ~/projects/agents</span>
<span class="cm"># All new windows/panes in "agents" start in ~/projects/agents</span></pre>
</div>
</div>
</div>
</section>
<!-- ══════════════════════════════════════
3 — PANES
══════════════════════════════════════ -->
<section id="panes">
<div class="section-header">
<div class="prompt-line">tmux split-window -h && tmux split-window -v</div>
<div class="section-title">PANE <em>POWER</em></div>
<div class="section-sub">Panes are where work happens. Splitting, navigating, synchronizing, and monitoring panes is the core operational skill of the tmux power user. This section covers everything including the killer feature: synchronized panes.</div>