Skip to content

feat(app): send Enter after send-selection paste#10

Merged
simota merged 2 commits into
mainfrom
feat/send-selection-send-enter
Jul 13, 2026
Merged

feat(app): send Enter after send-selection paste#10
simota merged 2 commits into
mainfrom
feat/send-selection-send-enter

Conversation

@simota

@simota simota commented Jul 13, 2026

Copy link
Copy Markdown
Owner

Summary

Adds the noa-specific config key send-selection-send-enter (default false). When enabled, the Send Selection to Pane picker follows the paste into the target pane with an Enter, so the sent selection is submitted immediately.

  • Atomic delivery: the Enter is appended to the encoded paste outside the bracketed-paste wrapper and written as one pty queue element, so a backpressured queue admits or drops the pair atomically — a lone Enter after a dropped paste would execute the stale prompt line. Skipped when nothing was pasted, for the same reason.
  • Protocol-faithful encoding: the trailing Enter goes through the real key encoder under the target pane's Kitty keyboard flags (CSI 13 u under report-all-keys, legacy CR otherwise), so Kitty-protocol TUIs recognize it.
  • Paste protection: when clipboard-paste-protection raises the confirm dialog, the Enter is deferred with the paste and sent only on confirm.
  • Settings UI: also editable from the Settings overlay as a new "Send Selection Enter" row (bool toggle, on-save, mirrored into the running config on commit and undo — same shape as Confirm Quit). Normal cmd+v paste behavior is unchanged.

Test plan

  • cargo test -p noa-app (811) / cargo test -p noa-config (167) all green; cargo clippy --workspace clean (full-workspace ipc/pty suites verified unsandboxed)
  • New tests: config default/precedence/parse, encode_enter_key vs Kitty flags, settings-row toggle→commit key/value proof, revert/undo config mirroring

simota added 2 commits July 13, 2026 21:44
Add the noa-specific boolean key send-selection-send-enter (default
off). When enabled, the send-selection picker follows the paste into
the target pane with an Enter so the pasted text is submitted
immediately.

The Enter is appended to the encoded paste outside the bracketed-paste
wrapper and written as one queue element, so a backpressured input
queue admits or drops the pair atomically (a lone Enter after a
dropped paste would execute the stale prompt line). It is encoded via
the real key encoder under the target pane's Kitty keyboard flags
(CSI 13 u under report-all-keys, legacy CR otherwise), deferred behind
the clipboard-paste-protection confirm dialog together with the paste,
and skipped when nothing was pasted. Normal cmd+v paste behavior is
unchanged.

The key is also editable from the Settings overlay as a new
"Send Selection Enter" row (bool toggle, on-save, mirrored into the
running config on commit and on undo, same shape as Confirm Quit).
@simota simota merged commit 63b88d9 into main Jul 13, 2026
1 check passed
@simota simota deleted the feat/send-selection-send-enter branch July 14, 2026 16:48
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.

1 participant