Compare commits

...

2 Commits

Author SHA1 Message Date
Joey Yu
e4c555cd53 blue -> cyan 2026-02-09 13:17:53 -08:00
Joey Yu
b2b7303352 add --last after exit 2026-02-09 13:09:09 -08:00
2 changed files with 21 additions and 18 deletions

View File

@@ -396,12 +396,12 @@ fn format_exit_messages(exit_info: AppExitInfo, color_enabled: bool) -> Vec<Stri
if let Some(resume_cmd) =
codex_core::util::resume_command(thread_name.as_deref(), conversation_id)
{
let command = if color_enabled {
resume_cmd.cyan().to_string()
let hint = if color_enabled {
format!("{} (or {})", resume_cmd.cyan(), "--last".cyan())
} else {
resume_cmd
format!("{resume_cmd} (or --last)")
};
lines.push(format!("To continue this session, run {command}"));
lines.push(format!("To continue this session, run {hint}"));
}
lines
@@ -1153,7 +1153,7 @@ mod tests {
lines,
vec![
"Token usage: total=2 input=0 output=2".to_string(),
"To continue this session, run codex resume 123e4567-e89b-12d3-a456-426614174000"
"To continue this session, run codex resume 123e4567-e89b-12d3-a456-426614174000 (or --last)"
.to_string(),
]
);
@@ -1165,6 +1165,7 @@ mod tests {
let lines = format_exit_messages(exit_info, true);
assert_eq!(lines.len(), 2);
assert!(lines[1].contains("\u{1b}[36m"));
assert!(lines[1].contains("\u{1b}[34m"));
}
#[test]
@@ -1178,7 +1179,7 @@ mod tests {
lines,
vec![
"Token usage: total=2 input=0 output=2".to_string(),
"To continue this session, run codex resume my-thread".to_string(),
"To continue this session, run codex resume my-thread (or --last)".to_string(),
]
);
}

View File

@@ -159,6 +159,17 @@ fn session_summary(
})
}
fn resume_hint_line(command: String) -> Line<'static> {
vec![
"To continue this session, run ".into(),
command.cyan(),
" (or ".into(),
"--last".cyan(),
")".into(),
]
.into()
}
fn errors_for_cwd(cwd: &Path, response: &ListSkillsResponseEvent) -> Vec<SkillErrorInfo> {
response
.skills
@@ -1338,8 +1349,7 @@ impl App {
if let Some(summary) = summary {
let mut lines: Vec<Line<'static>> = vec![summary.usage_line.clone().into()];
if let Some(command) = summary.resume_command {
let spans = vec!["To continue this session, run ".into(), command.cyan()];
lines.push(spans.into());
lines.push(resume_hint_line(command));
}
self.chat_widget.add_plain_history_lines(lines);
}
@@ -1416,11 +1426,7 @@ impl App {
let mut lines: Vec<Line<'static>> =
vec![summary.usage_line.clone().into()];
if let Some(command) = summary.resume_command {
let spans = vec![
"To continue this session, run ".into(),
command.cyan(),
];
lines.push(spans.into());
lines.push(resume_hint_line(command));
}
self.chat_widget.add_plain_history_lines(lines);
}
@@ -1476,11 +1482,7 @@ impl App {
let mut lines: Vec<Line<'static>> =
vec![summary.usage_line.clone().into()];
if let Some(command) = summary.resume_command {
let spans = vec![
"To continue this session, run ".into(),
command.cyan(),
];
lines.push(spans.into());
lines.push(resume_hint_line(command));
}
self.chat_widget.add_plain_history_lines(lines);
}