feat(tui): add exact code block copying - #71849
Open
B-A-M-N wants to merge 3 commits into
Open
Conversation
teknium1
reviewed
Jul 30, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the exact-copy focus; current main still only copies whole assistant messages, so the feature is useful.
Problems
ui-tui/src/lib/copyText.ts:1importssetClipboardfrom@hermes/ink, but the package runtime build entry,ui-tui/packages/hermes-ink/src/entry-exports.ts:1-38, does not export it. The PR changesindex.d.tsonly, so the type declaration and runtime export surface diverge.ui-tui/src/components/copyblox.tsx:125callsdoCopy()forclosed: false; an in-flight/unclosed fence remains copyable, contrary to the stated exclusion.hermes_cli/cli_commands_mixin.py:2920always uses OSC 52. Current/copyathermes_cli/cli_commands_mixin.py:566-585uses native platform clipboard backends locally and reserves OSC 52 for SSH/fallback, including Windows/WSL support inhermes_cli/clipboard.py:101-129.ui-tui/src/components/markdown.tsx:829-834intentionally removes existing recursive rendering formd/markdownfences (mainlines 800-804). Clipboard extraction does not require that display regression.
Suggested changes
- Export the clipboard API from the runtime entry and add a public-import test.
- Disable copying until a fence closes, with an interaction test.
- Reuse the established CLI native/remote clipboard policy.
- Preserve nested Markdown fence rendering unless separately intended and tested.
Automated hermes-sweeper review.
B-A-M-N
force-pushed
the
copyblox
branch
2 times, most recently
from
July 30, 2026 14:59
fe119a4 to
f3be544
Compare
Author
|
Rebased onto current main and addressed all review items in f3be5448a:
Validation passed:
|
This was referenced Aug 1, 2026
Author
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.
"Addition of CopyBlocks
I got tired of manually formatting the code block commands Hermes writes. This feature preserves raw fenced content and gives exact-copy blocks in both TUI and CLI frontends.
What it does
TUI
CLI
Testing
Infrastructure acknowledgment
CopyBlox was independently designed and implemented. While completing and validating this contribution, I used model-inference access provided by [FreeInference.org](https://freeinference.org/), following my report of a caching issue affecting one of its Qwen deployments.
For clarity, FreeInference did not commission, direct, review, or pay me for this work. This is not a sponsored contribution or an endorsement by FreeInference, Nous Research, or the Hermes Agent project.
I am acknowledging FreeInference because access to capable inference infrastructure can enable meaningful open-source work by developers and researchers who do not have the hardware or budget to run these models themselves.
Organizations able to provide GPU capacity, hardware, cloud credits, research funding, or other infrastructure support should consider supporting the FreeInference project so that it can continue making these resources available for open-source development, research, and education.