Skip to content

chore: Fix quit exit alias and compact prompt spacing#104

Merged
F16shen merged 1 commit intoAI-Shell-Team:mainfrom
F16shen:fix/quit-exit-alias-and-compact-prompt
Apr 14, 2026
Merged

chore: Fix quit exit alias and compact prompt spacing#104
F16shen merged 1 commit intoAI-Shell-Team:mainfrom
F16shen:fix/quit-exit-alias-and-compact-prompt

Conversation

@F16shen
Copy link
Copy Markdown
Collaborator

@F16shen F16shen commented Apr 14, 2026

Summary

1.新增quit命令退出
2.修改自定义脚本模式字符串前有冗余空格的问题

Add a dedicated shell-exit alias set so runtime exit detection and tool-context rejection stay aligned around exit and quit, while explicitly dropping logout from the interactive shell exit path.

Normalize user-entered quit commands to the backend exit builtin before they are sent through the PTY layer. This preserves existing bash exit behavior, keeps quit 7 semantics intact, and avoids treating quit as an external command.

Update prompt echo filtering to use the command actually sent to the backend so the __AISH_ACTIVE_COMMAND_SEQ/__AISH_ACTIVE_COMMAND_TEXT prefix is fully suppressed when quit is translated to exit.

Remove the unintended leading space from the compact script prompt mode label so scripted prompt rendering no longer shows a blank before the mode badge when scripts are enabled.

Tests added and updated:

- cover quit echo filtering and explicit quit PTY shutdown behavior

- verify quit is normalized to exit for backend submission, including exit-code arguments

- verify tool-context rejection messaging for quit and confirm logout is no longer treated as a shell-exit alias

- verify the compact theme no longer renders a leading space

Validation: /home/lixin/workspace/aishell/aish/.venv/bin/python -m pytest tests/shell/runtime/test_shell_pty_core.py tests/shell/commands/test_builtin_registry.py tests/shell/ui/test_shell_editor.py
@github-actions
Copy link
Copy Markdown
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

@github-actions
Copy link
Copy Markdown
Contributor

This pull request description looks incomplete. Please update the missing sections below before review.

Missing items:

  • User-visible Changes
  • Compatibility
  • Testing
  • Change Type
  • Scope

@F16shen F16shen changed the title Fix quit exit alias and compact prompt spacing chore: Fix quit exit alias and compact prompt spacing Apr 14, 2026
@F16shen F16shen merged commit 258c951 into AI-Shell-Team:main Apr 14, 2026
12 checks passed
@F16shen F16shen deleted the fix/quit-exit-alias-and-compact-prompt branch April 16, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant