From 54f82eb16693e42f223dd4fe01d5a2bddb181130 Mon Sep 17 00:00:00 2001 From: Leon <52263845+Fleebee@users.noreply.github.com> Date: Wed, 14 Feb 2024 20:42:06 +0000 Subject: [PATCH] Add double quote wrap in activate_python_virtual_environment (#7787) Added double quote wrap in activate_python_virtual_environment to handle spaces in path. Would fail to find venv activate script when spaces exist. Release Notes: - Fixed venv_detection activation not finding directory if space is in the path ![image](https://github.com/zed-industries/zed/assets/52263845/9bf95b92-c6d4-4e2c-9158-d91a41c10216) - With changes ![image](https://github.com/zed-industries/zed/assets/52263845/93602ae7-d991-494b-89c3-5afcce556888) --- crates/project/src/terminals.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/project/src/terminals.rs b/crates/project/src/terminals.rs index e125af052d..5109f9e126 100644 --- a/crates/project/src/terminals.rs +++ b/crates/project/src/terminals.rs @@ -124,7 +124,10 @@ impl Project { // Paths are not strings so we need to jump through some hoops to format the command without `format!` let mut command = Vec::from(activate_command.as_bytes()); command.push(b' '); + // Wrapping path in double quotes to catch spaces in folder name + command.extend_from_slice(b"\""); command.extend_from_slice(activate_script.as_os_str().as_encoded_bytes()); + command.extend_from_slice(b"\""); command.push(b'\n'); terminal_handle.update(cx, |this, _| this.input_bytes(command));