Skip to content

Improve Ghostel terminal integration#353

Merged
tninja merged 5 commits into
mainfrom
kang_feat
May 16, 2026
Merged

Improve Ghostel terminal integration#353
tninja merged 5 commits into
mainfrom
kang_feat

Conversation

@tninja
Copy link
Copy Markdown
Owner

@tninja tninja commented May 15, 2026

This improves the Ghostel terminal backend integration so ai-code preserves Ghostel's own process behavior while still applying ai-code session lifecycle handling.

The change keeps Ghostel title tracking and buffer-on-exit behavior disabled after ghostel-exec, preserves and chains Ghostel's native process sentinel before ai-code cleanup, and routes Ghostel resize handling through Ghostel's own window-size adjustment path. It also treats newer Ghostel ghostel--input-mode copy state as terminal navigation mode while keeping the older ghostel--copy-mode-active path compatible.

The vterm and eat backends are not changed. I verified the backend dispatch paths with targeted vterm/eat tests and runtime probes, and added Ghostel regression coverage for resize handling, sentinel chaining, title tracking, and copy-mode detection.

Verification:

  • emacs -Q -batch -L . --eval "(setq load-prefer-newer t)" -l ert -l test/test_ai-code-backends-infra.el -f ert-run-tests-batch-and-exit
  • emacs -Q -batch -L . -l ert --eval "(mapc #'load-file (file-expand-wildcards \"test/test_*.el\"))" -f ert-run-tests-batch-and-exit
  • emacs -Q -batch -L . --eval "(setq load-prefer-newer t)" -f batch-byte-compile ai-code-backends-infra.el ai-code-backends-infra-vterm.el ai-code-backends-infra-eat.el ai-code-backends-infra-ghostel.el
  • git diff --check

@tninja
Copy link
Copy Markdown
Owner Author

tninja commented May 15, 2026

@copilot resolve the merge conflicts in this pull request

Copy link
Copy Markdown
Contributor

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 refines the Ghostel terminal backend integration so ai-code preserves Ghostel's native lifecycle (title tracking, kill-on-exit, sentinel) while still applying ai-code's session cleanup. It also routes resize handling through Ghostel's window-size adjuster and recognizes the newer ghostel--input-mode copy state.

Changes:

  • Reapply --configure-ghostel-buffer after ghostel-exec so title tracking and kill-on-exit stay disabled, and capture Ghostel's native sentinel in a process property.
  • In --finalize-started-session, chain any captured Ghostel sentinel before invoking ai-code cleanup.
  • Use Ghostel's --window-adjust-process-window-size for sync, and treat ghostel--input-mode = 'copy as navigation mode.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
ai-code-backends-infra.el Routes Ghostel resize through its native handler, chains a saved Ghostel sentinel before cleanup, plus docstring tweaks.
ai-code-backends-infra-ghostel.el Reconfigures Ghostel buffer post-ghostel-exec, stashes native sentinel, adds ghostel--input-mode copy detection, disables ghostel-kill-buffer-on-exit.
test/test_ai-code-backends-infra.el Adds regression coverage for resize routing, sentinel chaining/preservation, title tracking, and new copy-mode detection.

Co-authored-by: tninja <714625+tninja@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 15, 2026

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflicts by merging origin/main into this branch and reconciling ai-code-backends-infra.el so both the latest vterm resize/flush behavior and Ghostel-specific handling are preserved. Addressed in commit 84cff89.

Copilot finished work on behalf of tninja May 15, 2026 21:44
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0eb12d4bf8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread ai-code-backends-infra-ghostel.el Outdated
Comment thread ai-code-backends-infra.el Outdated
Co-authored-by: tninja <714625+tninja@users.noreply.github.com>
Copilot finished work on behalf of tninja May 15, 2026 21:57
@tninja tninja merged commit 3352cdc into main May 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants