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
{{ message }}
Repository navigation
Desktop: no way to open a local folder or reveal a file, because Tx::open_url refuses file: links #147
Tx::open_url("file:///home/me/Pictures") returns OpenUrlError::UnsupportedScheme("file"). That is on purpose (open_url.rs#L3-L5, #L76-L90 at devd03349e2), and keeping links to http, https and mailto is a good rule. But Rune has no other call for local paths, so every desktop app that has "Open folder" or "Show in folder" spawns platform commands itself.
Asks
Two desktop-only calls on Tx, separate from open_url, taking a &Path that must exist:
open_path(path): open a file or folder in its default app.
macOS: NSWorkspace openURL: with a file URL.
Windows: ShellExecuteW with the path.
Linux: the OpenURI portal (OpenFile for a file, OpenDirectory for a folder) when present, else xdg-open.
reveal_path(path): show the item selected in the file manager.
Linux: org.freedesktop.FileManager1.ShowItems on the session bus, else open the parent folder.
Both should follow the open_url pattern: the check runs in the handler, the open runs after the frame, and headless runs keep the requests for tests (as Runtime::take_url_requests does).
Our workaround
We spawn open -R <file> on macOS, explorer /select,<file> on Windows and xdg-open <parent> on Linux for "Show in folder", and open, explorer or xdg-open for "Open folder". On Linux that cannot select the file, and inside a sandbox xdg-open may not be there.
Done when: Tx::open_path and Tx::reveal_path exist on macOS, Windows and Linux, reveal_path selects the file in Finder, Explorer and GNOME Files, a missing path returns an error in the handler, and headless runs record the requests.
Another case: a clipboard history that records copied files. It needs to open a file with its default app and reveal it in Finder (activateFileViewerSelectingURLs). Both go through NSWorkspace via objc2 today.
Tx::open_path(path) (open a file or folder in its default app) and Tx::reveal_path(path) (select the item in Finder, Explorer, or the Linux file manager), keeping Tx::open_url restricted to http:, https:, and mailto: links.
OpenPathError, PathAction, PathRequest, and Runtime::take_path_requests() for headless runs and tests.
Open and Reveal buttons for dropped files in examples/drop-files (also viewable via --scene dropped).
use std::path::Path;use rune::{el,Tx};let _ = el().on_press_tx(|_,tx:&mutTx| {let _ = tx.reveal_path(Path::new("/path/to/export.csv"));});
Difference from the proposal
To keep filesystem I/O out of Rune's UI-thread frame loop, open_path and reveal_path validate syntax only in the handler (Empty, embedded NUL -> Invalid, web/mobile -> Unsupported) instead of calling stat synchronously, and run path resolution and OS launch off the UI thread after the frame. If you have a use case that requires synchronous existence checks or a different behaviour, please comment or reopen.
Design & verification
Follows Electron (shell.openPath / shell.showItemInFolder), Apple NSWorkspace (with main-queue dispatch and NSURL::fileURLWithPath:isDirectory: after background resolution), Win32 ShellExecuteW / SHOpenFolderAndSelectItems, Freedesktop org.freedesktop.portal.OpenURI (OpenFile / OpenDirectory) + org.freedesktop.FileManager1.ShowItems (with xdg-open fallback), and Rune's Tx::open_url.
Verified: Windows unit/headless tests (open_path, open_url, window_requests, runtime::input, runtime::web, drop-files), macOS unit tests (open_path, open_url), Linux cargo check with default dbus and --no-default-features, and wasm32 WebGPU/WebGL checks.
Not verified live: real desktop launches in Finder, Explorer, GNOME Files/portal, or xdg-open, and interactive desktop windows.
Activity
Stringsaeed commentedon Nov 10, 2026
Another case: a clipboard history that records copied files. It needs to open a file with its default app and reveal it in Finder (
activateFileViewerSelectingURLs). Both go through NSWorkspace via objc2 today.Hona commentedon Nov 24, 2026
Implemented on
devin #1947 (e725e0665).What was added
Tx::open_path(path)(open a file or folder in its default app) andTx::reveal_path(path)(select the item in Finder, Explorer, or the Linux file manager), keepingTx::open_urlrestricted tohttp:,https:, andmailto:links.OpenPathError,PathAction,PathRequest, andRuntime::take_path_requests()for headless runs and tests.examples/drop-files(also viewable via--scene dropped).Difference from the proposal
To keep filesystem I/O out of Rune's UI-thread frame loop,
open_pathandreveal_pathvalidate syntax only in the handler (Empty, embedded NUL ->Invalid, web/mobile ->Unsupported) instead of callingstatsynchronously, and run path resolution and OS launch off the UI thread after the frame. If you have a use case that requires synchronous existence checks or a different behaviour, please comment or reopen.Design & verification
shell.openPath/shell.showItemInFolder), AppleNSWorkspace(with main-queue dispatch andNSURL::fileURLWithPath:isDirectory:after background resolution), Win32ShellExecuteW/SHOpenFolderAndSelectItems, Freedesktoporg.freedesktop.portal.OpenURI(OpenFile/OpenDirectory) +org.freedesktop.FileManager1.ShowItems(withxdg-openfallback), and Rune'sTx::open_url.open_path,open_url,window_requests,runtime::input,runtime::web,drop-files), macOS unit tests (open_path,open_url), Linuxcargo checkwith defaultdbusand--no-default-features, andwasm32WebGPU/WebGL checks.xdg-open, and interactive desktop windows.