diff --git a/codex-rs/cloud-tasks/src/lib.rs b/codex-rs/cloud-tasks/src/lib.rs index e3b6af22a9..bec75014f7 100644 --- a/codex-rs/cloud-tasks/src/lib.rs +++ b/codex-rs/cloud-tasks/src/lib.rs @@ -649,7 +649,11 @@ pub async fn run_main(_cli: Cli, _codex_linux_sandbox_exe: Option) -> a if key.modifiers.contains(KeyModifiers::CONTROL) && matches!(key.code, KeyCode::Char('c') | KeyCode::Char('C')) { - if app.apply_modal.is_some() { + if app.env_modal.is_some() { + // Close environment selector if open (don’t quit composer). + app.env_modal = None; + needs_redraw = true; + } else if app.apply_modal.is_some() { app.apply_modal = None; app.status = "Apply canceled".to_string(); needs_redraw = true; diff --git a/codex-rs/cloud-tasks/src/ui.rs b/codex-rs/cloud-tasks/src/ui.rs index 2acaebb536..44eb95efdd 100644 --- a/codex-rs/cloud-tasks/src/ui.rs +++ b/codex-rs/cloud-tasks/src/ui.rs @@ -128,13 +128,14 @@ pub fn draw_new_task_page(frame: &mut Frame, area: Rect, app: &mut App) { frame.render_widget(block.clone(), area); let content = block.inner(area); - // Clamp composer height between 3 and 6 rows for readability. + // Expand composer height up to (terminal height - 6), with a 3-line minimum. + let max_allowed = frame.area().height.saturating_sub(6).max(3); let desired = app .new_task .as_ref() .map(|p| p.composer.desired_height(content.width)) .unwrap_or(3) - .clamp(3, 6); + .clamp(3, max_allowed); // Anchor the composer to the bottom-left by allocating a flexible spacer // above it and a fixed `desired`-height area for the composer.