2022-04-15 23:33:56 +00:00
|
|
|
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 {
|
2024-03-12 20:27:58 +00:00
|
|
|
Open {
|
|
|
|
paths: Vec<String>,
|
|
|
|
wait: bool,
|
|
|
|
open_new_workspace: Option<bool>,
|
2024-05-10 03:08:49 +00:00
|
|
|
dev_server_token: Option<String>,
|
2024-03-12 20:27:58 +00:00
|
|
|
},
|
2022-04-15 23:33:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[derive(Debug, Serialize, Deserialize)]
|
|
|
|
pub enum CliResponse {
|
2022-04-20 10:54:34 +00:00
|
|
|
Ping,
|
2022-04-15 23:33:56 +00:00
|
|
|
Stdout { message: String },
|
|
|
|
Stderr { message: String },
|
|
|
|
Exit { status: i32 },
|
|
|
|
}
|
2023-05-16 11:45:50 +00:00
|
|
|
|
|
|
|
/// 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";
|