Avoid duplicate term type in the asciicast v3 header

This commit is contained in:
Marcin Kulik
2025-05-04 21:41:59 +02:00
parent 7beded912d
commit 0dee9c5c6f
2 changed files with 5 additions and 5 deletions

View File

@@ -66,7 +66,7 @@ pub struct Record {
#[arg(long, short = 'I', alias = "stdin")]
pub rec_input: bool,
/// List of env vars to capture [default: TERM,SHELL]
/// List of env vars to capture [default: SHELL]
#[arg(long, value_name = "VARS")]
pub rec_env: Option<String>,
@@ -140,7 +140,7 @@ pub struct Stream {
#[arg(long, short = 'I')]
pub rec_input: bool,
/// List of env vars to capture [default: TERM,SHELL]
/// List of env vars to capture [default: SHELL]
#[arg(long, value_name = "VARS")]
pub rec_env: Option<String>,
@@ -183,7 +183,7 @@ pub struct Session {
#[arg(long, short = 'I')]
pub rec_input: bool,
/// List of env vars to capture [default: TERM,SHELL]
/// List of env vars to capture [default: SHELL]
#[arg(long, value_name = "VARS")]
pub rec_env: Option<String>,

View File

@@ -45,7 +45,7 @@ impl cli::Session {
let record_input = self.rec_input || cmd_config.rec_input;
let term_type = self.get_term_type();
let term_version = self.get_term_version()?;
let env = capture_env(self.rec_env.clone(), cmd_config);
let env = capture_env(self.rec_env.take(), cmd_config);
let path = self
.output_file
@@ -497,7 +497,7 @@ fn get_key_bindings(config: &config::Session) -> Result<KeyBindings> {
fn capture_env(var_names: Option<String>, config: &config::Session) -> HashMap<String, String> {
let var_names = var_names
.or(config.rec_env.clone())
.unwrap_or(String::from("TERM,SHELL"));
.unwrap_or(String::from("SHELL"));
let vars = var_names.split(',').collect::<HashSet<_>>();