mirror of
https://github.com/wez/wezterm.git
synced 2024-11-23 06:54:45 +03:00
Improve exit_behavior messaging some more
This commit is contained in:
parent
eefe4bd201
commit
6cad4c35e9
@ -271,10 +271,16 @@ impl Domain for LocalDomain {
|
|||||||
let pane_id = alloc_pane_id();
|
let pane_id = alloc_pane_id();
|
||||||
cmd.env("WEZTERM_PANE", pane_id.to_string());
|
cmd.env("WEZTERM_PANE", pane_id.to_string());
|
||||||
|
|
||||||
|
let command_line = cmd
|
||||||
|
.as_unix_command_line()
|
||||||
|
.unwrap_or_else(|err| format!("error rendering command line: {:?}", err));
|
||||||
let command_description = format!(
|
let command_description = format!(
|
||||||
"\"{}\" in domain \"{}\"",
|
"\"{}\" in domain \"{}\"",
|
||||||
cmd.as_unix_command_line()
|
if command_line.is_empty() {
|
||||||
.unwrap_or_else(|err| format!("error rendering command line: {:?}", err)),
|
cmd.get_shell()?
|
||||||
|
} else {
|
||||||
|
command_line
|
||||||
|
},
|
||||||
self.name
|
self.name
|
||||||
);
|
);
|
||||||
let child = pair.slave.spawn_command(cmd)?;
|
let child = pair.slave.spawn_command(cmd)?;
|
||||||
|
@ -174,7 +174,7 @@ impl Pane for LocalPane {
|
|||||||
(ExitBehavior::Hold, success, false) => {
|
(ExitBehavior::Hold, success, false) => {
|
||||||
if success {
|
if success {
|
||||||
notify = Some(format!(
|
notify = Some(format!(
|
||||||
"\r\n👍Process {} completed.\r\n{}=\"Hold\"\r\n",
|
"\r\n👍 Process {} completed.\r\n{}=\"Hold\"\r\n",
|
||||||
self.command_description, EXIT_BEHAVIOR
|
self.command_description, EXIT_BEHAVIOR
|
||||||
));
|
));
|
||||||
} else {
|
} else {
|
||||||
|
@ -318,7 +318,7 @@ impl CommandBuilder {
|
|||||||
/// Determine which shell to run.
|
/// Determine which shell to run.
|
||||||
/// We take the contents of the $SHELL env var first, then
|
/// We take the contents of the $SHELL env var first, then
|
||||||
/// fall back to looking it up from the password database.
|
/// fall back to looking it up from the password database.
|
||||||
fn get_shell(&self) -> anyhow::Result<String> {
|
pub fn get_shell(&self) -> anyhow::Result<String> {
|
||||||
if let Some(shell) = self.get_env("SHELL").and_then(OsStr::to_str) {
|
if let Some(shell) = self.get_env("SHELL").and_then(OsStr::to_str) {
|
||||||
return Ok(shell.into());
|
return Ok(shell.into());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user