diff options
| author | divens <divens@users.noreply.github.com> | 2026-03-21 19:20:32 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-21 19:20:32 +0100 |
| commit | 3fa7744906d5704bdec771c74829841bd06cf7fc (patch) | |
| tree | 6c4f0bd64c2e6087ce069a466cca942f4669f513 /zellij-utils/src/plugin_api | |
| parent | Release notes and fixes (#4879) (diff) | |
| download | sl0ppij-3fa7744906d5704bdec771c74829841bd06cf7fc.tar.gz sl0ppij-3fa7744906d5704bdec771c74829841bd06cf7fc.tar.xz sl0ppij-3fa7744906d5704bdec771c74829841bd06cf7fc.zip | |
Add windows support in strider (#4854)
* Add Windows path support to strider plugin
Strider is a WASM plugin where std::path::PathBuf uses Unix semantics,
so Windows backslash paths break parent(), join(), strip_prefix(), etc.
Fix by normalizing all incoming paths to forward slashes at plugin
boundaries and converting back to native backslashes for display. A new
platform.rs module detects the host OS at runtime from the initial_cwd
format and centralizes all platform-aware logic.
Also fix scan_host_folder on the server side: canonicalize
plugin_host_folder so the starts_with security check works on Windows,
where canonicalize() adds the \?\ prefix.
* Add virtual root view for drive and WSL navigation in strider
On Windows, navigating up from a drive root (e.g. C:\) now shows a
"Computer" view listing all available drives and WSL distributions.
Drives are enumerated via GetLogicalDriveStringsW and WSL distros
via `wsl -l -q` (since read_dir on \wsl.localhost fails with OS
error 64/67). Drive letters appear before WSL entries, which are
displayed as "Ubuntu-24.04 (WSL)" etc. On non-Windows platforms,
behavior is unchanged.
* Rename ListHostEntries to ListWindowsVolumes and gate behind FullHdAccess
The old name was misleading — on Unix it just returned `/`, which isn't
"listing host entries." Rename to ListWindowsVolumes to make the
Windows-specific intent explicit, gate behind FullHdAccess permission,
and replace the Unix implementation with a log::error since the command
is not meaningful on non-Windows platforms.
* Replace direct array indexing with .get() in strider platform detection
Use safe accessors and matches! macro instead of direct byte indexing
for bounds-checked access patterns.
---------
Co-authored-by: divens <divens.dev@gmail.com>
Diffstat (limited to 'zellij-utils/src/plugin_api')
| -rw-r--r-- | zellij-utils/src/plugin_api/plugin_command.proto | 1 | ||||
| -rw-r--r-- | zellij-utils/src/plugin_api/plugin_command.rs | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/zellij-utils/src/plugin_api/plugin_command.proto b/zellij-utils/src/plugin_api/plugin_command.proto index f00ffdd1..63baa443 100644 --- a/zellij-utils/src/plugin_api/plugin_command.proto +++ b/zellij-utils/src/plugin_api/plugin_command.proto @@ -202,6 +202,7 @@ enum CommandName { SetPaneRegexHighlights = 207; ClearPaneHighlights = 208; OpenPluginPaneFloating = 209; + ListWindowsVolumes = 210; } message PluginCommand { diff --git a/zellij-utils/src/plugin_api/plugin_command.rs b/zellij-utils/src/plugin_api/plugin_command.rs index fc55dd91..a457f720 100644 --- a/zellij-utils/src/plugin_api/plugin_command.rs +++ b/zellij-utils/src/plugin_api/plugin_command.rs @@ -1296,6 +1296,10 @@ impl TryFrom<ProtobufPluginCommand> for PluginCommand { Some(_) => Err("WatchFilesystem should have no payload, found a payload"), None => Ok(PluginCommand::WatchFilesystem), }, + Some(CommandName::ListWindowsVolumes) => match protobuf_plugin_command.payload { + Some(_) => Err("ListWindowsVolumes should have no payload"), + None => Ok(PluginCommand::ListWindowsVolumes), + }, Some(CommandName::DumpSessionLayout) => match protobuf_plugin_command.payload { Some(Payload::DumpSessionLayoutPayload(payload)) => { Ok(PluginCommand::DumpSessionLayout { @@ -3137,6 +3141,10 @@ impl TryFrom<PluginCommand> for ProtobufPluginCommand { name: CommandName::WatchFilesystem as i32, payload: None, }), + PluginCommand::ListWindowsVolumes => Ok(ProtobufPluginCommand { + name: CommandName::ListWindowsVolumes as i32, + payload: None, + }), PluginCommand::DumpSessionLayout { tab_index } => Ok(ProtobufPluginCommand { name: CommandName::DumpSessionLayout as i32, payload: tab_index.map(|idx| { |
