debugger: Fix spawned debug adapters taking over Zed's shell (#29373)
This fixes a bug where Zed wasn't closable via ctl-c in the shell it was spawned in after starting a debug adapter Release Notes: - N/A Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
c147daae4a
commit
a98c648201
1 changed files with 6 additions and 2 deletions
|
@ -552,7 +552,9 @@ impl TcpTransport {
|
||||||
let host = connection_args.host;
|
let host = connection_args.host;
|
||||||
let port = connection_args.port;
|
let port = connection_args.port;
|
||||||
|
|
||||||
let mut command = util::command::new_smol_command(&binary.command);
|
let mut command = util::command::new_std_command(&binary.command);
|
||||||
|
util::set_pre_exec_to_start_new_session(&mut command);
|
||||||
|
let mut command = smol::process::Command::from(command);
|
||||||
|
|
||||||
if let Some(cwd) = &binary.cwd {
|
if let Some(cwd) = &binary.cwd {
|
||||||
command.current_dir(cwd);
|
command.current_dir(cwd);
|
||||||
|
@ -636,7 +638,9 @@ pub struct StdioTransport {
|
||||||
impl StdioTransport {
|
impl StdioTransport {
|
||||||
#[allow(dead_code, reason = "This is used in non test builds of Zed")]
|
#[allow(dead_code, reason = "This is used in non test builds of Zed")]
|
||||||
async fn start(binary: &DebugAdapterBinary, _: AsyncApp) -> Result<(TransportPipe, Self)> {
|
async fn start(binary: &DebugAdapterBinary, _: AsyncApp) -> Result<(TransportPipe, Self)> {
|
||||||
let mut command = util::command::new_smol_command(&binary.command);
|
let mut command = util::command::new_std_command(&binary.command);
|
||||||
|
util::set_pre_exec_to_start_new_session(&mut command);
|
||||||
|
let mut command = smol::process::Command::from(command);
|
||||||
|
|
||||||
if let Some(cwd) = &binary.cwd {
|
if let Some(cwd) = &binary.cwd {
|
||||||
command.current_dir(cwd);
|
command.current_dir(cwd);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue