Sign in

    proton_shell

    Native shell helpers for MoonBit.

    shell
    desktop
    native
    windows
    Download zip
    Version
    0.6.0
    License
    Apache-2.0
    Last updated
    9 hours ago
    Downloads
    23K

    moonbit-community/proton_shell does not have a README file

    ShellError

    pub suberror ShellError {
    ShellError(operation~ : String, target~ : String, reason~ : String)
    } derive(
    Debug
    )

    A platform shell request could not be completed.

    ShellError::output

    fn ShellError::output(self : ShellError, logger : &Logger) -> Unit

    ShellError::to_string

    fn ShellError::to_string(self : ShellError) -> String

    beep

    fn beep() -> Result[Unit, String]

    Plays the operating system's default alert sound.

    On Windows this calls MessageBeep. On macOS and Linux it writes the terminal bell escape to stderr. Returns Ok(()) when the platform has a beep backend.

    ensure_supported

    fn ensure_supported() -> Result[Unit, String]

    Verifies that the current native platform is supported by this package.

    Returns Ok(()) on supported platforms and an explanatory Err(String) on unsupported targets.

    is_supported

    fn is_supported() -> Bool

    Returns true when the current native target has a shell backend that this package knows how to call.

    open

    async fn open(target : String) -> Unit raise ShellError

    Opens a URL or filesystem path with its default application.

    Uses ShellExecuteW on Windows, /usr/bin/open on macOS, and gio open on Linux. Linux requires gio and a desktop session with a default handler. Raises ShellError on failure. Waiting for an external tool yields to other tasks; cancellation terminates and reaps the tool using async's process lifecycle. Success means the platform accepted the request, not that the target app finished starting.

    reveal_item

    async fn reveal_item(path : String) -> Unit raise ShellError

    Opens the native file manager and selects the filesystem entry at path.

    Uses Explorer on Windows, /usr/bin/open -R on macOS, and FileManager1 ShowItems via dbus-send on Linux. Linux requires dbus-send and a file manager implementing that session-bus interface. Raises ShellError on failure. External-tool waits yield and participate in task cancellation.

    trash_item

    async fn trash_item(path : String) -> Unit raise ShellError

    Moves path to the operating-system trash or recycle bin.

    Uses the recycle bin on Windows, Finder Trash on macOS, and gio trash on Linux. Raises ShellError on failure. The Linux tool wait yields and participates in task cancellation.

    Source Files

    Powered by MoonBit

    Site sourceReport issuePackagesBuild queueSkillsStatistics

    © 2026 mooncakes.io