mirror of
https://github.com/nushell/nushell.git
synced 2025-02-22 21:41:26 +01:00
Pass /D
flag to cmd.exe
to disable AutoRun (#4903)
* Pass `/D` flag to `cmd.exe` to disable AutoRun * Pass `/D` flag before `/c` This avoids running the command '/D <&self.name.item>' in cmd
This commit is contained in:
parent
a435a9924c
commit
e826540037
@ -469,6 +469,12 @@ impl ExternalCommand {
|
||||
/// Spawn a cmd command with `cmd /c args...`
|
||||
pub fn spawn_cmd_command(&self) -> std::process::Command {
|
||||
let mut process = std::process::Command::new("cmd");
|
||||
|
||||
// Disable AutoRun
|
||||
// TODO: There should be a config option to enable/disable this
|
||||
// Alternatively (even better) a config option to specify all the arguments to pass to cmd
|
||||
process.arg("/D");
|
||||
|
||||
process.arg("/c");
|
||||
process.arg(&self.name.item);
|
||||
for arg in &self.args {
|
||||
|
Loading…
Reference in New Issue
Block a user