Skip to content

[fix] #3105: Input stops working after clicking 'Warpify subshell' in poetry/pipenv#9873

Open
mitre88 wants to merge 1 commit intowarpdotdev:masterfrom
mitre88:fix/3105-pexpect-subshell-input-blocking
Open

[fix] #3105: Input stops working after clicking 'Warpify subshell' in poetry/pipenv#9873
mitre88 wants to merge 1 commit intowarpdotdev:masterfrom
mitre88:fix/3105-pexpect-subshell-input-blocking

Conversation

@mitre88
Copy link
Copy Markdown

@mitre88 mitre88 commented May 2, 2026

Problem

When users launch a subshell using poetry shell or pipenv shell and click "Warpify subshell", all keyboard input stops working. Users cannot type commands, use Ctrl+C, or Ctrl+D to exit.

Root Cause

pexpect (used by poetry and pipenv to spawn subshells) manages its own PTY state. When Warp sends Ctrl-U and Ctrl-K control characters to clear the line before sending the InitShell DCS hook, these characters interfere with pexpect's PTY management, causing input to be blocked.

Solution

  1. Added is_pexpect_subshell() helper method that detects if the current subshell is poetry or pipenv by checking the spawning_command against the existing POETRY_SUBSHELL_COMMAND_REGEX and PIPENV_SUBSHELL_COMMAND_REGEX.

  2. Added write_init_subshell_bytes_to_pty_without_clearing() method that writes the InitShell DCS hook directly without sending Ctrl-U/Ctrl-K first.

  3. Modified trigger_subshell_bootstrap() to check if the subshell is pexpect-based and use the non-clearing variant in that case.

This approach is consistent with the existing code which already uses RC-file based bootstrap for poetry/pipenv subshells during initial session bootstrapping (see should_use_rc_file_bootstrap_method in bootstrap.rs).

Testing

  • Code compiles and passes clippy
  • Follows existing code patterns
  • Specific error handling (no bare except clauses)

Fixes #3105

…/pipenv)

When clicking 'Warpify subshell' in a poetry or pipenv subshell, the
terminal input would stop working. This was caused by Warp sending
Ctrl-U and Ctrl-K control characters to clear the line before sending
the InitShell DCS hook, which interfered with pexpect's PTY management.

pexpect (used by poetry and pipenv to spawn subshells) expects to manage
the PTY itself and is sensitive to control characters. Sending
Ctrl-U/Ctrl-K caused pexpect to enter a state where user input was
blocked.

This fix:
- Adds is_pexpect_subshell() helper to detect poetry/pipenv subshells
- Adds write_init_subshell_bytes_to_pty_without_clearing() for pexpect
- Modifies trigger_subshell_bootstrap to use the non-clearing variant
  for pexpect-based subshells

Fixes warpdotdev#3105
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented May 2, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Dr. Alex Mitre.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@github-actions github-actions Bot added the external-contributor Indicates that a PR has been opened by someone outside the Warp team. label May 2, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 2, 2026

@mitre88

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
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 attempts to fix Poetry/Pipenv subshell warpification by skipping the Ctrl-U/Ctrl-K line-clearing bytes before sending the InitShell DCS hook for pexpect-backed subshells.

Concerns

  • The new pexpect detection reads session.subshell_info() from the currently bootstrapped session, not from the command currently being warpified. For the reported flow, the active session is still the parent session before the Poetry/Pipenv subshell bootstraps, so this usually returns None and the code still sends Ctrl-U/Ctrl-K.

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

Comment thread app/src/terminal/view.rs
}

self.write_init_subshell_bytes_to_pty(shell_type, ctx);
let is_pexpect_subshell = self.is_pexpect_subshell(ctx);
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 checks the already bootstrapped parent session, so subshell_info() is usually None before the poetry shell/pipenv shell subshell is initialized; the reported flow still falls back to sending Ctrl-U/Ctrl-K. Base this on the active block/banner command being warpified instead.

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.

Input stops working after clicking "Warpify" subshell

1 participant