Closes #36188 ## Todo * [x] CLI * [x] terminals * [x] tasks ## For future PRs * debugging * UI for opening WSL projects * fixing workspace state restoration Release Notes: - Windows alpha: Zed now supports editing folders in WSL. --------- Co-authored-by: Junkui Zhang <364772080@qq.com>
36 lines
976 B
Rust
36 lines
976 B
Rust
use collections::HashMap;
|
|
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>,
|
|
diff_paths: Vec<[String; 2]>,
|
|
wsl: Option<String>,
|
|
wait: bool,
|
|
open_new_workspace: Option<bool>,
|
|
env: Option<HashMap<String, String>>,
|
|
user_data_dir: 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";
|