Skip to content

Preserve show_frame when reusing asynchronous prompts - #2160

Open
fanaruto wants to merge 2 commits into
prompt-toolkit:mainfrom
fanaruto:codex/preserve-async-prompt-frame
Open

fanaruto wants to merge 2 commits into
prompt-toolkit:mainfrom
fanaruto:codex/preserve-async-prompt-frame

Conversation

@fanaruto

Copy link
Copy Markdown

PromptSession(show_frame=True) loses its frame when prompt_async() is called without a show_frame argument. Likewise, enabling the frame in one asynchronous prompt only lasts until the next call. A session using synchronous prompt() preserves the setting across calls.

Use None as the default for prompt_async(show_frame=...), matching prompt(), so omitting the argument preserves the session's boolean or filter. Explicit True and False still update the session for subsequent prompts.

The regression tests run actual asynchronous prompts with pipe input and inspect the rendered frame corner. All three cases fail before the change and pass after it; they cover constructor settings, a Condition, persistent overrides, and explicitly disabling the frame. The full test suite passes: uv run pytest tests/ -q (159 passed on Python 3.14.3).

Related to #2011.

AI assistance: this change and its tests were developed with OpenAI Codex.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant