Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

windows: Fix terminal inline assistant (#25715)

张小白a0d1555470d2
diff --git a/crates/assistant/src/terminal_inline_assistant.rs b/crates/assistant/src/terminal_inline_assistant.rs
index a4f27db6cab..5a12efed262 100644
--- a/crates/assistant/src/terminal_inline_assistant.rs
+++ b/crates/assistant/src/terminal_inline_assistant.rs
@@ -1054,7 +1054,10 @@ pub enum CodegenEvent {
impl EventEmitter<CodegenEvent> for Codegen {}
+#[cfg(not(target_os = "windows"))]
const CLEAR_INPUT: &str = "\x15";
+#[cfg(target_os = "windows")]
+const CLEAR_INPUT: &str = "\x03";
const CARRIAGE_RETURN: &str = "\x0d";
struct TerminalTransaction {
diff --git a/crates/assistant2/src/terminal_codegen.rs b/crates/assistant2/src/terminal_codegen.rs
index 5a1873fe556..106eac61717 100644
--- a/crates/assistant2/src/terminal_codegen.rs
+++ b/crates/assistant2/src/terminal_codegen.rs
@@ -155,7 +155,10 @@ pub enum CodegenEvent {
Finished,
}
+#[cfg(not(target_os = "windows"))]
pub const CLEAR_INPUT: &str = "\x15";
+#[cfg(target_os = "windows")]
+pub const CLEAR_INPUT: &str = "\x03";
const CARRIAGE_RETURN: &str = "\x0d";
struct TerminalTransaction {