feat: add exit slash command alias for quit (#6002)
## Summary - add the `/exit` slash command alongside `/quit` and reuse shared exit handling - refactor the chat widget to funnel quit, exit, logout, and shutdown flows through a common `request_exit` helper - add focused unit tests that confirm both `/quit` and `/exit` send an `ExitRequest` ## Testing - `just fmt` - `just fix -p codex-tui` - `cargo test -p codex-tui` ------ https://chatgpt.com/codex/tasks/task_i_6903d5a8f47c8321bf180f031f2fa330
This commit is contained in:
@@ -851,6 +851,24 @@ fn slash_init_skips_when_project_doc_exists() {
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn slash_quit_requests_exit() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual();
|
||||
|
||||
chat.dispatch_command(SlashCommand::Quit);
|
||||
|
||||
assert_matches!(rx.try_recv(), Ok(AppEvent::ExitRequest));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn slash_exit_requests_exit() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual();
|
||||
|
||||
chat.dispatch_command(SlashCommand::Exit);
|
||||
|
||||
assert_matches!(rx.try_recv(), Ok(AppEvent::ExitRequest));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn slash_undo_sends_op() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual();
|
||||
|
||||
Reference in New Issue
Block a user