Skip to content

fix: prevent terminal output overflow when opening sftp - #58

Merged
qfxiongbinbin merged 1 commit into
mainfrom
fix/terminal-buffer-overflow-on-sftp-switch
Apr 15, 2026
Merged

qfxiongbinbin merged 1 commit into
mainfrom
fix/terminal-buffer-overflow-on-sftp-switch

Conversation

@qfxiongbinbin

Copy link
Copy Markdown
Owner

Problem

When a local terminal is printing a lot of output, such as while compressing a folder, opening the SFTP tab can lead to a white screen.

Root cause

Terminal output was being appended into React state on every chunk and kept growing without a strict cap. During heavy output, switching views could make the app render too much terminal history at once and destabilize the UI.

What changed

  • Moved cached terminal output out of the React tab state into a dedicated ref map
  • Added buffer caps to keep only a bounded amount of terminal history in memory
  • Kept tab state updates focused on connection status instead of re-rendering on every output chunk
  • Cleared the cached buffer when a terminal tab closes

Expected result

  • Heavy terminal output no longer overwhelms the UI when switching to SFTP
  • Terminal tabs still restore recent output, but with bounded memory usage

@qfxiongbinbin
qfxiongbinbin merged commit dd71ed5 into main Apr 15, 2026
@qfxiongbinbin
qfxiongbinbin deleted the fix/terminal-buffer-overflow-on-sftp-switch branch April 15, 2026 10:33
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