1pub use ipc_channel::ipc;
2use serde::{Deserialize, Serialize};
3
4#[derive(Serialize, Deserialize)]
5pub struct IpcHandshake {
6 pub requests: ipc::IpcSender<CliRequest>,
7 pub responses: ipc::IpcReceiver<CliResponse>,
8}
9
10#[derive(Debug, Serialize, Deserialize)]
11pub enum CliRequest {
12 Open {
13 paths: Vec<String>,
14 wait: bool,
15 open_new_workspace: Option<bool>,
16 },
17}
18
19#[derive(Debug, Serialize, Deserialize)]
20pub enum CliResponse {
21 Ping,
22 Stdout { message: String },
23 Stderr { message: String },
24 Exit { status: i32 },
25}
26
27/// When Zed started not as an *.app but as a binary (e.g. local development),
28/// there's a possibility to tell it to behave "regularly".
29pub const FORCE_CLI_MODE_ENV_VAR_NAME: &str = "ZED_FORCE_CLI_MODE";