feat: implement interactive_custom_command for mid-execution user prompts#22
Draft
KarolinaPomian wants to merge 1 commit intointel:mainfrom
Draft
feat: implement interactive_custom_command for mid-execution user prompts#22KarolinaPomian wants to merge 1 commit intointel:mainfrom
KarolinaPomian wants to merge 1 commit intointel:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for interactive command execution in
InteractiveSSHConnection, enabling tools like EEUpdate that pause mid-output and require user input to complete without hanging.Interactive command handling:
Added a new
interactive_custom_commandmethod toInteractiveSSHConnectionthat executes commands requiring mid-execution user prompts. Unlikeexecute_command, which only waits for the shell prompt to return, this method polls the channel in a loop and automatically responds to two interactive patterns:"Press to continue..." — sends a newline when press_enter=True, allowing paged help output (e.g. eeupdate -h) to scroll through all pages
"Continue (Y or N)?" — sends the provided confirm character (e.g. "y" or "n") when set, enabling destructive commands like -nvm_clear to proceed without hanging
The method returns a ConnectionCompletedProcess with both stdout and raw_output set to the full collected output, and return_code retrieved via the existing _get_return_code mechanism.
Base class declaration:
Added interactive_custom_command to the Connection base class in base.py as a non-abstract method raising NotImplementedError, so connection types that do not implement it (SSH, WinRM, RPyC, etc.) produce a clear, descriptive error instead of a silent AttributeError.
Documentation updates:
README.md — Added interactive_custom_command to the InteractiveSSHConnection Public APIs section, documenting the press_enter and confirm parameters and the return type
CHANGELOG.md — Added an Unreleased entry describing the new feature