mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Let users remember the working directory for resumed sessions (#33950)
## What changed - Add `tui.resume_cwd` with `current` and `session` modes for resume and fork flows. - Let users persist either mode directly from the working-directory prompt, while preserving one-time choices when no preference is configured. - Apply the preference consistently during startup and in-app resume, honor explicit `--cd` overrides, and reject unsupported or unavailable directory choices with a clear error. ## Testing - Cover configuration parsing and persistence, prompt behavior, startup and in-app flows, session metadata fallback, and remote workspace constraints. GitOrigin-RevId: 7bf144c4b8c55bdb868cc8a71caf397c7740451a
This commit is contained in:
1 parent
82b294c73c
commit
2895d82b5e
21 files changed
+1469
-79
No files matched your search
@@ -43,6 +43,7 @@ use codex_config::types::MemoriesConfig;
|
||||
use codex_config::types::ModelAvailabilityNuxConfig;
|
||||
use codex_config::types::Notice;
|
||||
use codex_config::types::OAuthCredentialsStoreMode;
|
||||
use codex_config::types::ResumeCwdMode;
|
||||
use codex_config::types::SessionPickerViewMode;
|
||||
use codex_config::types::ToolSuggestConfig;
|
||||
use codex_config::types::ToolSuggestDisabledTool;
|
||||
@@ -789,6 +790,10 @@ pub struct Config {
|
||||
/// Preferred layout for resume/fork session picker results.
|
||||
pub tui_session_picker_view: SessionPickerViewMode,
|
||||
|
||||
/// Working directory to use when resuming or forking a session.
|
||||
/// When unset, prompt if the current and session directories differ.
|
||||
pub tui_resume_cwd: Option<ResumeCwdMode>,
|
||||
|
||||
/// Terminal resize-reflow tuning knobs.
|
||||
pub terminal_resize_reflow: TerminalResizeReflowConfig,
|
||||
|
||||
@@ -4118,6 +4123,7 @@ impl Config {
|
||||
.as_ref()
|
||||
.and_then(|t| t.session_picker_view)
|
||||
.unwrap_or_default(),
|
||||
tui_resume_cwd: cfg.tui.as_ref().and_then(|t| t.resume_cwd),
|
||||
terminal_resize_reflow,
|
||||
tui_keymap: cfg
|
||||
.tui
|
||||
|
||||
Reference in new issue
Block a user