Skip to content

Fix CLI terminal interactions and transcript hierarchy / 修复 CLI 终端交互与消息层级#6632

Merged
SivanCola merged 3 commits into
esengine:main-v2from
SivanCola:fix/cli-tui-interactions
Jul 18, 2026
Merged

Fix CLI terminal interactions and transcript hierarchy / 修复 CLI 终端交互与消息层级#6632
SivanCola merged 3 commits into
esengine:main-v2from
SivanCola:fix/cli-tui-interactions

Conversation

@SivanCola

@SivanCola SivanCola commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • restore local-session right-click text paste while Reasonix owns the mouse, while preserving selection-copy precedence
  • copy composer drag selections through the verified clipboard path
  • remove the empty footer data band and left-align telemetry in non-Git workspaces
  • give assistant answers a clear Reasonix identity, stable indentation, replay support, and spacing from reasoning and turn receipts
  • update the English and Chinese CLI documentation and changelog

Root cause

Captured-mouse handling only implemented selection copy, composer selection release stopped at local selection state, and the footer/transcript renderers assumed fixed visual bands without accounting for non-Git or short-answer layouts.

User impact

In local sessions, CLI users can paste with right-click again when mouse capture is enabled and copy text selected inside the composer. Over SSH, Reasonix now avoids reading the remote host clipboard and points users to the terminal paste shortcut or /mouse. Non-Git workspaces receive a cleaner transcript and footer.

Compatibility

Surface Old-data behavior Conclusion
Session history Stored provider messages are unchanged; existing assistant messages receive the new presentation only when replayed Compatible
Config and state files No persisted schema or enum changed Compatible
Cross-version use The change only affects TUI event handling and rendering; no new on-disk writes are introduced Compatible

Related open PRs

Verification

  • go test ./internal/cli
  • go test ./...
  • go vet ./...
  • git diff --check

Problem:
- Captured mouse mode could copy selections but could not right-click paste clipboard text.
- Composer drag selections were visible but did not reliably reach the system clipboard.
- Non-Git workspaces reserved or misaligned an empty footer data band.
- Assistant answers lacked a distinct identity and spacing from reasoning and turn receipts.

Root cause:
- Mouse handling had no text-only clipboard read path, composer selection release stopped at local state, and footer/transcript rendering assumed fixed visual bands.

Fix:
- Route right-click clipboard text through the canonical paste event and auto-copy composer drag selections.
- Make optional footer telemetry compact and left-aligned outside Git repositories.
- Render assistant markdown with a Reasonix identity, stable indentation, replay support, and semantic spacing.
- Document the interaction changes and add focused regression coverage.

Verification:
- go test ./internal/cli
- go test ./...
- git diff --check
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development tui Terminal UI / CLI (internal/cli, internal/control) labels Jul 18, 2026
Problem: Captured right-click paste attempted to read the remote host clipboard during SSH sessions and the documentation implied it could access the user's local clipboard.

Root cause: The right-click path called the native clipboard reader without applying the remote-session boundary already used by clipboard copy.

Fix: Detect SSH sessions before reading clipboard text, preserve the composer, show a localized terminal-paste hint, and document local versus remote behavior.

Verification: go test ./internal/cli; go test ./...; go vet ./...; git diff --check.
Problem: Four local clipboard interaction tests inherited SSH environment variables and failed when the suite ran on a remote development host.

Root cause: The tests stubbed native clipboard operations without explicitly selecting a local clipboard session.

Fix: Add a shared test helper that clears all supported SSH markers and use it in each local paste and drag-copy case.

Verification: Normal and simulated-SSH go test ./internal/cli -count=1; go test ./...; go vet ./...; git diff --check.
@SivanCola
SivanCola marked this pull request as ready for review July 18, 2026 05:10
@SivanCola
SivanCola requested a review from esengine as a code owner July 18, 2026 05:10
@SivanCola
SivanCola enabled auto-merge (squash) July 18, 2026 05:11
@SivanCola
SivanCola merged commit 40ef98d into esengine:main-v2 Jul 18, 2026
17 checks passed
SivanCola added a commit that referenced this pull request Jul 19, 2026
Problem:
- The contributor behind #6560 helped identify and solve the CLI clipboard compatibility gap, but the integrated #6632 commit did not record that co-contribution.

Root cause:
- The final implementation was merged independently without a contributor trailer or a permanent acknowledgment next to the shipped fix.

Fix:
- Credit Andrei Kiparuk in the changelog and bilingual README acknowledgments.
- Add a public Co-authored-by trailer so GitHub records the contribution after merge.

Verification:
- git diff --check
- ./scripts/check-cache-impact.sh

Co-authored-by: Andrei Kiparuk <88461327+andrei-kiparuk@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant