Up/down arrows should cycle through user messages within current thread

Resolved 💬 8 comments Opened Mar 10, 2026 by kendonB Closed May 10, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of Codex CLI is running?

codex-cli 0.112.0

What subscription do you have?

ChatGPT Pro

Which model were you using?

N/A

What platform is your computer?

Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64

What terminal emulator and version are you using (if applicable)?

Windows Terminal WSL

What issue are you seeing?

Up/down arrow browses all recent messages for all chats, when it should search just the current chat. I do like that it goes back to previous chats from the same folder, however.

The ideal behaviour would be for up to cycle:

  • The user messages from the active session
  • THEN, previous user messages from all other sessions in that directory, in chronological order, such that pressing up past the first message of the current session jumps to the last message from a previous session

What steps can reproduce the bug?

Have two sessions open in two separate folders. Cycle messages with up/down.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

8 Comments

github-actions[bot] contributor · 4 months ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #12085
  • #10512

Powered by Codex Action

kendonB · 4 months ago

Related to #12085 and #10512 but this issue is for the cli (behaviour, though, should be aligned between app and cli).

etraut-openai contributor · 4 months ago

I think this behavior is intended. I frequently make use of this behavior. I'll enter a prompt, then realize that I want to start a new thread, so I type /new, then I hit up to restore the previous prompt.

kendonB · 4 months ago

Indeed, you get this behaviour with my suggestion:

"""
The ideal behaviour would be for up to cycle:

The user messages from the active session
THEN, previous user messages from all other sessions in that directory, in chronological order, such that pressing up past the first message of the current session jumps to the last message from a previous session
"""

etraut-openai contributor · 4 months ago

OK, I'll change this from a bug report to an enhancement request, and we'll see if it gets upvotes.

kendonB · 4 months ago

Thank you. I do think the specific behaviour that you can cycle through messages that originate from sessions in other folders should be considered a bug

onezibo · 3 months ago
OK, I'll change this from a bug report to an enhancement request, and we'll see if it gets upvotes.

I have an implementation for this issue in my fork:
https://github.com/onezibo/codex/tree/feat/history-cwd-scope

Changes (5 files, +224/-98):

  • Add cwd field to HistoryEntry with backward-compatible #[serde(default)]
  • Thread cwd: &Path through append_entry, history_metadata, lookup
  • Core handlers now snapshot session cwd (not immutable config cwd) before spawn
  • Extract scan_matching_entries<T>() to deduplicate lock+iterate+filter logic
  • 6 unit tests covering cwd filtering, metadata counting, and regression

Would it be possible to get collaborator access to open a PR,
or could a maintainer cherry-pick from my branch?

etraut-openai contributor · 2 months ago

This feature request hasn't received enough upvotes, so I'm going to close it.