发布

  • fix: artifacts from previous frames were bleeding through in TUI (#989)

    frostbyte_neo 发布于 2025-05-17 17:51:11 +00:00

    Prior to this PR, I would frequently see glyphs from previous frames
    "bleed" through like this:

    image

    I think this was due to two issues (now addressed in this PR):

    • We were not making use of ratatui::widgets::Clear to clear out the
      buffer before drawing into it.
    • To calculate the width used with wrapped_line_count_for_cell(), we
      were not accounting for the scrollbar.
    • Now we calculate effective_width using
      inner.width.saturating_sub(1) where the 1 is for the scrollbar.
    • We compute text_area using effective_with and pass the text_area
      to paragraph.render().
    • We eliminate the conditional needs_scrollbar check and always call
      render(Scrollbar)

    I suspect this bug was introduced in
    https://github.com/openai/codex/pull/937, though I did not try to
    verify: I'm just happy that it appears to be fixed!

    下载附件