Skip to content

adk run does not support arrow keys or input history #8022

Description

@Stephnn0

🔴 Required Information

Describe the Bug:
In adk run, the arrow keys don't work at the [user]: prompt. Pressing arrow up prints ^[[A instead of recalling the previous message, and left/right arrows can't move the cursor to edit a line.

Steps to Reproduce:

  1. pip install google-adk
  2. Create any agent folder and run adk run my_agent
  3. Send a message, e.g. hello
  4. At the next [user]: prompt, press arrow up

Expected Behavior:
Arrow up recalls hello, like in most terminal programs (and the Python REPL).

Observed Behavior:
^[[A is printed. If you press Enter, the raw escape sequence '\x1b[A' is sent to the agent as the message.

Environment Details:

  • ADK Library Version (pip show google-adk): 2.14.0
  • Desktop OS: macOS
  • Python Version (python -V): 3.12

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-3.5-flash (not model-specific)

🟡 Optional Information

Additional Context:
run_interactively in src/google/adk/cli/cli.py reads input with the built-in input(). input() only provides line editing and history after the readline module has been imported, and the CLI never imports it. Importing readline (when available; it is not on Windows) fixes it. I'm happy to send a PR.

How often has this issue occurred?:

  • Always (100%)

Activity

  1. self-assigned this
    on Nov 9, 2026
  2. added theissue type on Nov 9, 2026
  3. llalitkumarrr commented on Nov 12, 2026

    @llalitkumarrr
    Collaborator

    Hello @Stephnn0,

    Thanks for the clear report and the fix. We reproduced the issue and also checked #8023 which should fixes it. The arrow up now brings back the previous message instead of sending ^[[A. The change looks good but still require an in-depth review and approval from reviewer. So could you please sign the CLA so the PR can be moved forward and reviewed by reviewer?

  4. added
    request clarification[Status] The maintainer need clarification or more information from the author
    cli[Component] This issue is related to cli
    and removed
    request clarification[Status] The maintainer need clarification or more information from the author
    on Nov 12, 2026
  5. Stephnn0 commented on Nov 12, 2026

    @Stephnn0
    Author

    Hi @llalitkumarrr

    Thanks for reproducing the issue and testing the fix!
    I've signed the CLA and the check on #8023 now passes. It's ready for review whenever a
    reviewer has time. I'm happy to make any changes they ask for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

cli[Component] This issue is related to cli

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions