diff options
| author | Can Celik <ogulcancelik@gmail.com> | 2026-09-02 02:45:20 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-02 02:45:20 +0300 |
| commit | cc88b3b8e5bb9f7d9f23ed6ae85a52fd7b5b9ed6 (patch) | |
| tree | 4d37c760099070f1a1488b61c7b7271875aafef8 /src/client/shell/config.rs | |
| parent | 18e69891dca486d669a584facd80644bb51f54a2 (diff) | |
feat: add stable client endpoint compatibility (#3509)
* feat: add stable client endpoint compatibility
* fix: keep portable-pty patch checks composable
* ci: run maintenance checks in pull requests
* fix: reject endpoint errors from terminal clients
* feat: keep compatible servers running across updates
Diffstat (limited to 'src/client/shell/config.rs')
| -rw-r--r-- | src/client/shell/config.rs | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/src/client/shell/config.rs b/src/client/shell/config.rs index 0273cefb..1c2993b7 100644 --- a/src/client/shell/config.rs +++ b/src/client/shell/config.rs @@ -200,16 +200,8 @@ impl ClientShellConfig { }; config.keys.command = commands .iter() - .map(|command| crate::config::CommandKeybindConfig { - key: if command.binding_labels.len() == 1 { - crate::config::BindingConfig::One(command.binding_labels[0].clone()) - } else { - crate::config::BindingConfig::Many(command.binding_labels.clone()) - }, - // The client never executes this field; preserve the opaque endpoint ID - // through the shared config collision resolver. - command: command.command_id.clone(), - action_type: match command.action { + .filter_map(|command| { + let action_type = match command.action { crate::protocol::ClientShellCommandAction::Shell => { crate::config::CommandKeybindType::Shell } @@ -222,10 +214,22 @@ impl ClientShellConfig { crate::protocol::ClientShellCommandAction::PluginAction => { crate::config::CommandKeybindType::PluginAction } - }, - description: command.description.clone(), - width: None, - height: None, + crate::protocol::ClientShellCommandAction::Unknown => return None, + }; + Some(crate::config::CommandKeybindConfig { + key: if command.binding_labels.len() == 1 { + crate::config::BindingConfig::One(command.binding_labels[0].clone()) + } else { + crate::config::BindingConfig::Many(command.binding_labels.clone()) + }, + // The client never executes this field; preserve the opaque endpoint ID + // through the shared config collision resolver. + command: command.command_id.clone(), + action_type, + description: command.description.clone(), + width: None, + height: None, + }) }) .collect(); config @@ -236,6 +240,9 @@ impl ClientShellConfig { }; if self.keybinding_source == ClientShellKeybindingSource::Endpoint { for command in commands { + let Ok(action) = command.action.try_into() else { + continue; + }; keybinds .keybinds .custom_commands @@ -245,7 +252,7 @@ impl ClientShellConfig { )?, label: command.binding_label.clone(), command: command.command_id.clone(), - action: command.action.into(), + action, description: command.description.clone(), width: None, height: None, |
