Skip to content

Transcript output is clipped when submitted prompt wraps differently in display area than in editor area #3482

@sammallon

Description

@sammallon

Filed by Sam Mallon (GitHub: @sammallon, work alias: samallon) - feel free to reach out to either address for more information. (Drafted and submitted by Sam's Copilot CLI agent on his behalf.)

Describe the bug

When a submitted prompt wraps in the display area differently than it did in the editor area while being typed, lines at the bottom of the rendered conversation are clipped below the visible viewport. The clipping is not recovered until a subsequent turn re-renders the screen, at which point the previously-hidden lines become reachable by scrolling up.

Observed behavior:

  • The displayed wrapping of the submitted prompt does not match the wrapping that was visible in the editor area at the time of submission (the displayed lines wrap at a narrower width).
  • After submission, a number of lines at the bottom of the assistant's response (and sometimes the user's own next-input prompt) are not visible on screen.
  • Scrolling the terminal does not reveal the hidden content while the response is rendering.
  • After the next user message is sent and the assistant responds, scrolling up reveals the previously-clipped lines in their correct position.
  • The effect appears to accumulate across turns: a session that has experienced one wrap mismatch can have additional clipping on subsequent turns, eventually clipping enough lines that the user can no longer see their own input prompt until the next response is rendered.
  • The effect does not occur (or is not noticeable) when the submitted prompt's display wrapping matches its editor wrapping.

Affected version

GitHub Copilot CLI 1.0.52-4.

Steps to reproduce the behavior

  1. Launch copilot in a terminal sized such that the editor input area is wider than the display/transcript area (this appears to happen by default in some configurations; see screenshots).
  2. Type a long single-line prompt long enough that the displayed transcript will wrap it onto more lines than the editor wrapped it onto. (The prompt used for reproduction was a single paragraph of roughly 80 words, included verbatim in the screenshots.)
  3. Submit the prompt.
  4. Ask the assistant to output a known, numbered sequence of lines (e.g., 1 through 20 followed by END-1 through END-10, one per line).
  5. Observe that the response is clipped at the bottom of the viewport. In our reproduction, the last visible line was END-6, with END-7 through END-10 not visible. The user's input prompt area at the bottom may also not be visible.
  6. Send a short follow-up message (e.g., ok). After the next response renders, scroll up: the previously-hidden lines (END-7 through END-10) are now present in the scrollback.

Expected behavior

The full assistant response should be visible (or reachable by scrolling) immediately after it renders. The displayed wrapping of submitted prompts should match the wrapping shown in the editor while typing, or, if it cannot, the available transcript viewport height should be adjusted to compensate so that no content is clipped.

Additional context

  • Operating system: Windows 11
  • CPU architecture: x86_64
  • Terminal emulator: Windows Terminal
  • Shell: PowerShell
  • Reproducibility: Reproducible in the same session whenever a submitted prompt's displayed wrapping does not match its editor wrapping. Not reproducible when the wrappings match.
  • Accumulating effect: Repeating the trigger within a single session appears to increase the number of clipped lines on subsequent turns.

Screenshots (attached below):

  1. Screenshot 1 - clipped state. Shows the submitted prompt at the top with the wrap-mismatch visible (the editor's wrapped form is shown above the differently-wrapped display form), followed by the assistant's numbered output truncated at END-6. END-7 through END-10 are off-screen, and the input prompt at the bottom is not visible.
  2. Screenshot 2 - after the next turn. Scrolling back through the transcript now shows all of END-1 through END-10, and the user's ok message is visible at the bottom of the previous turn's region.
Screenshot 1 - clipped state Screenshot 2 - after the next turn

Logs were not collected at the time of reproduction. Happy to re-run with --log-level / --log-file if it would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:input-keyboardKeyboard shortcuts, keybindings, copy/paste, clipboard, mouse, and text inputarea:terminal-renderingDisplay and rendering: flickering, scrolling, line wrapping, output formatting

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions