feat: add private shell control protocol

This commit is contained in:
Samuel Onoja committed 2026-09-25 06:33:48 +01:00
1 parent a836b55eb9
commit 75ae44c1d7
12 files changed
+727

No files matched your search

+28
View File
@@ -52,6 +52,10 @@ impl LaunchConfig {
client_capabilities.insert(ClientCapabilities::EFFECTS);
continue;
}
if argument == "--grant-shell-control" {
client_capabilities.insert(ClientCapabilities::SHELL_CONTROL);
continue;
}
if let Some(value) = argument
.to_str()
.and_then(|argument| argument.strip_prefix("--backend="))
@@ -164,6 +168,30 @@ mod tests {
);
}
#[test]
fn explicitly_grants_shell_control_to_the_launched_private_client() {
let config = LaunchConfig::parse(
[
OsString::from("--grant-shell-control"),
OsString::from("ferese-shell"),
],
true,
)
.unwrap();
assert_eq!(config.client, [OsString::from("ferese-shell")]);
assert!(
config
.client_capabilities
.contains(ClientCapabilities::SHELL_CONTROL)
);
assert!(
!config
.client_capabilities
.contains(ClientCapabilities::EFFECTS)
);
}
#[test]
fn rejects_an_unknown_backend() {
let error =