panesync toggle <- panesync commit

This commit is contained in:
2026-06-19 15:26:00 +02:00
parent a6a700b2c0
commit 7367b2f778
5 changed files with 11 additions and 23 deletions

View File

@@ -172,7 +172,6 @@ open_scrollback = "ALT+S"
create_worktree = "ALT+W" create_worktree = "ALT+W"
pane_sync_toggle = "ALT+Y" pane_sync_toggle = "ALT+Y"
pane_sync_select = "SPACE" pane_sync_select = "SPACE"
pane_sync_commit = "ALT+SHIFT+Y"
paste = "CTRL+SHIFT+V" paste = "CTRL+SHIFT+V"
``` ```
@@ -191,10 +190,9 @@ paste = "CTRL+SHIFT+V"
- `Alt+s`: open the active pane scrollback in `$EDITOR` - `Alt+s`: open the active pane scrollback in `$EDITOR`
- `Alt+w`: edit a worktree name, then run `git worktree add <relative_worktree_path>/<name>` - `Alt+w`: edit a worktree name, then run `git worktree add <relative_worktree_path>/<name>`
from the previously focused pane's working directory from the previously focused pane's working directory
- `Alt+y`: enter pane-sync selection mode, cancel selection mode, or stop an active pane sync - `Alt+y`: enter pane-sync selection mode, commit the selection, or stop an active pane sync
- `Space`: toggle the focused pane in the sync set while pane-sync selection mode is active - `Space`: toggle the focused pane in the sync set while pane-sync selection mode is active
- `Alt+Shift+y`: commit the current pane-sync selection; input typed or pasted into any synced - Once committed, input typed or pasted into any synced pane is mirrored to the other synced panes
pane is mirrored to the other synced panes
- `Ctrl+Shift+v`: paste - `Ctrl+Shift+v`: paste
- Font default: `JetBrainsMono Nerd Font` - Font default: `JetBrainsMono Nerd Font`
- Kitty graphics protocol parsing is enabled by default - Kitty graphics protocol parsing is enabled by default

View File

@@ -43,5 +43,4 @@ open_scrollback = "ALT+S"
create_worktree = "ALT+W" create_worktree = "ALT+W"
pane_sync_toggle = "ALT+Y" pane_sync_toggle = "ALT+Y"
pane_sync_select = "SPACE" pane_sync_select = "SPACE"
pane_sync_commit = "ALT+SHIFT+Y"
paste = "CTRL+SHIFT+V" paste = "CTRL+SHIFT+V"

View File

@@ -52,7 +52,6 @@ public record AppConfig(
"create_worktree", "create_worktree",
"pane_sync_toggle", "pane_sync_toggle",
"pane_sync_select", "pane_sync_select",
"pane_sync_commit",
"paste" "paste"
); );
@@ -121,7 +120,6 @@ public record AppConfig(
Map.entry("create_worktree", KeyBinding.parse("ALT+W")), Map.entry("create_worktree", KeyBinding.parse("ALT+W")),
Map.entry("pane_sync_toggle", KeyBinding.parse("ALT+Y")), Map.entry("pane_sync_toggle", KeyBinding.parse("ALT+Y")),
Map.entry("pane_sync_select", KeyBinding.parse("SPACE")), Map.entry("pane_sync_select", KeyBinding.parse("SPACE")),
Map.entry("pane_sync_commit", KeyBinding.parse("ALT+SHIFT+Y")),
Map.entry("paste", KeyBinding.parse("CTRL+SHIFT+V")) Map.entry("paste", KeyBinding.parse("CTRL+SHIFT+V"))
) )
); );

View File

@@ -145,9 +145,16 @@ public final class Compositor {
} }
public void togglePaneSync() { public void togglePaneSync() {
if (paneSyncSelectMode || !paneSyncPanes.isEmpty()) { if (paneSyncSelectMode) {
paneSyncPanes.clear();
paneSyncPanes.addAll(paneSyncSelection);
paneSyncSelectMode = false; paneSyncSelectMode = false;
paneSyncSelection.clear(); paneSyncSelection.clear();
prunePaneSyncState();
layoutVersion++;
return;
}
if (!paneSyncPanes.isEmpty()) {
paneSyncPanes.clear(); paneSyncPanes.clear();
layoutVersion++; layoutVersion++;
return; return;
@@ -171,18 +178,6 @@ public final class Compositor {
layoutVersion++; layoutVersion++;
} }
public void commitPaneSyncSelection() {
if (!paneSyncSelectMode) {
return;
}
paneSyncPanes.clear();
paneSyncPanes.addAll(paneSyncSelection);
paneSyncSelection.clear();
paneSyncSelectMode = false;
prunePaneSyncState();
layoutVersion++;
}
public List<TerminalPane> paneSyncPeers(TerminalPane source) { public List<TerminalPane> paneSyncPeers(TerminalPane source) {
prunePaneSyncState(); prunePaneSyncState();
if (source == null || !paneSyncPanes.contains(source)) { if (source == null || !paneSyncPanes.contains(source)) {

View File

@@ -74,7 +74,6 @@ final class TerminalWindow {
keyActions.put("create_worktree", this::createWorktreeInEditor); keyActions.put("create_worktree", this::createWorktreeInEditor);
keyActions.put("pane_sync_toggle", compositor::togglePaneSync); keyActions.put("pane_sync_toggle", compositor::togglePaneSync);
keyActions.put("pane_sync_select", compositor::togglePaneSyncSelection); keyActions.put("pane_sync_select", compositor::togglePaneSyncSelection);
keyActions.put("pane_sync_commit", compositor::commitPaneSyncSelection);
keyActions.put("paste", this::pasteFromClipboard); keyActions.put("paste", this::pasteFromClipboard);
StackPane root = new StackPane(compositor.canvas(), compositor.imageOverlay()); StackPane root = new StackPane(compositor.canvas(), compositor.imageOverlay());
@@ -169,8 +168,7 @@ final class TerminalWindow {
"previous_tab", "previous_tab",
"next_tab", "next_tab",
"pane_sync_toggle", "pane_sync_toggle",
"pane_sync_select", "pane_sync_select" -> true;
"pane_sync_commit" -> true;
default -> false; default -> false;
}; };
} }