mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 22:01:47 +03:00
add Display + Debug impl for SpawnCommand
This makes it look tidier in the launcher menu
This commit is contained in:
parent
509122c152
commit
5ddb40c7c8
@ -76,7 +76,7 @@ impl Default for SpawnTabDomain {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Debug, Clone, Deserialize, Serialize, PartialEq, Eq)]
|
||||
#[derive(Default, Clone, Deserialize, Serialize, PartialEq, Eq)]
|
||||
pub struct SpawnCommand {
|
||||
/// Optional descriptive label
|
||||
pub label: Option<String>,
|
||||
@ -104,6 +104,32 @@ pub struct SpawnCommand {
|
||||
pub domain: SpawnTabDomain,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for SpawnCommand {
|
||||
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
write!(fmt, "{}", self)
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for SpawnCommand {
|
||||
fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
write!(fmt, "SpawnCommand")?;
|
||||
if let Some(label) = &self.label {
|
||||
write!(fmt, " label='{}'", label)?;
|
||||
}
|
||||
write!(fmt, " domain={:?}", self.domain)?;
|
||||
if let Some(args) = &self.args {
|
||||
write!(fmt, " args={:?}", args)?;
|
||||
}
|
||||
if let Some(cwd) = &self.cwd {
|
||||
write!(fmt, " cwd={}", cwd.display())?;
|
||||
}
|
||||
for (k, v) in &self.set_environment_variables {
|
||||
write!(fmt, " {}={}", k, v)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Deserialize, Serialize, PartialEq, Eq)]
|
||||
pub enum PaneDirection {
|
||||
Up,
|
||||
|
Loading…
Reference in New Issue
Block a user