Skip to content
Open
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
3 changes: 1 addition & 2 deletions app/src/terminal/model/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2739,7 +2739,7 @@ impl BlockList {
pub fn insert_restored_block(&mut self, block: &SerializedBlock) {
let did_active_block_receive_precmd = self.active_block().has_received_precmd();
let mut processor = Processor::new();
self.restore_block(block, BootstrapStage::PostBootstrapPrecmd, &mut processor);
self.restore_block(block, BootstrapStage::RestoreBlocks, &mut processor);
// restore_block consumed the previous active block and made the restored
// block the new active (finished) block. Create a fresh active block so
// the terminal can continue accepting input.
Expand Down Expand Up @@ -2958,7 +2958,6 @@ impl BlockList {
self.active_block_mut().start_background(None);
} else {
self.active_block_mut().start();
self.active_block_mut().disable_reset_grid_checks();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] Removing this disables the only reset-grid bypass for restore_block callers that still pass BootstrapStage::PostBootstrapPrecmd (for example shared-session scrollback). On Windows debug builds those restored grids are created with reset checks enabled, but serialized restore bytes do not include the ConPTY reset OSC, so the first parsed input can hit the reset-grid debug assertion. Keep disabling checks for restored PostBootstrapPrecmd blocks or move those callers to a non-done bootstrap stage too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't needed. Callers that pass BootstrapStage::RestoreBlocks already get PerformResetGridChecks::No from Block::new (because RestoreBlocks.is_done() == false), so there is no Windows ConPTY reset-grid assertion risk during parse_bytes.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [IMPORTANT] This removal applies to all restore_block callers, but shared-session scrollback still passes BootstrapStage::PostBootstrapPrecmd; on Windows that keeps reset-grid checks enabled while replaying serialized command/output bytes that do not necessarily include a reset-grid OSC. Keep this disable for the PostBootstrapPrecmd restore paths, or otherwise limit the optimization to RestoreBlocks callers.

}

if let Some(serialized_ai_metadata) = block.ai_metadata.as_ref().and_then(|ai_metadata| {
Expand Down