mirror of
https://github.com/nushell/nushell
synced 2024-12-28 14:03:09 +00: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
1 changed files with 6 additions and 0 deletions
|
@ -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 a new issue