Skip to content

Fix SSH bootstrap output appearing in command history - #14825

Open
fatsolko wants to merge 1 commit into
warpdotdev:masterfrom
fatsolko:fatsolko/fix-3523-bootstrap-outputs
Open

Fix SSH bootstrap output appearing in command history#14825
fatsolko wants to merge 1 commit into
warpdotdev:masterfrom
fatsolko:fatsolko/fix-3523-bootstrap-outputs

Conversation

@fatsolko

@fatsolko fatsolko commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Description

SSH/session bootstrap output can arrive while the active block is still in BeforeExecution.
During BootstrapStage::ScriptExecution, that output was routed through the command grid and could be serialized as the command for the block. If Warp was quit during the SSH session and restored later, the remote MOTD/welcome text could then appear in command history.

This changes script-execution bootstrap output to be handled as output rather than command text, while preserving hidden bootstrap block semantics: routing bytes away from the command grid does not automatically make the bootstrap block visible.

Linked Issue

  • The linked issue is labeled ready-to-spec or ready-to-implement.
  • Where appropriate, screenshots or a short video of the implementation are included below (especially for user-visible or UI changes).

Fixes #3523

Testing

  • I have manually tested my changes locally with ./script/run

Manual testing:

  • Built and launched target/debug/warp-oss on macOS.
  • Ran tsh ssh htz-p6m-salt-master-stg into a warpified SSH session.
  • Quit Warp through the Dock while the SSH session was active.
  • Relaunched target/debug/warp-oss.
  • Verified the Ubuntu MOTD/welcome output was not restored as a command history entry.

Automated testing:

  • ./script/format --check
  • cargo test -p warp terminal::model::blocks::selection::tests::test_selection_to_string_hidden_blocks -- --nocapture
  • cargo test -p warp terminal::model::block::tests::test_image_completion_before_execution_routes_to_output_grid -- --nocapture
  • cargo test -p warp terminal::model::block::tests::non_empty_pre_bootstrap_block_can_be_long_running -- --nocapture
  • cargo test -p warp terminal::model::blocks::tests::visible_bootstrap_block_event_fires_when_script_execution_becomes_visible -- --nocapture
  • cargo test -p warp test_queued_typeahead_shell_reported -- --nocapture

Full presubmit:

  • ./script/presubmit progressed through format, Clippy, clang-format, and wgslfmt.
  • Before the latest fixture update, full nextest ran 10,807 tests: 10,798 passed, 1 leaky, 9 failed, 87 skipped.
  • The previously failing terminal::model::blocks::selection::tests::test_selection_to_string_hidden_blocks was addressed by this PR update and passes locally.
  • The warp_tui terminal_session_view::tests::zero_state_renders_with_only_zero_height_bootstrap_blocks fixture was updated for the new script-execution output routing; it should be covered by the next full rerun.
  • The remaining failures from that run are integration/UI failures that should be rerun or triaged in the local environment:
    • integration::integration shell_integration_tests::test_ctrl_d_handled_by_read_during_bootstrapping
    • integration::integration shell_integration_tests::test_ssh_into_ash
    • integration::integration shell_integration_tests::test_ssh_into_sh
    • integration::integration shell_integration_tests::test_ssh_wrapper_into_bash
    • integration::integration shell_integration_tests::test_ssh_wrapper_into_zsh
    • integration::integration ui_tests::test_paste_and_type_characters_before_bootstrap
    • integration::integration ui_tests::test_ssh_with_shell_override
  • warp terminal::view::tests::drag_drop_image_in_cli_agent_long_running_command_pastes_via_clipboard -- --nocapture passes when rerun locally.

Screenshots / Videos

Manual verification was performed with a real macOS build and warpified SSH session. No UI layout change is included.

Agent Mode

  • Warp Agent Mode - This PR was created via Warp's AI Agent Mode

CHANGELOG-BUG-FIX: Prevent SSH server welcome messages from appearing in command history.

@cla-bot cla-bot Bot added the cla-signed label Aug 7, 2026
@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label Aug 7, 2026
@oz-for-oss

oz-for-oss Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

@fatsolko

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

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.

Overview

This PR changes bootstrap-time ANSI output routing so bytes received during BootstrapStage::ScriptExecution go to the output grid instead of the command grid, addressing SSH MOTD text being persisted as command history.

Concerns

  • Moving bootstrap output into stylized_output without changing restore semantics can drop that output after restart because restored non-executed blocks do not replay stylized_output.
  • This is a user-facing terminal behavior change, but the PR does not include screenshots or a screen recording demonstrating the fixed restart flow end to end. For this user-facing change, please include screenshots or a screen recording demonstrating it working end to end.

Verdict

Found: 0 critical, 2 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/terminal/model/block.rs Outdated
},
_ if $self.bootstrap_stage == BootstrapStage::ScriptExecution => {
let had_visible_content = $self.output_grid.has_visible_content();
let retval = $self.output_grid.$method($( $arg ),*);

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] Routing script-execution bytes into stylized_output means the completed bootstrap block still serializes with did_execute == false; restore_block only replays stylized_output for did_execute || is_background, so this output is dropped after restart instead of being restored.

@fatsolko
fatsolko force-pushed the fatsolko/fix-3523-bootstrap-outputs branch from a3010c9 to b032a06 Compare August 7, 2026 15:38
@fatsolko
fatsolko force-pushed the fatsolko/fix-3523-bootstrap-outputs branch from b032a06 to eb13948 Compare August 7, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed external-contributor Indicates that a PR has been opened by someone outside the Warp team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Server's welcome message appears in command history following an SSH connect

1 participant