feat: add support for cmd (#3277)

* feat: add support for cmd

* add preprompt and precmd support

* add keymap support

* add info about minimum Clink version

* simplify escaping

* add handling for cmd custom commands

* add support for transient_prompt and transient_rprompt

* Revert 9140579525

This reverts commit "add support for transient_prompt and transient_rprompt"

* Apply suggestions from code review

* disable cmd shell custom commands

* any shell other than cmd can be used

* better error and correct script location

* move shell check in `map_no_escaping`
This commit is contained in:
Rashil Gandhi
2022-01-10 11:17:53 +05:30
committed by GitHub
parent 20a78c1153
commit c335b4267b
14 changed files with 255 additions and 10 deletions
+4 -2
View File
@@ -292,6 +292,7 @@ impl<'a> Context<'a> {
"tcsh" => Shell::Tcsh,
"nu" => Shell::Nu,
"xonsh" => Shell::Xonsh,
"cmd" => Shell::Cmd,
_ => Shell::Unknown,
}
}
@@ -561,6 +562,7 @@ pub enum Shell {
Tcsh,
Nu,
Xonsh,
Cmd,
Unknown,
}
@@ -582,7 +584,7 @@ pub struct Properties {
/// The status code of the previously run command
#[clap(short = 's', long = "status")]
pub status_code: Option<i32>,
/// Bash and Zsh support returning codes for each process in a pipeline.
/// Bash, Fish and Zsh support returning codes for each process in a pipeline.
#[clap(long)]
pipestatus: Option<Vec<String>>,
/// The width of the current interactive terminal.
@@ -598,7 +600,7 @@ pub struct Properties {
/// The execution duration of the last command, in milliseconds
#[clap(short = 'd', long)]
pub cmd_duration: Option<String>,
/// The keymap of fish/zsh
/// The keymap of fish/zsh/cmd
#[clap(short = 'k', long, default_value = "viins")]
pub keymap: String,
/// The number of currently running jobs