summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhar7an <99636919+har7an@users.noreply.github.com>2023-08-28 06:24:27 +0000
committerGitHub <noreply@github.com>2023-08-28 06:24:27 +0000
commit8031d6bf645f2de10820d861292efb26358b4af1 (patch)
treeb406d1cafd3290ae17c27cc1607a9332eebc7664
parentf6b08ddfaa4e1a12199df0ba317a140e4729efbf (diff)
xtask/pipeline: Fix publish task (#2711)
* xtask/pipeline: Fix publish task which was previously stuck in an infinite loop after successfully publishing a crate. The error originated in the code only checking for error conditions but not breaking out of the inner infinite loop in case of success. * xtask: Improve publish failure UX by offering the user more actions to choose from when an error occured. * utils/assets: Add generated prost files to assets to make sure they're available at build time and are picked up by all components. It seems we hit some strange bug with the build script where, when running `cargo publish --dry-run` the build script **is not** run before regularly compiling zellij-utils. This shouldn't happen according to the docs, but I cannot explain what's causing it. So we're using this as a workaround for now to make a smooth release. * xtask: Prevent accidental git commit deletion when dry-running a publish. * utils: Add comments to protobuf-related code to explain why these changes were performed. The comments all include a link to an issue comment explaining the situation in greater detail. * xtask: Build protobuf definitions when building any part of the project, similar to how we build the plugins when required. This should ensure that all crates built through `cargo xtask` (which is the officially supported build method) will receive up-to-date protobuf definitions.
-rw-r--r--Cargo.lock1
-rw-r--r--xtask/Cargo.toml1
-rw-r--r--xtask/src/build.rs32
-rw-r--r--xtask/src/pipelines.rs45
-rw-r--r--zellij-utils/assets/prost/api.action.rs577
-rw-r--r--zellij-utils/assets/prost/api.command.rs10
-rw-r--r--zellij-utils/assets/prost/api.event.rs381
-rw-r--r--zellij-utils/assets/prost/api.file.rs10
-rw-r--r--zellij-utils/assets/prost/api.input_mode.rs84
-rw-r--r--zellij-utils/assets/prost/api.key.rs298
-rw-r--r--zellij-utils/assets/prost/api.message.rs10
-rw-r--r--zellij-utils/assets/prost/api.plugin_command.rs409
-rw-r--r--zellij-utils/assets/prost/api.plugin_ids.rs14
-rw-r--r--zellij-utils/assets/prost/api.plugin_permission.rs38
-rw-r--r--zellij-utils/assets/prost/api.resize.rs72
-rw-r--r--zellij-utils/assets/prost/api.style.rs131
-rw-r--r--zellij-utils/assets/prost/generated_plugin_api.rs38
-rw-r--r--zellij-utils/build.rs48
-rw-r--r--zellij-utils/src/plugin_api/mod.rs16
19 files changed, 2181 insertions, 34 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 9fda1060a..c089f3df8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4500,6 +4500,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"lazy_static",
+ "prost-build",
"toml",
"which",
"xflags",
diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml
index 4a529f87c..2ab2b1c4c 100644
--- a/xtask/Cargo.toml
+++ b/xtask/Cargo.toml
@@ -11,3 +11,4 @@ xshell = "= 0.2.2"
xflags = "0.3.1"
which = "4.2"
toml = "0.5"
+prost-build = "0.11.9"
diff --git a/xtask/src/build.rs b/xtask/src/build.rs
index b77eda40d..4babad0c3 100644
--- a/xtask/src/build.rs
+++ b/xtask/src/build.rs
@@ -38,6 +38,38 @@ pub fn build(sh: &Shell, flags: flags::Build) -> anyhow::Result<()> {
}
}
+ // zellij-utils requires protobuf definition files to be present. Usually these are
+ // auto-generated with `build.rs`-files, but this is currently broken for us.
+ // See [this PR][1] for details.
+ //
+ // [1]: https://github.com/zellij-org/zellij/pull/2711#issuecomment-1695015818
+ {
+ let zellij_utils_basedir = crate::project_root().join("zellij-utils");
+ let _pd = sh.push_dir(zellij_utils_basedir);
+
+ let prost_asset_dir = sh.current_dir().join("assets").join("prost");
+ let protobuf_source_dir = sh.current_dir().join("src").join("plugin_api");
+ std::fs::create_dir_all(&prost_asset_dir).unwrap();
+
+ let mut prost = prost_build::Config::new();
+ prost.out_dir(prost_asset_dir);
+ prost.include_file("generated_plugin_api.rs");
+ let mut proto_files = vec![];
+ for entry in std::fs::read_dir(&protobuf_source_dir).unwrap() {
+ let entry_path = entry.unwrap().path();
+ if entry_path.is_file() {
+ if let Some(extension) = entry_path.extension() {
+ if extension == "proto" {
+ proto_files.push(entry_path.display().to_string())
+ }
+ }
+ }
+ }
+ prost
+ .compile_protos(&proto_files, &[protobuf_source_dir])
+ .unwrap();
+ }
+
let _pd = sh.push_dir(Path::new(crate_name));
// Tell the user where we are now
println!();
diff --git a/xtask/src/pipelines.rs b/xtask/src/pipelines.rs
index 9c82c6c0a..4195af763 100644
--- a/xtask/src/pipelines.rs
+++ b/xtask/src/pipelines.rs
@@ -179,6 +179,13 @@ pub fn dist(sh: &Shell, _flags: flags::Dist) -> anyhow::Result<()> {
.with_context(err_context)
}
+/// Actions for the user to choose from to resolve publishing errors/conflicts.
+enum UserAction {
+ Retry,
+ Abort,
+ Ignore,
+}
+
/// Make a zellij release and publish all crates.
pub fn publish(sh: &Shell, flags: flags::Publish) -> anyhow::Result<()> {
let err_context = "failed to publish zellij";
@@ -333,38 +340,46 @@ pub fn publish(sh: &Shell, flags: flags::Publish) -> anyhow::Result<()> {
println!("Publishing crate '{crate_name}' failed with error:");
println!("{:?}", err);
println!();
- println!("Retry? [y/n]");
+ println!("Please choose what to do: [r]etry/[a]bort/[i]gnore");
let stdin = std::io::stdin();
- let mut buffer = String::new();
- let retry: bool;
+ let action;
loop {
+ let mut buffer = String::new();
stdin.read_line(&mut buffer).context(err_context)?;
-
match buffer.trim_end() {
- "y" | "Y" => {
- retry = true;
+ "r" | "R" => {
+ action = UserAction::Retry;
break;
},
- "n" | "N" => {
- retry = false;
+ "a" | "A" => {
+ action = UserAction::Abort;
+ break;
+ },
+ "i" | "I" => {
+ action = UserAction::Ignore;
break;
},
_ => {
println!(" --> Unknown input '{buffer}', ignoring...");
println!();
- println!("Retry? [y/n]");
+ println!("Please choose what to do: [r]etry/[a]bort/[i]gnore");
},
}
}
- if retry {
- continue;
- } else {
- println!("Aborting publish for crate '{crate_name}'");
- return Err::<(), _>(err);
+ match action {
+ UserAction::Retry => continue,
+ UserAction::Ignore => break,
+ UserAction::Abort => {
+ eprintln!("Aborting publish for crate '{crate_name}'");
+ return Err::<(), _>(err);
+ },
}
+ } else {
+ // publish successful, continue to next crate
+ break;
}
}
}
@@ -380,7 +395,7 @@ pub fn publish(sh: &Shell, flags: flags::Publish) -> anyhow::Result<()> {
// program. When dry-running we need to undo the release commit first!
let result = closure();
- if flags.dry_run {
+ if flags.dry_run && !skip_build {
cmd!(sh, "git reset --hard HEAD~1")
.run()
.context(err_context)?;
diff --git a/zellij-utils/assets/prost/api.action.rs b/zellij-utils/assets/prost/api.action.rs
new file mode 100644
index 000000000..9099b6ef5
--- /dev/null
+++ b/zellij-utils/assets/prost/api.action.rs
@@ -0,0 +1,577 @@
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+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, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44"
+ )]
+ pub optional_payload: ::core::option::Option<action::OptionalPayload>,
+}
+/// Nested message and enum types in `Action`.
+pub mod action {
+ #[allow(clippy::derive_partial_eq_without_eq)]
+ #[derive(Clone, PartialEq, ::prost::Oneof)]
+ pub enum OptionalPayload {
+ #[prost(message, tag = "2")]
+ SwitchToModePayload(super::SwitchToModePayload),
+ #[prost(message, tag = "3")]
+ WritePayload(super::WritePayload),
+ #[prost(message, tag = "4")]
+ WriteCharsPayload(super::WriteCharsPayload),
+ #[prost(message, tag = "5")]
+ SwitchModeForAllClientsPayload(super::SwitchToModePayload),
+ #[prost(message, tag = "6")]
+ ResizePayload(super::super::resize::Resize),
+ #[prost(enumeration = "super::super::resize::ResizeDirection", tag = "7")]
+ MoveFocusPayload(i32),
+ #[prost(enumeration = "super::super::resize::ResizeDirection", tag = "8")]
+ MoveFocusOrTabPayload(i32),
+ #[prost(message, tag = "9")]
+ MovePanePayload(super::MovePanePayload),
+ #[prost(message, tag = "10")]
+ DumpScreenPayload(super::DumpScreenPayload),
+ #[prost(message, tag = "11")]
+ ScrollUpAtPayload(super::ScrollAtPayload),
+ #[prost(message, tag = "12")]
+ ScrollDownAtPayload(super::ScrollAtPayload),
+ #[prost(message, tag = "13")]
+ NewPanePayload(super::NewPanePayload),
+ #[prost(message, tag = "14")]
+ EditFilePayload(super::EditFilePayload),
+ #[prost(message, tag = "15")]
+ NewFloatingPanePayload(super::NewFloatingPanePayload),
+ #[prost(message, tag = "16")]
+ NewTiledPanePayload(super::NewTiledPanePayload),
+ #[prost(bytes, tag = "17")]
+ PaneNameInputPayload(::prost::alloc::vec::Vec<u8>),
+ #[prost(uint32, tag = "18")]
+ GoToTabPayload(u32),
+ #[prost(message, tag = "19")]
+ GoToTabNamePayload(super::GoToTabNamePayload),
+ #[prost(bytes, tag = "20")]
+ TabNameInputPayload(::prost::alloc::vec::Vec<u8>),
+ #[prost(message, tag = "21")]
+ RunPayload(super::RunCommandAction),
+ #[prost(message, tag = "22")]
+ LeftClickPayload(super::Position),
+ #[prost(message, tag = "23")]
+ RightClickPayload(super::Position),
+ #[prost(message, tag = "24")]
+ MiddleClickPayload(super::Position),
+ #[prost(message, tag = "25")]
+ LaunchOrFocusPluginPayload(super::LaunchOrFocusPluginPayload),
+ #[prost(message, tag = "26")]
+ LeftMouseReleasePayload(super::Position),
+ #[prost(message, tag = "27")]
+ RightMouseReleasePayload(super::Position),
+ #[prost(message, tag = "28")]
+ MiddleMouseReleasePayload(super::Position),
+ #[prost(message, tag = "29")]
+ MouseHoldLeftPayload(super::Position),
+ #[prost(message, tag = "30")]
+ MouseHoldRightPayload(super::Position),
+ #[prost(message, tag = "31")]
+ MouseHoldMiddlePayload(super::Position),
+ #[prost(bytes, tag = "32")]
+ SearchInputPayload(::prost::alloc::vec::Vec<u8>),
+ #[prost(enumeration = "super::SearchDirection", tag = "33")]
+ SearchPayload(i32),
+ #[prost(enumeration = "super::SearchOption", tag = "34")]
+ SearchToggleOptionPayload(i32),
+ #[prost(message, tag = "35")]
+ NewTiledPluginPanePayload(super::NewPluginPanePayload),
+ #[prost(message, tag = "36")]
+ NewFloatingPluginPanePayload(super::NewPluginPanePayload),
+ #[prost(string, tag = "37")]
+ StartOrReloadPluginPayload(::prost::alloc::string::String),
+ #[prost(uint32, tag = "38")]
+ CloseTerminalPanePayload(u32),
+ #[prost(uint32, tag = "39")]
+ ClosePluginPanePayload(u32),
+ #[prost(message, tag = "40")]
+ FocusTerminalPaneWithIdPayload(super::PaneIdAndShouldFloat),
+ #[prost(message, tag = "41")]
+ FocusPluginPaneWithIdPayload(super::PaneIdAndShouldFloat),
+ #[prost(message, tag = "42")]
+ RenameTerminalPanePayload(super::IdAndName),
+ #[prost(message, tag = "43")]
+ RenamePluginPanePayload(super::IdAndName),
+ #[prost(message, tag = "44")]
+ RenameTabPayload(super::IdAndName),
+ }
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct IdAndName {
+ #[prost(bytes = "vec", tag = "1")]
+ pub name: ::prost::alloc::vec::Vec<u8>,
+ #[prost(uint32, tag = "2")]
+ pub id: u32,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct PaneIdAndShouldFloat {
+ #[prost(uint32, tag = "1")]
+ pub pane_id: u32,
+ #[prost(bool, tag = "2")]
+ pub should_float: bool,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct NewPluginPanePayload {
+ #[prost(string, tag = "1")]
+ pub plugin_url: ::prost::alloc::string::String,
+ #[prost(string, optional, tag = "2")]
+ pub pane_name: ::core::option::Option<::prost::alloc::string::String>,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct LaunchOrFocusPluginPayload {
+ #[prost(string, tag = "1")]
+ pub plugin_url: ::prost::alloc::string::String,
+ #[prost(bool, tag = "2")]
+ pub should_float: bool,
+ #[prost(message, optional, tag = "3")]
+ pub plugin_configuration: ::core::option::Option<PluginConfiguration>,
+ #[prost(bool, tag = "4")]
+ pub move_to_focused_tab: bool,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct GoToTabNamePayload {
+ #[prost(string, tag = "1")]
+ pub tab_name: ::prost::alloc::string::String,
+ #[prost(bool, tag = "2")]
+ pub create: bool,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct NewFloatingPanePayload {
+ #[prost(message, optional, tag = "1")]
+ pub command: ::core::option::Option<RunCommandAction>,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct NewTiledPanePayload {
+ #[prost(message, optional, tag = "1")]
+ pub command: ::core::option::Option<RunCommandAction>,
+ #[prost(enumeration = "super::resize::ResizeDirection", optional, tag = "2")]
+ pub direction: ::core::option::Option<i32>,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct MovePanePayload {
+ #[prost(enumeration = "super::resize::ResizeDirection", optional, tag = "1")]
+ pub direction: ::core::option::Option<i32>,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct EditFilePayload {
+ #[prost(string, tag = "1")]
+ pub file_to_edit: ::prost::alloc::string::String,
+ #[prost(uint32, optional, tag = "2")]
+ pub line_number: ::core::option::Option<u32>,
+ #[prost(string, optional, tag = "3")]
+ pub cwd: ::core::option::Option<::prost::alloc::string::String>,
+ #[prost(enumeration = "super::resize::ResizeDirection", optional, tag = "4")]
+ pub direction: ::core::option::Option<i32>,
+ #[prost(bool, tag = "5")]
+ pub should_float: bool,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct ScrollAtPayload {
+ #[prost(message, optional, tag = "1")]
+ pub position: ::core::option::Option<Position>,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct NewPanePayload {
+ #[prost(enumeration = "super::resize::ResizeDirection", optional, tag = "1")]
+ pub direction: ::core::option::Option<i32>,
+ #[prost(string, optional, tag = "2")]
+ pub pane_name: ::core::option::Option<::prost::alloc::string::String>,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct SwitchToModePayload {
+ #[prost(enumeration = "super::input_mode::InputMode", tag = "1")]
+ pub input_mode: i32,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct WritePayload {
+ #[prost(bytes = "vec", tag = "1")]
+ pub bytes_to_write: ::prost::alloc::vec::Vec<u8>,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct WriteCharsPayload {
+ #[prost(string, tag = "1")]
+ pub chars: ::prost::alloc::string::String,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct DumpScreenPayload {
+ #[prost(string, tag = "1")]
+ pub file_path: ::prost::alloc::string::String,
+ #[prost(bool, tag = "2")]
+ pub include_scrollback: bool,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct Position {
+ #[prost(int64, tag = "1")]
+ pub line: i64,
+ #[prost(int64, tag = "2")]
+ pub column: i64,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct RunCommandAction {
+ #[prost(string, tag = "1")]
+ pub command: ::prost::alloc::string::String,
+ #[prost(string, repeated, tag = "2")]
+ pub args: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
+ #[prost(string, optional, tag = "3")]
+ pub cwd: ::core::option::Option<::prost::alloc::string::String>,
+ #[prost(enumeration = "super::resize::ResizeDirection", optional, tag = "4")]
+ pub direction: ::core::option::Option<i32>,
+ #[prost(string, optional, tag = "5")]
+ pub pane_name: ::core::option::Option<::prost::alloc::string::String>,
+ #[prost(bool, tag = "6")]
+ pub hold_on_close: bool,
+ #[prost(bool, tag = "7")]
+ pub hold_on_start: bool,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct PluginConfiguration {
+ #[prost(message, repeated, tag = "1")]
+ pub name_and_value: ::prost::alloc::vec::Vec<NameAndValue>,
+}
+#[allow(clippy::derive_partial_eq_without_eq)]
+#[derive(Clone, PartialEq, ::prost::Message)]
+pub struct NameAndValue {
+ #[prost(string, tag = "1")]
+ pub name: ::prost::alloc::string::String,
+ #[prost(string, tag = "2")]
+ pub value: ::prost::alloc::string::String,
+}
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
+#[repr(i32)]
+pub enum SearchDirection {
+ Up = 0,
+ Down = 1,
+}
+impl SearchDirection {
+ /// String value of the enum field names used in the ProtoBuf definition.
+ ///
+ /// The values are not transformed in any way and thus are considered stable
+ /// (if the ProtoBuf definition does not change) and safe for programmatic use.
+ pub fn as_str_name(&self) -> &'static str {
+ match self {
+ SearchDirection::Up => "Up",
+ SearchDirection::Down => "Down",
+ }
+ }
+ /// Creates an enum from field names used in the ProtoBuf definition.
+ pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
+ match value {
+ "Up" => Some(Self::Up),
+ "Down" => Some(Self::Down),
+ _ => None,
+ }
+ }
+}
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
+#[repr(i32)]
+pub enum SearchOption {
+ CaseSensitivity = 0,
+ WholeWord = 1,
+ Wrap = 2,
+}
+impl SearchOption {
+ /// String value of the enum field names used in the ProtoBuf definition.
+ ///
+ /// The values are not transformed in any way and thus are considered stable
+ /// (if the ProtoBuf definition does not change) and safe for programmatic use.
+ pub fn as_str_name(&self) -> &'static str {
+ match self {
+ SearchOption::CaseSensitivity => "CaseSensitivity",
+ SearchOption::WholeWord => "WholeWord",
+ SearchOption::Wrap => "Wrap",
+ }
+ }
+ /// Creates an enum from field names used in the ProtoBuf definition.
+ pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
+ match value {
+ "CaseSensitivity" => Some(Self::CaseSensitivity),
+ "WholeWord" => Some(Self::WholeWord),
+ "Wrap" => Some(Self::Wrap),
+ _ => None,
+ }
+ }
+}
+#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
+#[repr(i32)]
+pub enum ActionName {
+ Quit = 0,
+ Write = 1,
+ WriteChars = 2,
+ SwitchToMode = 3,
+ SwitchModeForAllClients = 4,
+ Resize = 5,
+ FocusNextPane = 6,
+ FocusPreviousPane = 7,
+ SwitchFocus = 8,
+ MoveFocus = 9,
+ MoveFocusOrTab = 10,
+ MovePane = 11,
+ MovePaneBackwards = 12,
+ ClearScreen = 13,
+ DumpScreen = 14,
+ EditScrollback = 15,
+ ScrollUp = 16,
+ ScrollUpAt = 17,
+ ScrollDown = 18,
+ ScrollDownAt = 19,
+ ScrollToBottom = 20,
+ ScrollToTop = 21,
+ PageScrollUp = 22,
+ PageScrollDown = 23,
+ HalfPageScrollUp = 24,
+ HalfPageScrollDown = 25,
+ ToggleFocusFullscreen = 26,
+ TogglePaneFrames = 27,
+ ToggleActiveSyncTab = 28,
+ NewPane = 29,
+ EditFile = 30,
+ NewFloatingPane = 31,
+ NewTiledPane = 32,
+ TogglePaneEmbedOrFloating = 33,
+ ToggleFloatingPanes = 34,
+ CloseFocus = 35,
+ PaneNameInput = 36,
+ UndoRenamePane = 37,
+ NewTab = 38,
+ NoOp = 39,
+ GoToNextTab = 40,
+ GoToPreviousTab = 41,
+ CloseTab = 42,
+ GoToTab = 43,
+ GoToTabName = 44,
+ ToggleTab = 45,
+ TabNameInput = 46,
+ UndoRenameTab = 47,
+ Run = 48,
+ Detach = 49,
+ LeftClick = 50,
+ RightClick = 51,
+ MiddleClick = 52,
+ LaunchOrFocusPlugin = 53,
+ LeftMouseRelease = 54,
+ RightMouseRelease = 55,
+ MiddleMouseRelease = 56,
+ MouseHoldLeft = 57,
+ MouseHoldRight = 58,
+ MouseHoldMiddle = 59,
+ SearchInput = 60,
+ Search = 61,
+ SearchToggleOption = 62,
+ ToggleMouseMode = 63,
+ PreviousSwapLayout = 64,
+ NextSwapLayout = 65,
+ QueryTabNames = 66,
+ NewTiledPluginPane = 67,
+ NewFloatingPluginPane = 68,
+ StartOrReloadPlugin = 69,
+ CloseTerminalPane = 70,
+ ClosePluginPane = 71,
+ FocusTerminalPaneWithId = 72,
+ FocusPluginPaneWithId = 73,
+ RenameTerminalPane = 74,
+ RenamePluginPane = 75,
+ RenameTab = 76,
+ BreakPane = 77,
+ BreakPaneRight = 78,
+ BreakPaneLeft = 79,
+}
+impl ActionName {
+ /// String value of the enum field names used in the ProtoBuf definition.
+ ///
+ /// The values are not transformed in any way and thus are considered stable
+ /// (if the ProtoBuf definition does not change) and safe for programmatic use.
+ pub fn as_str_name(&self) -> &'static str {
+ match self {
+ ActionName::Quit => "Quit",
+ ActionName::Write => "Write",
+ ActionName::WriteChars => "WriteChars",
+ ActionName::SwitchToMode => "SwitchToMode",
+ ActionName::SwitchModeForAllClients => "SwitchModeForAllClients",
+ ActionName::Resize => "Resize",
+ ActionName::FocusNextPane => "FocusNextPane",
+ ActionName::FocusPreviousPane => "FocusPreviousPane",
+ ActionName::SwitchFocus => "SwitchFocus",
+ ActionName::MoveFocus => "MoveFocus",
+ ActionName::MoveFocusOrTab => "MoveFocusOrTab",
+ ActionName::MovePane => "MovePane",
+ ActionName::MovePaneBackwards => "MovePaneBackwards",
+ ActionName::ClearScreen => "ClearScreen",
+ ActionName::DumpScreen => "DumpScreen",
+ ActionName::EditScrollback => "EditScrollback",
+ ActionName::ScrollUp => "ScrollUp",
+ ActionName::ScrollUpAt => "ScrollUpAt",
+ ActionName::ScrollDown => "ScrollDown",
+ ActionName::ScrollDownAt => "ScrollDownAt",
+ ActionName::ScrollToBottom => "ScrollToBottom",
+ ActionName::ScrollToTop => "ScrollToTop",
+ ActionName::PageScrollUp => "PageScrollUp",
+ ActionName::PageScrollDown => "PageScrollDown",
+ ActionName::HalfPageScrollUp => "HalfPageScrollUp",
+ ActionName::HalfPageScrollDown => "HalfPageScrollDown",
+ ActionName::ToggleFocusFullscreen => "ToggleFocusFullscreen",
+ ActionName::TogglePaneFrames =>