Skip to content

Handle interactive ssh -t shell overrides in warpify detection#10142

Open
cesaryuan wants to merge 1 commit intowarpdotdev:masterfrom
cesaryuan:cesar/fix-warpify
Open

Handle interactive ssh -t shell overrides in warpify detection#10142
cesaryuan wants to merge 1 commit intowarpdotdev:masterfrom
cesaryuan:cesar/fix-warpify

Conversation

@cesaryuan
Copy link
Copy Markdown

Description

This PR teaches Warp's SSH warpify detection to treat ssh <host> -t '<shell> [--login|-l]' as an interactive SSH session.

What:

  • Extend interactive SSH parsing to accept -t remote shell overrides such as ssh minipc -t 'fish --login'
  • Add regression coverage for the parsing logic
  • Add integration test scaffolding for the remote shell override flow

Why:

  • Warp already supports ordinary interactive SSH commands like ssh minipc, but it missed interactive sessions that explicitly override the remote shell with -t
  • That prevented Warp from detecting and offering warpification for real-world commands like ssh minipc -t 'fish --login'

How:

  • Update parse_interactive_ssh_command to keep treating non-interactive SSH invocations as unsupported, while allowing -t sessions that launch a known interactive shell
  • Cover the new behavior with parser tests and an integration test registration path

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).

No linked Linear issue for this change.

Testing

  • cargo clippy -p warp --lib --tests -- -D warnings
  • cargo test -p warp ssh_interactive_shell_parsing -- --nocapture
  • Added integration test coverage for the SSH remote shell override flow (test_ssh_with_remote_shell_command_override)

Agent Mode

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

Co-Authored-By: Warp agent@warp.dev

Add ssh parsing support for interactive -t remote shell overrides so Warp can detect and offer warpification for commands like ssh host -t 'fish --login'. Also add integration-test scaffolding and regression coverage for the override flow.

Co-Authored-By: Warp <agent@warp.dev>
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 5, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @cesaryuan on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 5, 2026
@cesaryuan cesaryuan marked this pull request as ready for review May 5, 2026 12:11
Copilot AI review requested due to automatic review settings May 5, 2026 12:11
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 5, 2026

@cesaryuan

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

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends Warp’s SSH interaction detection so ssh ... -t '<shell> [--login|-l]' can be recognized as an interactive session and adds test scaffolding around that flow. It fits into the SSH warpification path by broadening which SSH invocations are eligible for remote-session detection.

Changes:

  • Updated SSH command parsing to allow -t remote shell overrides for a small allowlist of shells.
  • Added parser regression tests for interactive vs non-interactive remote commands.
  • Registered a new integration test path for remote shell override warpification.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/src/terminal/ssh/util.rs Extends interactive SSH parsing for -t remote shell overrides and adds unit tests.
app/src/integration_testing/subshell/util.rs Adds helper to build SSH commands with a remote shell override.
app/src/integration_testing/subshell/step.rs Adds integration test step for entering the new SSH command shape.
crates/integration/src/test/ssh.rs Adds an integration test covering remote shell override detection and warpification flow.
crates/integration/src/bin/integration.rs Registers the new integration test in the binary runner.
crates/integration/tests/integration/shell_integration_tests.rs Includes the new test in the integration test list.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


/// Returns `true` when Warp knows how to treat the shell as an interactive remote target.
fn is_supported_remote_shell(shell: &str) -> bool {
matches!(shell, "bash" | "zsh" | "fish" | "sh" | "ash")
Comment on lines +304 to +319
new_builder()
// TODO(CORE-2333) PowerShell has no SSH wrapper.
.set_should_run_test(|| {
let (starter, _) = current_shell_starter_and_version();
starter.shell_type() != ShellType::PowerShell
})
.with_step(wait_until_bootstrapped_single_pane_for_tab(0))
.with_step(setup_gcloud_sdk())
.with_step(enter_ssh_command_with_remote_shell_override(
"bash",
"zsh --login",
))
.with_step(wait_for_password_prompt(0, "bash"))
.with_step(enter_ssh_password())
.with_step(assert_subshell_banner_is_showing())
.with_step(trigger_subshell_bootstrap())
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Overview

This PR extends SSH warpify detection for ssh ... -t '<shell --login>' and adds parser/integration coverage for the new flow.

Concerns

  • The parser can still drop dash-prefixed remote command arguments after the remote command starts, which lets non-interactive commands be classified as supported interactive shells.

Verdict

Found: 0 critical, 1 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

if host.is_none() {
host = Some(pos_arg.to_string());
} else {
remote_command_tokens.push(pos_arg.to_string());
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] Once a remote command starts, later dash-prefixed tokens are still parsed as SSH options, so ssh user@host -t zsh -c 'echo hi' is reduced to zsh and accepted as interactive. Track all tokens after the remote command begins and validate the complete remote command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants