aboutsummaryrefslogtreecommitdiffstats
path: root/zellij-utils/src/ipc/protobuf_conversion.rs
diff options
context:
space:
mode:
authorAram Drevekenin <aram@poor.dev>2026-03-09 15:37:42 +0100
committerGitHub <noreply@github.com>2026-03-09 15:37:42 +0100
commit47ba6331c36f1b55f1a7d7ad3c0ab511629586a3 (patch)
tree37faab2182e15a2bc137991d37f282439df9ebc6 /zellij-utils/src/ipc/protobuf_conversion.rs
parentdocs(changelog): dump viewport of pane id (diff)
downloadsl0ppij-47ba6331c36f1b55f1a7d7ad3c0ab511629586a3.tar.gz
sl0ppij-47ba6331c36f1b55f1a7d7ad3c0ab511629586a3.tar.xz
sl0ppij-47ba6331c36f1b55f1a7d7ad3c0ab511629586a3.zip
allow dumping screen to STDOUT as well (#4823)
Diffstat (limited to 'zellij-utils/src/ipc/protobuf_conversion.rs')
-rw-r--r--zellij-utils/src/ipc/protobuf_conversion.rs21
1 files changed, 15 insertions, 6 deletions
diff --git a/zellij-utils/src/ipc/protobuf_conversion.rs b/zellij-utils/src/ipc/protobuf_conversion.rs
index 3551895d..cc2a3555 100644
--- a/zellij-utils/src/ipc/protobuf_conversion.rs
+++ b/zellij-utils/src/ipc/protobuf_conversion.rs
@@ -891,11 +891,15 @@ impl From<crate::input::actions::Action>
file_path,
include_scrollback,
pane_id,
- } => ActionType::DumpScreen(DumpScreenAction {
- file_path,
- include_scrollback,
- pane_id: pane_id.map(|p| p.into()),
- }),
+ } => {
+ let dump_to_stdout = file_path.is_none();
+ ActionType::DumpScreen(DumpScreenAction {
+ file_path: file_path.unwrap_or_default(),
+ include_scrollback,
+ pane_id: pane_id.map(|p| p.into()),
+ dump_to_stdout,
+ })
+ },
crate::input::actions::Action::DumpLayout => {
ActionType::DumpLayout(DumpLayoutAction {})
},
@@ -1569,8 +1573,13 @@ impl TryFrom<crate::client_server_contract::client_server_contract::Action>
},
ActionType::ClearScreen(_) => Ok(crate::input::actions::Action::ClearScreen),
ActionType::DumpScreen(dump_screen_action) => {
+ let file_path = if dump_screen_action.dump_to_stdout {
+ None
+ } else {
+ Some(dump_screen_action.file_path)
+ };
Ok(crate::input::actions::Action::DumpScreen {
- file_path: dump_screen_action.file_path,
+ file_path,
include_scrollback: dump_screen_action.include_scrollback,
pane_id: dump_screen_action.pane_id.and_then(|p| p.try_into().ok()),
})