aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/plugin_api
diff options
context:
space:
mode:
authorYacine Hmito <6893840+yacinehmito@users.noreply.github.com>2026-03-09 14:55:14 +0100
committerGitHub <noreply@github.com>2026-03-09 14:55:14 +0100
commit0172836fda1eb97005ec536571714998f48ad2e2 (patch)
tree76aa93a7f7d2bc9e7453a80e2a95af63a63ea68a /zellij-utils/src/plugin_api
parentRemove unnecessary winapi features (#4816) (diff)
downloadsl0ppij-0172836fda1eb97005ec536571714998f48ad2e2.tar.gz
sl0ppij-0172836fda1eb97005ec536571714998f48ad2e2.tar.xz
sl0ppij-0172836fda1eb97005ec536571714998f48ad2e2.zip
feat(cli): add --pane-id option to dump-screen action (#4598)
* feat(cli): add --pane-id option to dump-screen action Adds the ability to dump a specific terminal pane's content by passing `--pane-id <ID>` to the `dump-screen` CLI action. When omitted, the existing behavior of dumping the focused pane is preserved. This enables coding agents running inside Zellij to inspect the content of other panes programmatically, without needing complex workarounds. Prior art: https://github.com/theslyprofessor/zellij-pane-tracker, whose design complexity is due to current limitations that this PR addresses. * address review * improve man page entry
Diffstat (limited to 'zellij-utils/src/plugin_api')
-rw-r--r--zellij-utils/src/plugin_api/action.proto1
-rw-r--r--zellij-utils/src/plugin_api/action.rs4
2 files changed, 5 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/action.proto b/zellij-utils/src/plugin_api/action.proto
index e4a42668..169bc24f 100644
--- a/zellij-utils/src/plugin_api/action.proto
+++ b/zellij-utils/src/plugin_api/action.proto
@@ -381,6 +381,7 @@ message WriteCharsPayload {
message DumpScreenPayload {
string file_path = 1;
bool include_scrollback = 2;
+ optional PaneId pane_id = 3;
}
enum ActionName {
diff --git a/zellij-utils/src/plugin_api/action.rs b/zellij-utils/src/plugin_api/action.rs
index b115b86d..5ccd349c 100644
--- a/zellij-utils/src/plugin_api/action.rs
+++ b/zellij-utils/src/plugin_api/action.rs
@@ -213,9 +213,11 @@ impl TryFrom<ProtobufAction> for Action {
Some(OptionalPayload::DumpScreenPayload(payload)) => {
let file_path = payload.file_path;
let include_scrollback = payload.include_scrollback;
+ let pane_id = payload.pane_id.and_then(|p| p.try_into().ok());
Ok(Action::DumpScreen {
file_path,
include_scrollback,
+ pane_id,
})
},
_ => Err("Wrong payload for Action::DumpScreen"),
@@ -1146,11 +1148,13 @@ impl TryFrom<Action> for ProtobufAction {
Action::DumpScreen {
file_path,
include_scrollback,
+ pane_id,
} => Ok(ProtobufAction {
name: ProtobufActionName::DumpScreen as i32,
optional_payload: Some(OptionalPayload::DumpScreenPayload(DumpScreenPayload {
file_path,
include_scrollback,
+ pane_id: pane_id.and_then(|p| p.try_into().ok()),
})),
}),
Action::EditScrollback => Ok(ProtobufAction {