Use ShellKind::try_quote whenever we need to quote shell args (#41104)
Re-reverts https://github.com/zed-industries/zed/commit/8f4646d6c357409cfc286104088b4d21f2bea851 with fixes Release Notes: - N/A
This commit is contained in:
@@ -32,7 +32,7 @@ use ui::{
|
||||
SharedString, Styled, StyledExt, ToggleButton, ToggleState, Toggleable, Tooltip, Window, div,
|
||||
h_flex, relative, rems, v_flex,
|
||||
};
|
||||
use util::{ResultExt, rel_path::RelPath};
|
||||
use util::{ResultExt, rel_path::RelPath, shell::ShellKind};
|
||||
use workspace::{ModalView, Workspace, notifications::DetachAndPromptErr, pane};
|
||||
|
||||
use crate::{attach_modal::AttachModal, debugger_panel::DebugPanel};
|
||||
@@ -839,7 +839,11 @@ impl ConfigureMode {
|
||||
};
|
||||
}
|
||||
let command = self.program.read(cx).text(cx);
|
||||
let mut args = shlex::split(&command).into_iter().flatten().peekable();
|
||||
let mut args = ShellKind::Posix
|
||||
.split(&command)
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.peekable();
|
||||
let mut env = FxHashMap::default();
|
||||
while args.peek().is_some_and(|arg| arg.contains('=')) {
|
||||
let arg = args.next().unwrap();
|
||||
@@ -1265,7 +1269,11 @@ impl PickerDelegate for DebugDelegate {
|
||||
})
|
||||
.unwrap_or_default();
|
||||
|
||||
let mut args = shlex::split(&text).into_iter().flatten().peekable();
|
||||
let mut args = ShellKind::Posix
|
||||
.split(&text)
|
||||
.into_iter()
|
||||
.flatten()
|
||||
.peekable();
|
||||
let mut env = HashMap::default();
|
||||
while args.peek().is_some_and(|arg| arg.contains('=')) {
|
||||
let arg = args.next().unwrap();
|
||||
|
||||
Reference in New Issue
Block a user