diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-08-08 16:26:47 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-08-08 16:26:47 +0300 |
| commit | 10974c822d607f03e20e9741ec027910f0c1f93a (patch) | |
| tree | 85453f5ba5bcfcc56c37cabdbbced8a7e701cbe3 /src/api | |
| parent | 1d6d1fdc6ba8a4fd0385a2071f157504871201a2 (diff) | |
feat(input): add per-pane right-click routing (#2504)
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/mod.rs | 1 | ||||
| -rw-r--r-- | src/api/schema.rs | 2 | ||||
| -rw-r--r-- | src/api/schema/panes.rs | 18 | ||||
| -rw-r--r-- | src/api/server.rs | 1 |
4 files changed, 22 insertions, 0 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs index 7520d83c..27e98d2b 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -56,6 +56,7 @@ pub(crate) fn request_changes_ui(request: &Request) -> bool { | Method::PaneFocusDirection(_) | Method::PaneResize(_) | Method::PaneFocus(_) + | Method::PaneInputSet(_) | Method::PaneRename(_) | Method::PaneGraphicsSet(_) | Method::PaneGraphicsClear(_) diff --git a/src/api/schema.rs b/src/api/schema.rs index 42179c06..447ea42c 100644 --- a/src/api/schema.rs +++ b/src/api/schema.rs @@ -161,6 +161,8 @@ pub enum Method { PaneGet(PaneTarget), #[serde(rename = "pane.focus")] PaneFocus(PaneTarget), + #[serde(rename = "pane.input.set")] + PaneInputSet(PaneInputSetParams), #[serde(rename = "pane.rename")] PaneRename(PaneRenameParams), #[serde(rename = "pane.send_text")] diff --git a/src/api/schema/panes.rs b/src/api/schema/panes.rs index 647f7446..2dffd7f9 100644 --- a/src/api/schema/panes.rs +++ b/src/api/schema/panes.rs @@ -8,6 +8,16 @@ pub(crate) const PANE_GRAPHICS_STREAM_MAX_BYTES: usize = 16 * 1024 * 1024; use super::agents::AgentSessionInfo; use super::common::{AgentStatus, PaneAgentState, ReadFormat, ReadSource, SplitDirection}; +#[derive( + Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema, Default, +)] +#[serde(rename_all = "snake_case")] +pub enum PaneRightClickTarget { + #[default] + Herdr, + Pane, +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize, schemars::JsonSchema)] pub struct PaneSplitParams { #[serde(default, skip_serializing_if = "Option::is_none")] @@ -21,10 +31,18 @@ pub struct PaneSplitParams { pub cwd: Option<String>, #[serde(default)] pub focus: bool, + #[serde(default)] + pub right_click: PaneRightClickTarget, #[serde(default, skip_serializing_if = "HashMap::is_empty")] pub env: HashMap<String, String>, } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)] +pub struct PaneInputSetParams { + pub pane_id: String, + pub right_click: PaneRightClickTarget, +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, schemars::JsonSchema)] #[serde(rename_all = "snake_case")] pub enum PaneDirection { diff --git a/src/api/server.rs b/src/api/server.rs index 0598faea..3932b1ea 100644 --- a/src/api/server.rs +++ b/src/api/server.rs @@ -402,6 +402,7 @@ fn api_method_name(method: &Method) -> &'static str { Method::PaneCurrent(_) => "pane.current", Method::PaneGet(_) => "pane.get", Method::PaneFocus(_) => "pane.focus", + Method::PaneInputSet(_) => "pane.input.set", Method::PaneRename(_) => "pane.rename", Method::PaneSendText(_) => "pane.send_text", Method::PaneSendKeys(_) => "pane.send_keys", |
