You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PaneInfo that a plugin receives on PaneUpdate-events contains the terminal_command as a string. This string is however missing the quotes that the command was launched with, e.g.: bash -ic ssh server instead of the expected bash -ic "ssh server".
Thus, splitting the command into it's bash-components doesn't work (["bash", "-ic", "ssh", "server"] vs. expected: ["bash", "-ic", "ssh server"]).
Minimal reproduction
use zellij_tile::prelude::*;
use std::collections::BTreeMap;
#[derive(Default)]
struct State {
manifest: PaneManifest,
}
register_plugin!(State);
impl ZellijPlugin for State {
fn load(&mut self, _configuration: BTreeMap<String, String>) {
request_permission(&[PermissionType::ReadApplicationState]);
subscribe(&[EventType::PaneUpdate]);
}
fn update(&mut self, event: Event) -> bool {
match event {
Event::PaneUpdate(manifest) => {
self.manifest = manifest;
true
}
_ => false,
}
}
fn render(&mut self, _rows: usize, _cols: usize) {
println!("The command panes:");
for panes in self.manifest.panes.values() {
for pane in panes {
if !pane.is_plugin {
println!("{:?}", &pane.terminal_command);
}
}
}
}
}
Open this plugin with zellij plugin --skip-plugin-cache -- file:/path/to/rust-plugin-example/target/wasm32-wasi/debug/rust-plugin-example.wasm , then open a command pane with zr ssh server or zellij run -- bash -ic "ssh server" and look at the output.
The output should contain Some("bash -ic \"ssh server\""), but has Some("bash -ic ssh server").
The text was updated successfully, but these errors were encountered:
Issue description
The
PaneInfo
that a plugin receives onPaneUpdate
-events contains theterminal_command
as a string. This string is however missing the quotes that the command was launched with, e.g.:bash -ic ssh server
instead of the expectedbash -ic "ssh server"
.Thus, splitting the command into it's bash-components doesn't work (
["bash", "-ic", "ssh", "server"]
vs. expected:["bash", "-ic", "ssh server"]
).Minimal reproduction
Open this plugin with
zellij plugin --skip-plugin-cache -- file:/path/to/rust-plugin-example/target/wasm32-wasi/debug/rust-plugin-example.wasm
, then open a command pane withzr ssh server
orzellij run -- bash -ic "ssh server"
and look at the output.The output should contain
Some("bash -ic \"ssh server\"")
, but hasSome("bash -ic ssh server")
.The text was updated successfully, but these errors were encountered: