Skip to content

Unexpected behavior in scrolling through command lines #4834

@lyu-oai

Description

@lyu-oai

What version of Codex is running?

codex-cli 0.44.0

Which model were you using?

gpt-5-codex

What platform is your computer?

Darwin 24.6.0 arm64 arm

What steps can reproduce the bug?

Suppose our history is

command1
command2
command3

I then

  • press <up> twice to get to command2.
  • I then DELETE the entire line, whether through ctrl-c or simply backspace
  • press <up> again

What is the expected behavior?

In bash / zsh / every shell I have used, the logic is

  • "if you try to navigate (up/down arrow keys) after deleting the whole line, you should restart from the end (or beginning, depending on how you view it)"
  • "if the line is not empty at the time of navigation, then continue up/down the history chain"

So following typical command line behavior, this should switch me back to command3.

What do you see instead?

The current behavior replaces the line with command1

Additional information

Currently I think the only way to get back to the start is holding <down> until we hit the start, or just deleting everything to write over.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions