mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-29 13:44:43 +00:00
0c6105992c
Allows Zed to open custom `zed://` links (redirects from https://zed.dev/channels) on Linux used XDG MIME types. This PR also allows the CLI to be able to open Zed (`zed://`) URIs directly instead of executing the main executable in `/usr/libexec/zed-editor`. Release Notes: - Linux: Allow `zed.dev/channel` (`zed://`) URIs to open on Linux - CLI: Ability to open URIs from the command line --------- Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
31 lines
840 B
Rust
31 lines
840 B
Rust
pub use ipc_channel::ipc;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Serialize, Deserialize)]
|
|
pub struct IpcHandshake {
|
|
pub requests: ipc::IpcSender<CliRequest>,
|
|
pub responses: ipc::IpcReceiver<CliResponse>,
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub enum CliRequest {
|
|
Open {
|
|
paths: Vec<String>,
|
|
urls: Vec<String>,
|
|
wait: bool,
|
|
open_new_workspace: Option<bool>,
|
|
dev_server_token: Option<String>,
|
|
},
|
|
}
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
pub enum CliResponse {
|
|
Ping,
|
|
Stdout { message: String },
|
|
Stderr { message: String },
|
|
Exit { status: i32 },
|
|
}
|
|
|
|
/// When Zed started not as an *.app but as a binary (e.g. local development),
|
|
/// there's a possibility to tell it to behave "regularly".
|
|
pub const FORCE_CLI_MODE_ENV_VAR_NAME: &str = "ZED_FORCE_CLI_MODE";
|