Atomic show hide floating panes (#4764)

* atomic show/hide floating panes (cli, plugin API, keybinding)

* rustfmt

* add pr
This commit is contained in:
Aram Drevekenin
2026-02-25 09:48:47 +01:00
committed by GitHub
parent b961c1f3d2
commit 6e0dd8e51c
19 changed files with 602 additions and 53 deletions
+1
View File
@@ -63,6 +63,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
* fix: preserve cwd when opening editor panes (https://github.com/zellij-org/zellij/pull/4593)
* feat: allow specifying "close_on_exit" when opening panes in place from keybinding or cli (https://github.com/zellij-org/zellij/pull/4760)
* fix: respect cursor blink and shape in the web client even when terminal attempts to override it (https://github.com/zellij-org/zellij/pull/4762)
* feat: allow cli/plugins/keybindings to atomically show/hide floating panes rather than just toggle (https://github.com/zellij-org/zellij/pull/4764)
## [0.43.1] - 2025-08-08
+79 -11
View File
@@ -73,16 +73,17 @@ use zellij_utils::{
ProtobufLayoutParsingError, ProtobufPaneScrollbackResponse, ProtobufSyntaxError,
},
plugin_command::{
dump_layout_response, dump_session_layout_response, parse_layout_response,
save_session_response, ProtobufBreakPanesToNewTabResponse,
ProtobufBreakPanesToTabWithIdResponse, ProtobufBreakPanesToTabWithIndexResponse,
ProtobufDeleteLayoutResponse, ProtobufDumpLayoutResponse,
ProtobufDumpSessionLayoutResponse, ProtobufEditLayoutResponse,
ProtobufFocusOrCreateTabResponse, ProtobufGenerateRandomNameResponse,
ProtobufGetFocusedPaneInfoResponse, ProtobufGetLayoutDirResponse,
ProtobufGetPaneCwdResponse, ProtobufGetPaneInfoResponse, ProtobufGetPanePidResponse,
ProtobufGetPaneRunningCommandResponse, ProtobufGetSessionEnvironmentVariablesResponse,
ProtobufGetTabInfoResponse, ProtobufNewTabResponse, ProtobufNewTabsResponse,
dump_layout_response, dump_session_layout_response, hide_floating_panes_response,
parse_layout_response, save_session_response, show_floating_panes_response,
ProtobufBreakPanesToNewTabResponse, ProtobufBreakPanesToTabWithIdResponse,
ProtobufBreakPanesToTabWithIndexResponse, ProtobufDeleteLayoutResponse,
ProtobufDumpLayoutResponse, ProtobufDumpSessionLayoutResponse,
ProtobufEditLayoutResponse, ProtobufFocusOrCreateTabResponse,
ProtobufGenerateRandomNameResponse, ProtobufGetFocusedPaneInfoResponse,
ProtobufGetLayoutDirResponse, ProtobufGetPaneCwdResponse, ProtobufGetPaneInfoResponse,
ProtobufGetPanePidResponse, ProtobufGetPaneRunningCommandResponse,
ProtobufGetSessionEnvironmentVariablesResponse, ProtobufGetTabInfoResponse,
ProtobufHideFloatingPanesResponse, ProtobufNewTabResponse, ProtobufNewTabsResponse,
ProtobufOpenCommandPaneBackgroundResponse,
ProtobufOpenCommandPaneFloatingNearPluginResponse,
ProtobufOpenCommandPaneFloatingResponse,
@@ -99,6 +100,7 @@ use zellij_utils::{
ProtobufOpenTerminalPaneInPlaceOfPaneIdResponse, ProtobufOpenTerminalResponse,
ProtobufParseLayoutResponse, ProtobufPluginCommand, ProtobufRenameLayoutResponse,
ProtobufSaveLayoutResponse, ProtobufSaveSessionResponse,
ProtobufShowFloatingPanesResponse,
},
plugin_ids::{ProtobufPluginIds, ProtobufZellijVersion},
},
@@ -732,6 +734,8 @@ fn host_run_plugin_command(mut caller: Caller<'_, PluginEnv>) {
close_replaced_pane,
context,
),
PluginCommand::ShowFloatingPanes { tab_id } => show_floating_panes(env, tab_id),
PluginCommand::HideFloatingPanes { tab_id } => hide_floating_panes(env, tab_id),
},
(PermissionStatus::Denied, permission) => {
log::error!(
@@ -3301,6 +3305,68 @@ fn save_session(env: &PluginEnv) {
let _ = wasi_write_object(env, &response.encode_to_vec());
}
fn show_floating_panes(env: &PluginEnv, tab_id: Option<usize>) {
use show_floating_panes_response::Result as ShowResult;
let (completion_tx, completion_rx) = oneshot::channel();
let send_result = env
.senders
.send_to_screen(ScreenInstruction::ShowFloatingPanes {
client_id: env.client_id,
tab_id,
completion: Some(NotificationEnd::new(completion_tx)),
});
let response = if let Err(e) = send_result {
ProtobufShowFloatingPanesResponse {
result: Some(ShowResult::Error(format!("{}", e))),
}
} else {
let result = wait_for_action_completion(completion_rx, "show_floating_panes", false);
match result.exit_status {
Some(0) => ProtobufShowFloatingPanesResponse {
result: Some(ShowResult::Success(true)),
},
Some(2) => ProtobufShowFloatingPanesResponse {
result: Some(ShowResult::Success(false)),
},
_ => ProtobufShowFloatingPanesResponse {
result: Some(ShowResult::Error("Tab not found".to_string())),
},
}
};
let _ = wasi_write_object(env, &response.encode_to_vec());
}
fn hide_floating_panes(env: &PluginEnv, tab_id: Option<usize>) {
use hide_floating_panes_response::Result as HideResult;
let (completion_tx, completion_rx) = oneshot::channel();
let send_result = env
.senders
.send_to_screen(ScreenInstruction::HideFloatingPanes {
client_id: env.client_id,
tab_id,
completion: Some(NotificationEnd::new(completion_tx)),
});
let response = if let Err(e) = send_result {
ProtobufHideFloatingPanesResponse {
result: Some(HideResult::Error(format!("{}", e))),
}
} else {
let result = wait_for_action_completion(completion_rx, "hide_floating_panes", false);
match result.exit_status {
Some(0) => ProtobufHideFloatingPanesResponse {
result: Some(HideResult::Success(true)),
},
Some(2) => ProtobufHideFloatingPanesResponse {
result: Some(HideResult::Success(false)),
},
_ => ProtobufHideFloatingPanesResponse {
result: Some(HideResult::Error("Tab not found".to_string())),
},
}
};
let _ = wasi_write_object(env, &response.encode_to_vec());
}
fn current_session_last_saved_time(env: &PluginEnv) {
use zellij_utils::plugin_api::plugin_command::ProtobufCurrentSessionLastSavedTimeResponse;
@@ -4991,7 +5057,9 @@ fn check_command_permission(
| PluginCommand::SaveLayout { .. }
| PluginCommand::DeleteLayout { .. }
| PluginCommand::RenameLayout { .. }
| PluginCommand::EditLayout { .. } => PermissionType::ChangeApplicationState,
| PluginCommand::EditLayout { .. }
| PluginCommand::ShowFloatingPanes { .. }
| PluginCommand::HideFloatingPanes { .. } => PermissionType::ChangeApplicationState,
PluginCommand::UnblockCliPipeInput(..)
| PluginCommand::BlockCliPipeInput(..)
| PluginCommand::CliPipeOutput(..) => PermissionType::ReadCliPipes,
+18
View File
@@ -1749,6 +1749,24 @@ pub(crate) fn route_action(
))
.with_context(err_context)?;
},
Action::ShowFloatingPanes { tab_id } => {
senders
.send_to_screen(ScreenInstruction::ShowFloatingPanes {
client_id,
tab_id,
completion: Some(NotificationEnd::new(completion_tx)),
})
.with_context(err_context)?;
},
Action::HideFloatingPanes { tab_id } => {
senders
.send_to_screen(ScreenInstruction::HideFloatingPanes {
client_id,
tab_id,
completion: Some(NotificationEnd::new(completion_tx)),
})
.with_context(err_context)?;
},
}
let result = wait_for_action_completion(completion_rx, &action_name, wait_forever);
if let Some(exit_status) = result.exit_status {
+76
View File
@@ -262,6 +262,16 @@ pub enum ScreenInstruction {
OpenInPlaceEditor(PaneId, ClientTabIndexOrPaneId),
TogglePaneEmbedOrFloating(ClientId, Option<NotificationEnd>),
ToggleFloatingPanes(ClientId, Option<TerminalAction>, Option<NotificationEnd>),
ShowFloatingPanes {
client_id: ClientId,
tab_id: Option<usize>,
completion: Option<NotificationEnd>,
},
HideFloatingPanes {
client_id: ClientId,
tab_id: Option<usize>,
completion: Option<NotificationEnd>,
},
WriteCharacter(
Option<KeyWithModifier>,
Vec<u8>,
@@ -667,6 +677,8 @@ impl From<&ScreenInstruction> for ScreenContext {
ScreenContext::TogglePaneEmbedOrFloating
},
ScreenInstruction::ToggleFloatingPanes(..) => ScreenContext::ToggleFloatingPanes,
ScreenInstruction::ShowFloatingPanes { .. } => ScreenContext::ShowFloatingPanes,
ScreenInstruction::HideFloatingPanes { .. } => ScreenContext::HideFloatingPanes,
ScreenInstruction::WriteCharacter(..) => ScreenContext::WriteCharacter,
ScreenInstruction::Resize(.., strategy, _) => match strategy {
ResizeStrategy {
@@ -1897,6 +1909,52 @@ impl Screen {
self.get_tabs_mut().get_mut(&tab_index)
}
pub fn show_floating_panes_in_tab(
&mut self,
client_id: ClientId,
tab_id: Option<usize>,
completion: Option<NotificationEnd>,
) -> Result<()> {
let tab = match tab_id {
Some(id) => self.tabs.get_mut(&id),
None => self.get_active_tab_mut(client_id).ok(),
};
match tab {
None => {
let mut completion = completion;
if let Some(c) = completion.as_mut() {
c.set_exit_status(1);
}
drop(completion);
},
Some(tab) => tab.show_floating_panes_atomic(completion),
}
Ok(())
}
pub fn hide_floating_panes_in_tab(
&mut self,
client_id: ClientId,
tab_id: Option<usize>,
completion: Option<NotificationEnd>,
) -> Result<()> {
let tab = match tab_id {
Some(id) => self.tabs.get_mut(&id),
None => self.get_active_tab_mut(client_id).ok(),
};
match tab {
None => {
let mut completion = completion;
if let Some(c) = completion.as_mut() {
c.set_exit_status(1);
}
drop(completion);
},
Some(tab) => tab.hide_floating_panes_atomic(completion),
}
Ok(())
}
/// Creates a new [`Tab`] in this [`Screen`]
pub fn new_tab(
&mut self,
@@ -4372,6 +4430,24 @@ pub(crate) fn screen_thread_main(
screen.render(None)?;
},
ScreenInstruction::ShowFloatingPanes {
client_id,
tab_id,
completion,
} => {
screen.show_floating_panes_in_tab(client_id, tab_id, completion)?;
screen.log_and_report_session_state()?;
screen.render(None)?;
},
ScreenInstruction::HideFloatingPanes {
client_id,
tab_id,
completion,
} => {
screen.hide_floating_panes_in_tab(client_id, tab_id, completion)?;
screen.log_and_report_session_state()?;
screen.render(None)?;
},
ScreenInstruction::WriteCharacter(
key_with_modifier,
raw_bytes,
+37
View File
@@ -4689,6 +4689,43 @@ impl Tab {
self.set_force_render();
}
pub fn show_floating_panes_atomic(&mut self, mut completion: Option<NotificationEnd>) {
if self.floating_panes.panes_are_visible() {
if let Some(c) = completion.as_mut() {
c.set_exit_status(2);
}
} else if self
.floating_panes
.last_selectable_floating_pane_id()
.is_none()
{
// No selectable floating panes exist — surface must not be shown
if let Some(c) = completion.as_mut() {
c.set_exit_status(1);
}
} else {
self.show_floating_panes();
if let Some(c) = completion.as_mut() {
c.set_exit_status(0);
}
}
drop(completion);
}
pub fn hide_floating_panes_atomic(&mut self, mut completion: Option<NotificationEnd>) {
if !self.floating_panes.panes_are_visible() {
if let Some(c) = completion.as_mut() {
c.set_exit_status(2);
}
} else {
self.hide_floating_panes();
if let Some(c) = completion.as_mut() {
c.set_exit_status(0);
}
}
drop(completion);
}
pub fn find_plugin(&self, run_plugin_or_alias: &RunPluginOrAlias) -> Option<PaneId> {
self.tiled_panes
.get_plugin_pane_id(run_plugin_or_alias)
+63 -14
View File
@@ -9,7 +9,9 @@ use zellij_utils::errors::prelude::*;
use zellij_utils::input::actions::Action;
pub use zellij_utils::plugin_api;
use zellij_utils::plugin_api::event::ProtobufPaneScrollbackResponse;
use zellij_utils::plugin_api::generated_api::api::plugin_command::save_session_response;
use zellij_utils::plugin_api::generated_api::api::plugin_command::{
hide_floating_panes_response, save_session_response, show_floating_panes_response,
};
use zellij_utils::plugin_api::plugin_command::{
dump_layout_response, dump_session_layout_response, get_focused_pane_info_response,
get_pane_cwd_response, get_pane_running_command_response, parse_layout_response,
@@ -21,19 +23,20 @@ use zellij_utils::plugin_api::plugin_command::{
ProtobufGetFocusedPaneInfoResponse, ProtobufGetLayoutDirResponse, ProtobufGetPaneCwdResponse,
ProtobufGetPaneInfoResponse, ProtobufGetPanePidResponse, ProtobufGetPaneRunningCommandResponse,
ProtobufGetSessionEnvironmentVariablesResponse, ProtobufGetTabInfoResponse,
ProtobufNewTabResponse, ProtobufNewTabsResponse, ProtobufOpenCommandPaneBackgroundResponse,
ProtobufOpenCommandPaneFloatingNearPluginResponse, ProtobufOpenCommandPaneFloatingResponse,
ProtobufOpenCommandPaneInPlaceOfPaneIdResponse, ProtobufOpenCommandPaneInPlaceOfPluginResponse,
ProtobufOpenCommandPaneInPlaceResponse, ProtobufOpenCommandPaneNearPluginResponse,
ProtobufOpenCommandPaneResponse, ProtobufOpenEditPaneInPlaceOfPaneIdResponse,
ProtobufOpenFileFloatingNearPluginResponse, ProtobufOpenFileFloatingResponse,
ProtobufOpenFileInPlaceOfPluginResponse, ProtobufOpenFileInPlaceResponse,
ProtobufOpenFileNearPluginResponse, ProtobufOpenFileResponse, ProtobufOpenPaneInNewTabResponse,
ProtobufOpenTerminalFloatingNearPluginResponse, ProtobufOpenTerminalFloatingResponse,
ProtobufOpenTerminalInPlaceOfPluginResponse, ProtobufOpenTerminalInPlaceResponse,
ProtobufOpenTerminalNearPluginResponse, ProtobufOpenTerminalPaneInPlaceOfPaneIdResponse,
ProtobufOpenTerminalResponse, ProtobufParseLayoutResponse, ProtobufPluginCommand,
ProtobufRenameLayoutResponse, ProtobufSaveLayoutResponse, ProtobufSaveSessionResponse,
ProtobufHideFloatingPanesResponse, ProtobufNewTabResponse, ProtobufNewTabsResponse,
ProtobufOpenCommandPaneBackgroundResponse, ProtobufOpenCommandPaneFloatingNearPluginResponse,
ProtobufOpenCommandPaneFloatingResponse, ProtobufOpenCommandPaneInPlaceOfPaneIdResponse,
ProtobufOpenCommandPaneInPlaceOfPluginResponse, ProtobufOpenCommandPaneInPlaceResponse,
ProtobufOpenCommandPaneNearPluginResponse, ProtobufOpenCommandPaneResponse,
ProtobufOpenEditPaneInPlaceOfPaneIdResponse, ProtobufOpenFileFloatingNearPluginResponse,
ProtobufOpenFileFloatingResponse, ProtobufOpenFileInPlaceOfPluginResponse,
ProtobufOpenFileInPlaceResponse, ProtobufOpenFileNearPluginResponse, ProtobufOpenFileResponse,
ProtobufOpenPaneInNewTabResponse, ProtobufOpenTerminalFloatingNearPluginResponse,
ProtobufOpenTerminalFloatingResponse, ProtobufOpenTerminalInPlaceOfPluginResponse,
ProtobufOpenTerminalInPlaceResponse, ProtobufOpenTerminalNearPluginResponse,
ProtobufOpenTerminalPaneInPlaceOfPaneIdResponse, ProtobufOpenTerminalResponse,
ProtobufParseLayoutResponse, ProtobufPluginCommand, ProtobufRenameLayoutResponse,
ProtobufSaveLayoutResponse, ProtobufSaveSessionResponse, ProtobufShowFloatingPanesResponse,
RenameWebTokenResponse, RevokeAllWebTokensResponse, RevokeTokenResponse,
};
use zellij_utils::plugin_api::plugin_ids::{ProtobufPluginIds, ProtobufZellijVersion};
@@ -2687,6 +2690,52 @@ pub fn run_action(action: Action, context: BTreeMap<String, String>) {
unsafe { host_run_plugin_command() };
}
/// Show all floating panes in the specified tab, or the active tab if `tab_id` is `None`.
///
/// Blocks until the server-side action is complete.
///
/// Returns `Ok(true)` if the floating panes were made visible (state changed),
/// `Ok(false)` if the floating panes were already visible (no change),
/// or `Err(String)` if the specified tab was not found.
pub fn show_floating_panes(tab_id: Option<usize>) -> Result<bool, String> {
let plugin_command = PluginCommand::ShowFloatingPanes { tab_id };
let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap();
object_to_stdout(&protobuf_plugin_command.encode_to_vec());
unsafe { host_run_plugin_command() };
let response_bytes =
bytes_from_stdin().map_err(|e| format!("Failed to read response: {:?}", e))?;
let response = ProtobufShowFloatingPanesResponse::decode(response_bytes.as_slice())
.map_err(|e| format!("Failed to decode response: {}", e))?;
match response.result {
Some(show_floating_panes_response::Result::Success(changed)) => Ok(changed),
Some(show_floating_panes_response::Result::Error(e)) => Err(e),
None => Err("Empty response".to_string()),
}
}
/// Hide all floating panes in the specified tab, or the active tab if `tab_id` is `None`.
///
/// Blocks until the server-side action is complete.
///
/// Returns `Ok(true)` if the floating panes were hidden (state changed),
/// `Ok(false)` if the floating panes were already hidden (no change),
/// or `Err(String)` if the specified tab was not found.
pub fn hide_floating_panes(tab_id: Option<usize>) -> Result<bool, String> {
let plugin_command = PluginCommand::HideFloatingPanes { tab_id };
let protobuf_plugin_command: ProtobufPluginCommand = plugin_command.try_into().unwrap();
object_to_stdout(&protobuf_plugin_command.encode_to_vec());
unsafe { host_run_plugin_command() };
let response_bytes =
bytes_from_stdin().map_err(|e| format!("Failed to read response: {:?}", e))?;
let response = ProtobufHideFloatingPanesResponse::decode(response_bytes.as_slice())
.map_err(|e| format!("Failed to decode response: {}", e))?;
match response.result {
Some(hide_floating_panes_response::Result::Success(changed)) => Ok(changed),
Some(hide_floating_panes_response::Result::Error(e)) => Err(e),
None => Err("Empty response".to_string()),
}
}
#[link(wasm_import_module = "zellij")]
extern "C" {
fn host_run_plugin_command();
+23 -1
View File
@@ -302,7 +302,7 @@ pub struct OverrideLayoutPayload {
pub struct Action {
#[prost(enumeration="ActionName", tag="1")]
pub name: i32,
#[prost(oneof="action::OptionalPayload", tags="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, 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")]
#[prost(oneof="action::OptionalPayload", tags="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, 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")]
pub optional_payload: ::core::option::Option<action::OptionalPayload>,
}
/// Nested message and enum types in `Action`.
@@ -416,6 +416,10 @@ pub mod action {
CloseTabByIdPayload(u64),
#[prost(message, tag="57")]
RenameTabByIdPayload(super::TabIdAndName),
#[prost(message, tag="58")]
ShowFloatingPanesPayload(super::ShowFloatingPanesPayload),
#[prost(message, tag="59")]
HideFloatingPanesPayload(super::HideFloatingPanesPayload),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
@@ -448,6 +452,18 @@ pub struct TabIdAndName {
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShowFloatingPanesPayload {
#[prost(uint32, optional, tag="1")]
pub tab_id: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HideFloatingPanesPayload {
#[prost(uint32, optional, tag="1")]
pub tab_id: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PaneIdAndShouldFloat {
#[prost(uint32, tag="1")]
pub pane_id: u32,
@@ -1084,6 +1100,8 @@ pub enum ActionName {
GoToTabById = 95,
CloseTabById = 96,
RenameTabById = 97,
ShowFloatingPanes = 98,
HideFloatingPanes = 99,
}
impl ActionName {
/// String value of the enum field names used in the ProtoBuf definition.
@@ -1187,6 +1205,8 @@ impl ActionName {
ActionName::GoToTabById => "GoToTabById",
ActionName::CloseTabById => "CloseTabById",
ActionName::RenameTabById => "RenameTabById",
ActionName::ShowFloatingPanes => "ShowFloatingPanes",
ActionName::HideFloatingPanes => "HideFloatingPanes",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -1287,6 +1307,8 @@ impl ActionName {
"GoToTabById" => Some(Self::GoToTabById),
"CloseTabById" => Some(Self::CloseTabById),
"RenameTabById" => Some(Self::RenameTabById),
"ShowFloatingPanes" => Some(Self::ShowFloatingPanes),
"HideFloatingPanes" => Some(Self::HideFloatingPanes),
_ => None,
}
}
@@ -3,7 +3,7 @@
pub struct PluginCommand {
#[prost(enumeration="CommandName", tag="1")]
pub name: i32,
#[prost(oneof="plugin_command::Payload", tags="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, 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, 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")]
#[prost(oneof="plugin_command::Payload", tags="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, 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, 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")]
pub payload: ::core::option::Option<plugin_command::Payload>,
}
/// Nested message and enum types in `PluginCommand`.
@@ -291,6 +291,10 @@ pub mod plugin_command {
OpenTerminalPaneInPlaceOfPaneIdPayload(super::OpenTerminalPaneInPlaceOfPaneIdPayload),
#[prost(message, tag="154")]
OpenEditPaneInPlaceOfPaneIdPayload(super::OpenEditPaneInPlaceOfPaneIdPayload),
#[prost(message, tag="155")]
HideFloatingPanesPayload(super::HideFloatingPanesPayload),
#[prost(message, tag="156")]
ShowFloatingPanesPayload(super::ShowFloatingPanesPayload),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
@@ -1718,6 +1722,52 @@ pub struct OpenEditPaneInPlaceOfPaneIdResponse {
#[prost(message, optional, tag="1")]
pub pane_id: ::core::option::Option<PaneId>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HideFloatingPanesPayload {
#[prost(uint32, optional, tag="1")]
pub tab_id: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShowFloatingPanesPayload {
#[prost(uint32, optional, tag="1")]
pub tab_id: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShowFloatingPanesResponse {
#[prost(oneof="show_floating_panes_response::Result", tags="1, 2")]
pub result: ::core::option::Option<show_floating_panes_response::Result>,
}
/// Nested message and enum types in `ShowFloatingPanesResponse`.
pub mod show_floating_panes_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Result {
#[prost(bool, tag="1")]
Success(bool),
#[prost(string, tag="2")]
Error(::prost::alloc::string::String),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HideFloatingPanesResponse {
#[prost(oneof="hide_floating_panes_response::Result", tags="1, 2")]
pub result: ::core::option::Option<hide_floating_panes_response::Result>,
}
/// Nested message and enum types in `HideFloatingPanesResponse`.
pub mod hide_floating_panes_response {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Result {
#[prost(bool, tag="1")]
Success(bool),
#[prost(string, tag="2")]
Error(::prost::alloc::string::String),
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum CommandName {
@@ -1904,6 +1954,8 @@ pub enum CommandName {
OpenCommandPaneInPlaceOfPaneId = 201,
OpenTerminalPaneInPlaceOfPaneId = 202,
OpenEditPaneInPlaceOfPaneId = 203,
HideFloatingPanes = 204,
ShowFloatingPanes = 205,
}
impl CommandName {
/// String value of the enum field names used in the ProtoBuf definition.
@@ -2095,6 +2147,8 @@ impl CommandName {
CommandName::OpenCommandPaneInPlaceOfPaneId => "OpenCommandPaneInPlaceOfPaneId",
CommandName::OpenTerminalPaneInPlaceOfPaneId => "OpenTerminalPaneInPlaceOfPaneId",
CommandName::OpenEditPaneInPlaceOfPaneId => "OpenEditPaneInPlaceOfPaneId",
CommandName::HideFloatingPanes => "HideFloatingPanes",
CommandName::ShowFloatingPanes => "ShowFloatingPanes",
}
}
/// Creates an enum from field names used in the ProtoBuf definition.
@@ -2283,6 +2337,8 @@ impl CommandName {
"OpenCommandPaneInPlaceOfPaneId" => Some(Self::OpenCommandPaneInPlaceOfPaneId),
"OpenTerminalPaneInPlaceOfPaneId" => Some(Self::OpenTerminalPaneInPlaceOfPaneId),
"OpenEditPaneInPlaceOfPaneId" => Some(Self::OpenEditPaneInPlaceOfPaneId),
"HideFloatingPanes" => Some(Self::HideFloatingPanes),
"ShowFloatingPanes" => Some(Self::ShowFloatingPanes),
_ => None,
}
}
@@ -119,7 +119,7 @@ pub struct RgbColor {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Action {
#[prost(oneof="action::ActionType", tags="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")]
#[prost(oneof="action::ActionType", tags="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")]
pub action_type: ::core::option::Option<action::ActionType>,
}
/// Nested message and enum types in `Action`.
@@ -337,6 +337,10 @@ pub mod action {
ListTabs(super::ListTabsAction),
#[prost(message, tag="105")]
CurrentTabInfo(super::CurrentTabInfoAction),
#[prost(message, tag="106")]
ShowFloatingPanes(super::ShowFloatingPanesAction),
#[prost(message, tag="107")]
HideFloatingPanes(super::HideFloatingPanesAction),
}
}
// Action message definitions (all 92 variants)
@@ -432,6 +436,18 @@ pub struct ToggleFloatingPanesAction {
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ShowFloatingPanesAction {
#[prost(uint32, optional, tag="1")]
pub tab_id: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct HideFloatingPanesAction {
#[prost(uint32, optional, tag="1")]
pub tab_id: ::core::option::Option<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CloseFocusAction {
}
#[allow(clippy::derive_partial_eq_without_eq)]
+14
View File
@@ -905,6 +905,20 @@ pub enum CliAction {
TogglePaneEmbedOrFloating,
/// Toggle the visibility of all floating panes in the current Tab, open one if none exist
ToggleFloatingPanes,
/// Show all floating panes in the specified tab (or active tab if tab_id is not provided).
///
/// Returns exit code 0 if state was changed, 2 if already visible, 1 if tab not found.
ShowFloatingPanes {
#[clap(short, long, value_parser)]
tab_id: Option<usize>,
},
/// Hide all floating panes in the specified tab (or active tab if tab_id is not provided).
///
/// Returns exit code 0 if state was changed, 2 if already hidden, 1 if tab not found.
HideFloatingPanes {
#[clap(short, long, value_parser)]
tab_id: Option<usize>,
},
/// Close the focused pane.
ClosePane,
/// Renames the focused pane
@@ -241,6 +241,8 @@ message Action {
RenameTabByIdAction rename_tab_by_id = 103;
ListTabsAction list_tabs = 104;
CurrentTabInfoAction current_tab_info = 105;
ShowFloatingPanesAction show_floating_panes = 106;
HideFloatingPanesAction hide_floating_panes = 107;
}
}
@@ -269,6 +271,12 @@ message TogglePaneFramesAction {}
message ToggleActiveSyncTabAction {}
message TogglePaneEmbedOrFloatingAction {}
message ToggleFloatingPanesAction {}
message ShowFloatingPanesAction {
optional uint32 tab_id = 1;
}
message HideFloatingPanesAction {
optional uint32 tab_id = 1;
}
message CloseFocusAction {}
message UndoRenamePaneAction {}
message NoOpAction {}
+6
View File
@@ -3461,6 +3461,12 @@ pub enum PluginCommand {
OpenCommandPaneInPlaceOfPaneId(PaneId, CommandToRun, bool, Context), // bool = close_replaced_pane
OpenTerminalPaneInPlaceOfPaneId(PaneId, FileToOpen, bool),
OpenEditPaneInPlaceOfPaneId(PaneId, FileToOpen, bool, Context),
HideFloatingPanes {
tab_id: Option<usize>,
},
ShowFloatingPanes {
tab_id: Option<usize>,
},
}
// Response type for plugin API methods that open a pane in a new tab
+14
View File
@@ -273,6 +273,14 @@ pub enum Action {
TogglePaneEmbedOrFloating,
/// Toggle the visibility of all floating panes (if any) in the current Tab
ToggleFloatingPanes,
/// Show all floating panes in the specified tab (or active tab if tab_id is None)
ShowFloatingPanes {
tab_id: Option<usize>,
},
/// Hide all floating panes in the specified tab (or active tab if tab_id is None)
HideFloatingPanes {
tab_id: Option<usize>,
},
/// Close the focus pane.
CloseFocus,
PaneNameInput {
@@ -941,6 +949,12 @@ impl Action {
CliAction::SwitchMode { input_mode } => Ok(vec![Action::SwitchToMode { input_mode }]),
CliAction::TogglePaneEmbedOrFloating => Ok(vec![Action::TogglePaneEmbedOrFloating]),
CliAction::ToggleFloatingPanes => Ok(vec![Action::ToggleFloatingPanes]),
CliAction::ShowFloatingPanes { tab_id } => {
Ok(vec![Action::ShowFloatingPanes { tab_id }])
},
CliAction::HideFloatingPanes { tab_id } => {
Ok(vec![Action::HideFloatingPanes { tab_id }])
},
CliAction::ClosePane => Ok(vec![Action::CloseFocus]),
CliAction::RenamePane { name } => Ok(vec![
Action::UndoRenamePane,
+34 -13
View File
@@ -725,19 +725,20 @@ impl From<crate::input::actions::Action>
FocusNextPaneAction, FocusPluginPaneWithIdAction, FocusPreviousPaneAction,
FocusTerminalPaneWithIdAction, GoToNextTabAction, GoToPreviousTabAction, GoToTabAction,
GoToTabByIdAction, GoToTabNameAction, HalfPageScrollDownAction, HalfPageScrollUpAction,
KeybindPipeAction, LaunchOrFocusPluginAction, LaunchPluginAction, ListClientsAction,
ListPanesAction, ListTabsAction, MouseEventAction, MoveFocusAction,
MoveFocusOrTabAction, MovePaneAction, MovePaneBackwardsAction, MoveTabAction,
NewBlockingPaneAction, NewFloatingPaneAction, NewFloatingPluginPaneAction,
NewInPlacePaneAction, NewInPlacePluginPaneAction, NewPaneAction, NewStackedPaneAction,
NewTabAction, NewTiledPaneAction, NewTiledPluginPaneAction, NextSwapLayoutAction,
NoOpAction, OverrideLayoutAction, PageScrollDownAction, PageScrollUpAction,
PaneIdWithPlugin, PaneNameInputAction, PreviousSwapLayoutAction, QueryTabNamesAction,
QuitAction, RenamePluginPaneAction, RenameSessionAction, RenameTabAction,
RenameTabByIdAction, RenameTerminalPaneAction, ResizeAction, RunAction,
SaveSessionAction, ScrollDownAction, ScrollDownAtAction, ScrollToBottomAction,
ScrollToTopAction, ScrollUpAction, ScrollUpAtAction, SearchAction, SearchInputAction,
SearchToggleOptionAction, SetPaneBorderlessAction, SkipConfirmAction, StackPanesAction,
HideFloatingPanesAction, KeybindPipeAction, LaunchOrFocusPluginAction,
LaunchPluginAction, ListClientsAction, ListPanesAction, ListTabsAction,
MouseEventAction, MoveFocusAction, MoveFocusOrTabAction, MovePaneAction,
MovePaneBackwardsAction, MoveTabAction, NewBlockingPaneAction, NewFloatingPaneAction,
NewFloatingPluginPaneAction, NewInPlacePaneAction, NewInPlacePluginPaneAction,
NewPaneAction, NewStackedPaneAction, NewTabAction, NewTiledPaneAction,
NewTiledPluginPaneAction, NextSwapLayoutAction, NoOpAction, OverrideLayoutAction,
PageScrollDownAction, PageScrollUpAction, PaneIdWithPlugin, PaneNameInputAction,
PreviousSwapLayoutAction, QueryTabNamesAction, QuitAction, RenamePluginPaneAction,
RenameSessionAction, RenameTabAction, RenameTabByIdAction, RenameTerminalPaneAction,
ResizeAction, RunAction, SaveSessionAction, ScrollDownAction, ScrollDownAtAction,
ScrollToBottomAction, ScrollToTopAction, ScrollUpAction, ScrollUpAtAction,
SearchAction, SearchInputAction, SearchToggleOptionAction, SetPaneBorderlessAction,
ShowFloatingPanesAction, SkipConfirmAction, StackPanesAction,
StartOrReloadPluginAction, SwitchFocusAction, SwitchModeForAllClientsAction,
SwitchSessionAction, SwitchToModeAction, TabNameInputAction, ToggleActiveSyncTabAction,
ToggleFloatingPanesAction, ToggleFocusFullscreenAction, ToggleGroupMarkingAction,
@@ -971,6 +972,16 @@ impl From<crate::input::actions::Action>
crate::input::actions::Action::ToggleFloatingPanes => {
ActionType::ToggleFloatingPanes(ToggleFloatingPanesAction {})
},
crate::input::actions::Action::ShowFloatingPanes { tab_id } => {
ActionType::ShowFloatingPanes(ShowFloatingPanesAction {
tab_id: tab_id.map(|id| id as u32),
})
},
crate::input::actions::Action::HideFloatingPanes { tab_id } => {
ActionType::HideFloatingPanes(HideFloatingPanesAction {
tab_id: tab_id.map(|id| id as u32),
})
},
crate::input::actions::Action::CloseFocus => {
ActionType::CloseFocus(CloseFocusAction {})
},
@@ -1621,6 +1632,16 @@ impl TryFrom<crate::client_server_contract::client_server_contract::Action>
ActionType::ToggleFloatingPanes(_) => {
Ok(crate::input::actions::Action::ToggleFloatingPanes)
},
ActionType::ShowFloatingPanes(a) => {
Ok(crate::input::actions::Action::ShowFloatingPanes {
tab_id: a.tab_id.map(|id| id as usize),
})
},
ActionType::HideFloatingPanes(a) => {
Ok(crate::input::actions::Action::HideFloatingPanes {
tab_id: a.tab_id.map(|id| id as usize),
})
},
ActionType::CloseFocus(_) => Ok(crate::input::actions::Action::CloseFocus),
ActionType::PaneNameInput(pane_name_action) => {
Ok(crate::input::actions::Action::PaneNameInput {
+30
View File
@@ -63,6 +63,8 @@ macro_rules! parse_kdl_action_arguments {
"ToggleActiveSyncTab" => Ok(Action::ToggleActiveSyncTab),
"TogglePaneEmbedOrFloating" => Ok(Action::TogglePaneEmbedOrFloating),
"ToggleFloatingPanes" => Ok(Action::ToggleFloatingPanes),
"ShowFloatingPanes" => Ok(Action::ShowFloatingPanes { tab_id: None }),
"HideFloatingPanes" => Ok(Action::HideFloatingPanes { tab_id: None }),
"CloseFocus" => Ok(Action::CloseFocus),
"UndoRenamePane" => Ok(Action::UndoRenamePane),
"NoOp" => Ok(Action::NoOp),
@@ -729,6 +731,20 @@ impl Action {
},
Action::TogglePaneEmbedOrFloating => Some(KdlNode::new("TogglePaneEmbedOrFloating")),
Action::ToggleFloatingPanes => Some(KdlNode::new("ToggleFloatingPanes")),
Action::ShowFloatingPanes { tab_id } => {
let mut node = KdlNode::new("ShowFloatingPanes");
if let Some(id) = tab_id {
node.push(KdlValue::Base10(*id as i64));
}
Some(node)
},
Action::HideFloatingPanes { tab_id } => {
let mut node = KdlNode::new("HideFloatingPanes");
if let Some(id) = tab_id {
node.push(KdlValue::Base10(*id as i64));
}
Some(node)
},
Action::CloseFocus => Some(KdlNode::new("CloseFocus")),
Action::PaneNameInput { input: bytes } => {
let mut node = KdlNode::new("PaneNameInput");
@@ -1510,6 +1526,20 @@ impl TryFrom<(&KdlNode, &Options)> for Action {
"ToggleFloatingPanes" => {
parse_kdl_action_arguments!(action_name, action_arguments, kdl_action)
},
"ShowFloatingPanes" => {
let tab_id = action_arguments
.first()
.and_then(|v| v.value().as_i64())
.map(|n| n as usize);
Ok(Action::ShowFloatingPanes { tab_id })
},
"HideFloatingPanes" => {
let tab_id = action_arguments
.first()
.and_then(|v| v.value().as_i64())
.map(|n| n as usize);
Ok(Action::HideFloatingPanes { tab_id })
},
"CloseFocus" => parse_kdl_action_arguments!(action_name, action_arguments, kdl_action),
"UndoRenamePane" => {
parse_kdl_action_arguments!(action_name, action_arguments, kdl_action)
+12
View File
@@ -242,6 +242,8 @@ message Action {
uint64 go_to_tab_by_id_payload = 55;
uint64 close_tab_by_id_payload = 56;
TabIdAndName rename_tab_by_id_payload = 57;
ShowFloatingPanesPayload show_floating_panes_payload = 58;
HideFloatingPanesPayload hide_floating_panes_payload = 59;
}
}
@@ -262,6 +264,14 @@ message TabIdAndName {
string name = 2;
}
message ShowFloatingPanesPayload {
optional uint32 tab_id = 1;
}
message HideFloatingPanesPayload {
optional uint32 tab_id = 1;
}
message PaneIdAndShouldFloat {
uint32 pane_id = 1;
bool should_float = 2;
@@ -469,6 +479,8 @@ enum ActionName {
GoToTabById = 95;
CloseTabById = 96;
RenameTabById = 97;
ShowFloatingPanes = 98;
HideFloatingPanes = 99;
}
message Position {
+37
View File
@@ -16,6 +16,7 @@ pub use super::generated_api::api::{
FloatingPaneLayout as ProtobufFloatingPaneLayout,
FloatingPlacement as ProtobufFloatingPlacement,
GoToTabNamePayload,
HideFloatingPanesPayload,
IdAndName,
InPlaceConfig as ProtobufInPlaceConfig,
KeyModifier as ProtobufKeyModifier,
@@ -56,12 +57,14 @@ pub use super::generated_api::api::{
ScrollAtPayload,
SearchDirection as ProtobufSearchDirection,
SearchOption as ProtobufSearchOption,
ShowFloatingPanesPayload,
SplitDirection as ProtobufSplitDirection,
SplitSize as ProtobufSplitSize,
StackedPlacement as ProtobufStackedPlacement,
SwapFloatingLayout as ProtobufSwapFloatingLayout,
SwapTiledLayout as ProtobufSwapTiledLayout,
SwitchToModePayload,
TabIdAndName,
TabLayoutInfo as ProtobufTabLayoutInfo,
TiledPaneLayout as ProtobufTiledPaneLayout,
TiledPlacement as ProtobufTiledPlacement,
@@ -396,6 +399,24 @@ impl TryFrom<ProtobufAction> for Action {
None => Ok(Action::ToggleFloatingPanes),
}
},
Some(ProtobufActionName::ShowFloatingPanes) => match protobuf_action.optional_payload {
Some(OptionalPayload::ShowFloatingPanesPayload(payload)) => {
Ok(Action::ShowFloatingPanes {
tab_id: payload.tab_id.map(|id| id as usize),
})
},
None => Ok(Action::ShowFloatingPanes { tab_id: None }),
_ => Err("Wrong payload for ShowFloatingPanes"),
},
Some(ProtobufActionName::HideFloatingPanes) => match protobuf_action.optional_payload {
Some(OptionalPayload::HideFloatingPanesPayload(payload)) => {
Ok(Action::HideFloatingPanes {
tab_id: payload.tab_id.map(|id| id as usize),
})
},
None => Ok(Action::HideFloatingPanes { tab_id: None }),
_ => Err("Wrong payload for HideFloatingPanes"),
},
Some(ProtobufActionName::CloseFocus) => match protobuf_action.optional_payload {
Some(_) => Err("CloseFocus should not have a payload"),
None => Ok(Action::CloseFocus),
@@ -1306,6 +1327,22 @@ impl TryFrom<Action> for ProtobufAction {
name: ProtobufActionName::ToggleFloatingPanes as i32,
optional_payload: None,
}),
Action::ShowFloatingPanes { tab_id } => Ok(ProtobufAction {
name: ProtobufActionName::ShowFloatingPanes as i32,
optional_payload: Some(OptionalPayload::ShowFloatingPanesPayload(
ShowFloatingPanesPayload {
tab_id: tab_id.map(|id| id as u32),
},
)),
}),
Action::HideFloatingPanes { tab_id } => Ok(ProtobufAction {
name: ProtobufActionName::HideFloatingPanes as i32,
optional_payload: Some(OptionalPayload::HideFloatingPanesPayload(
HideFloatingPanesPayload {
tab_id: tab_id.map(|id| id as u32),
},
)),
}),
Action::CloseFocus => Ok(ProtobufAction {
name: ProtobufActionName::CloseFocus as i32,
optional_payload: None,
@@ -196,6 +196,8 @@ enum CommandName {
OpenCommandPaneInPlaceOfPaneId = 201;
OpenTerminalPaneInPlaceOfPaneId = 202;
OpenEditPaneInPlaceOfPaneId = 203;
HideFloatingPanes = 204;
ShowFloatingPanes = 205;
}
message PluginCommand {
@@ -341,6 +343,8 @@ message PluginCommand {
OpenCommandPaneInPlaceOfPaneIdPayload open_command_pane_in_place_of_pane_id_payload = 152;
OpenTerminalPaneInPlaceOfPaneIdPayload open_terminal_pane_in_place_of_pane_id_payload = 153;
OpenEditPaneInPlaceOfPaneIdPayload open_edit_pane_in_place_of_pane_id_payload = 154;
HideFloatingPanesPayload hide_floating_panes_payload = 155;
ShowFloatingPanesPayload show_floating_panes_payload = 156;
}
}
@@ -1186,3 +1190,25 @@ message OpenTerminalPaneInPlaceOfPaneIdResponse {
message OpenEditPaneInPlaceOfPaneIdResponse {
optional PaneId pane_id = 1;
}
message HideFloatingPanesPayload {
optional uint32 tab_id = 1;
}
message ShowFloatingPanesPayload {
optional uint32 tab_id = 1;
}
message ShowFloatingPanesResponse {
oneof result {
bool success = 1;
string error = 2;
}
}
message HideFloatingPanesResponse {
oneof result {
bool success = 1;
string error = 2;
}
}
+50 -12
View File
@@ -7,9 +7,10 @@ pub use super::generated_api::api::{
break_panes_to_tab_with_index_response, delete_layout_response, dump_layout_response,
dump_session_layout_response, edit_layout_response, focus_or_create_tab_response,
get_focused_pane_info_response, get_pane_cwd_response, get_pane_pid_response,
get_pane_running_command_response, new_tab_response, parse_layout_response,
plugin_command::Payload, rename_layout_response, save_layout_response,
save_session_response, BreakPanesToNewTabPayload,
get_pane_running_command_response, hide_floating_panes_response, new_tab_response,
parse_layout_response, plugin_command::Payload, rename_layout_response,
save_layout_response, save_session_response, show_floating_panes_response,
BreakPanesToNewTabPayload,
BreakPanesToNewTabResponse as ProtobufBreakPanesToNewTabResponse,
BreakPanesToTabWithIdPayload,
BreakPanesToTabWithIdResponse as ProtobufBreakPanesToTabWithIdResponse,
@@ -45,11 +46,12 @@ pub use super::generated_api::api::{
GetSessionEnvironmentVariablesPayload as ProtobufGetSessionEnvironmentVariablesPayload,
GetSessionEnvironmentVariablesResponse as ProtobufGetSessionEnvironmentVariablesResponse,
GetTabInfoPayload, GetTabInfoResponse as ProtobufGetTabInfoResponse, GoToTabWithIdPayload,
GroupAndUngroupPanesPayload, HidePaneWithIdPayload, HighlightAndUnhighlightPanesPayload,
HttpVerb as ProtobufHttpVerb, IdAndNewName, KeyToRebind, KeyToUnbind, KillSessionsPayload,
ListTokensResponse, LoadNewPluginPayload, MessageToPluginPayload,
MovePaneWithPaneIdInDirectionPayload, MovePaneWithPaneIdPayload, MovePayload,
NewPluginArgs as ProtobufNewPluginArgs, NewTabPayload,
GroupAndUngroupPanesPayload, HideFloatingPanesPayload as ProtobufHideFloatingPanesPayload,
HideFloatingPanesResponse as ProtobufHideFloatingPanesResponse, HidePaneWithIdPayload,
HighlightAndUnhighlightPanesPayload, HttpVerb as ProtobufHttpVerb, IdAndNewName,
KeyToRebind, KeyToUnbind, KillSessionsPayload, ListTokensResponse, LoadNewPluginPayload,
MessageToPluginPayload, MovePaneWithPaneIdInDirectionPayload, MovePaneWithPaneIdPayload,
MovePayload, NewPluginArgs as ProtobufNewPluginArgs, NewTabPayload,
NewTabResponse as ProtobufNewTabResponse, NewTabsResponse as ProtobufNewTabsResponse,
NewTabsWithLayoutInfoPayload,
OpenCommandPaneBackgroundResponse as ProtobufOpenCommandPaneBackgroundResponse,
@@ -102,10 +104,12 @@ pub use super::generated_api::api::{
ScrollToBottomInPaneIdPayload, ScrollToTopInPaneIdPayload, ScrollUpInPaneIdPayload,
SetFloatingPanePinnedPayload, SetPaneBorderlessPayload,
SetSelfMouseSelectionSupportPayload, SetTimeoutPayload, ShowCursorPayload,
ShowPaneWithIdPayload, StackPanesPayload, SubscribePayload, SwitchSessionPayload,
SwitchTabToIdPayload, SwitchTabToPayload, TogglePaneBorderlessPayload,
TogglePaneEmbedOrEjectForPaneIdPayload, TogglePaneIdFullscreenPayload, UnsubscribePayload,
WebRequestPayload, WriteCharsToPaneIdPayload, WriteToPaneIdPayload,
ShowFloatingPanesPayload as ProtobufShowFloatingPanesPayload,
ShowFloatingPanesResponse as ProtobufShowFloatingPanesResponse, ShowPaneWithIdPayload,
StackPanesPayload, SubscribePayload, SwitchSessionPayload, SwitchTabToIdPayload,
SwitchTabToPayload, TogglePaneBorderlessPayload, TogglePaneEmbedOrEjectForPaneIdPayload,
TogglePaneIdFullscreenPayload, UnsubscribePayload, WebRequestPayload,
WriteCharsToPaneIdPayload, WriteToPaneIdPayload,
},
plugin_permission::PermissionType as ProtobufPermissionType,
resize::ResizeAction as ProtobufResizeAction,
@@ -2401,6 +2405,24 @@ impl TryFrom<ProtobufPluginCommand> for PluginCommand {
_ => Err("Mismatched payload for OpenEditPaneInPlaceOfPaneId"),
}
},
Some(CommandName::HideFloatingPanes) => match protobuf_plugin_command.payload {
Some(Payload::HideFloatingPanesPayload(payload)) => {
Ok(PluginCommand::HideFloatingPanes {
tab_id: payload.tab_id.map(|id| id as usize),
})
},
None => Ok(PluginCommand::HideFloatingPanes { tab_id: None }),
_ => Err("Mismatched payload for HideFloatingPanes"),
},
Some(CommandName::ShowFloatingPanes) => match protobuf_plugin_command.payload {
Some(Payload::ShowFloatingPanesPayload(payload)) => {
Ok(PluginCommand::ShowFloatingPanes {
tab_id: payload.tab_id.map(|id| id as usize),
})
},
None => Ok(PluginCommand::ShowFloatingPanes { tab_id: None }),
_ => Err("Mismatched payload for ShowFloatingPanes"),
},
None => Err("Unrecognized plugin command"),
}
}
@@ -3937,6 +3959,22 @@ impl TryFrom<PluginCommand> for ProtobufPluginCommand {
)),
})
},
PluginCommand::HideFloatingPanes { tab_id } => Ok(ProtobufPluginCommand {
name: CommandName::HideFloatingPanes as i32,
payload: Some(Payload::HideFloatingPanesPayload(
ProtobufHideFloatingPanesPayload {
tab_id: tab_id.map(|id| id as u32),
},
)),
}),
PluginCommand::ShowFloatingPanes { tab_id } => Ok(ProtobufPluginCommand {
name: CommandName::ShowFloatingPanes as i32,
payload: Some(Payload::ShowFloatingPanesPayload(
ProtobufShowFloatingPanesPayload {
tab_id: tab_id.map(|id| id as u32),
},
)),
}),
}
}
}