zed-industries/zed · error
Couldn't open file picker due to missing xdg-desktop-portal
Error message
Couldn't open file picker due to missing xdg-desktop-portal implementation.
What it means
Raised in prompt_for_paths when the ashpd xdg-desktop-portal OpenFileRequest fails to send: the system has no (or a broken) xdg-desktop-portal implementation, so native file/folder pickers cannot be shown.
Source
Thrown at crates/gpui_linux/src/linux/platform.rs:490
"Open Folder"
} else {
"Open File"
};
let request = match ashpd::desktop::file_chooser::OpenFileRequest::default()
.identifier(identifier.await)
.modal(true)
.title(title)
.accept_label(options.prompt.as_ref().map(gpui::SharedString::as_str))
.multiple(options.multiple)
.directory(options.directories)
.send()
.await
{
Ok(request) => request,
Err(err) => {
let result = match err {
ashpd::Error::PortalNotFound(_) => anyhow!(FILE_PICKER_PORTAL_MISSING),
err => err.into(),
};
let _ = done_tx.send(Err(result));
return;
}
};
let result = match request.response() {
Ok(response) => Ok(Some(
response
.uris()
.iter()
.filter_map(|uri: &ashpd::Uri| url::Url::parse(uri.as_str()).ok())
.filter_map(|uri: url::Url| uri.to_file_path().ok())
.collect::<Vec<_>>(),
)),
Err(ashpd::Error::Response(_)) => Ok(None),
Err(e) => Err(e.into()),View on GitHub (pinned to 9d272b0363)
Solutions
- Install xdg-desktop-portal and a desktop backend (e.g. xdg-desktop-portal-gtk or -kde)
- Ensure the portal service is running: `systemctl --user status xdg-desktop-portal`
- Verify XDG_CURRENT_DESKTOP / portal environment is set correctly in the session
- Fall back to a native file dialog path if the environment cannot provide portals
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at crates/gpui_linux/src/linux/platform.rs:435 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of zed-industries/zed@9d272b0363 (2026-08-20).
Data as JSON: /api/errors/c2663175a7a79768.
Report an issue: GitHub.