Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions codex-rs/tui/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1370,10 +1370,7 @@ impl App {
self.shutdown_current_thread().await;
self.config = resume_config;
tui.set_notification_method(self.config.tui_notification_method);
self.file_search = FileSearchManager::new(
self.config.cwd.clone(),
self.app_event_tx.clone(),
);
self.file_search.update_search_dir(self.config.cwd.clone());
let init = self.chatwidget_init_for_forked_or_resumed_thread(
tui,
self.config.clone(),
Expand Down
11 changes: 11 additions & 0 deletions codex-rs/tui/src/file_search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@ impl FileSearchManager {
}
}

/// Updates the directory used for file searches.
/// This should be called when the session's CWD changes on resume.
/// Drops the current session so it will be recreated with the new directory on next query.
pub fn update_search_dir(&mut self, new_dir: PathBuf) {
self.search_dir = new_dir;
#[expect(clippy::unwrap_used)]
let mut st = self.state.lock().unwrap();
st.session.take();
st.latest_query.clear();
}

/// Call whenever the user edits the `@` token.
pub fn on_user_query(&self, query: String) {
#[expect(clippy::unwrap_used)]
Expand Down
Loading