feat(multi): tmux keys to toggle broadcast and exclude single panes
In windows opened by netssh multi, prefix S toggles broadcast for all panes and prefix e excludes the current pane (a pane-level synchronize-panes off, shown as [SOLO] in the border) or includes it again. netssh sync --pane does the same from a shell. S and e are unbound in a default tmux (E would be "spread evenly"). netssh writes the bindings to a small tmux config and sources it, binds a key only if the user's tmux.conf does not use it (netssh's own earlier binding is refreshed), and the bindings act only in windows marked @netssh. multi.sync_key and multi.solo_key change the keys or turn them off (none); also in the configurator. zellij syncs whole tabs only, so excluding a pane is tmux-only. testenv: the render test presses the keys through the xterm client (send-keys -K) and checks [SOLO], that broadcast skips the excluded pane, that S toggles, and that other windows are unaffected. The client gets GNU grep: BusyBox grep -oF counted only one match per line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
699b9469b6
commit
396d489187
14 files changed
+342
-31
No files matched your search
@@ -196,7 +196,15 @@ func TestMultiConfig(t *testing.T) {
|
||||
if err != nil || len(cfg.Groups["k8s"]) != 2 || cfg.Multi.Multiplexer != "zellij" || cfg.Multi.PanesPerWindowOrDefault() != 9 {
|
||||
t.Fatalf("%+v %v", cfg, err)
|
||||
}
|
||||
for _, bad := range []string{"multi: {multiplexer: screen}", "multi: {panes_per_window: 100}", "groups: {web: []}", "groups: {web: [\"a b\"]}"} {
|
||||
if sync, solo := cfg.Multi.Keys(); sync != "S" || solo != "e" {
|
||||
t.Fatalf("default keys %q %q", sync, solo)
|
||||
}
|
||||
custom, err := loadYAML(t, "multi: {sync_key: C-s, solo_key: none}\n")
|
||||
if sync, solo := custom.Multi.Keys(); err != nil || sync != "C-s" || solo != "" {
|
||||
t.Fatalf("custom keys %q %q %v", sync, solo, err)
|
||||
}
|
||||
for _, bad := range []string{"multi: {multiplexer: screen}", "multi: {panes_per_window: 100}", "groups: {web: []}", "groups: {web: [\"a b\"]}",
|
||||
"multi: {sync_key: \"x y\"}", "multi: {sync_key: \"{\"}", "multi: {sync_key: e}"} {
|
||||
if _, err := loadYAML(t, bad+"\n"); err == nil {
|
||||
t.Errorf("%s accepted", bad)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user