Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -322,10 +322,9 @@ export const Terminal = ({ tabId, workspaceId }: TerminalProps) => {
if (initialCommands || initialCwd) {
clearPaneInitialDataRef.current(paneId);
}
const hasPendingEvents = pendingEventsRef.current.length > 0;
if (result.isNew || !hasPendingEvents) {
applyInitialState(result);
}
// Always apply initial state (scrollback) first, then flush pending events
// This ensures we don't lose terminal history when reattaching
applyInitialState(result);
setSubscriptionEnabled(true);
flushPendingEvents();
},
Expand Down
Loading