refactor: migrate shell to persistent PTY architecture#85
Merged
F16shen merged 21 commits intoAI-Shell-Team:mainfrom Apr 2, 2026
Merged
refactor: migrate shell to persistent PTY architecture#85F16shen merged 21 commits intoAI-Shell-Team:mainfrom
F16shen merged 21 commits intoAI-Shell-Team:mainfrom
Conversation
Contributor
|
Thanks for the pull request. A maintainer will review it when available. Please keep the PR focused, explain the why in the description, and make sure local checks pass before requesting review. Contribution guide: https://github.com/AI-Shell-Team/aish/blob/main/CONTRIBUTING.md |
Contributor
|
This pull request description looks incomplete. Please update the missing sections below before review. Missing items:
|
- Fix prompt ANSI escape sequences with \[...\] for correct readline width - Add last command to AISH_EXIT marker for better exit tracking - Improve PTY manager with enhanced process control - Refine error correction flow in AI handler and shell app - Update code execution tool with improved output handling - Fix mypy errors in _add_entry_sync calls
- Extract _execute_ai_operation() to deduplicate AI state management, history recording, and async execution with cancellation across handle_error_correction and handle_question - Add _trigger_prompt_and_wait() to consolidate prompt redraw logic - Add atomic interrupt dedup (try_acquire_interrupt) to prevent signal handler and input router from both processing the same Ctrl+C - Support Ctrl+C interruption during AI operations with polling-based cancellation in _run_async_in_thread - Add Esc key handling for clearing input mid-line - Fix _set_raw_mode always called via finally blocks for reliable terminal state restoration
- Move request_choice from PTYUserInteraction to prompt_io module - Add error hint suppression for clean Ctrl+C exit (no stray hints) - Add terminal size and UI calculation helpers for modal display - Fix history command format to remove internal sequence prefix
…mprovements - Resolve merge conflicts in pty/manager.py (keep command_seq support) - Resolve merge conflicts in test_shell_pty_core.py (keep extended tests) - Retain ask_user modal UI wiring (INTERACTION_REQUIRED -> prompt_toolkit) - Retain backend error suppression for programmatic commands
- Pass shared Console from PTYAIShell to AIHandler for consistent styling - Replace raw ANSI escape codes with rich markup in error correction display - Rename loop variable to fix mypy "Assignment outside except block" error
When the user presses 'q' to exit a pager like less/git-diff, the shell receives exit code 141 (128+SIGPIPE). This is normal, not an error, so don't show the error hint.
Move prompt rendering from bash RC to Python frontend. Theme scripts receive git status and exit code via env vars. Includes caching to avoid repeated git subprocess calls.
04ab062 to
18533dd
Compare
jexShain
approved these changes
Apr 2, 2026
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.
Summary
Testing