Decide on a paste action for --upper-action #7

Open
opened 2026-09-19 16:33:42 +09:00 by natsukium · 0 comments
Owner

Summary

Add paste as an --action / --upper-action value: put the picked value into the terminal's
input rather than the clipboard.

Why

Action is Print | Copy | Open | Command. docs/research.md "Edge-case handling" records that
both wezterm and foot bind uppercase = paste — it is the standard second action, and
--upper-action was built precisely to offer a second action from one binding.

Today the closest thing is --action 'tmux send-keys {}'-style command, which only works under
one specific producer and is not injection-symmetric with the built-ins.

Open question

There is no portable way to push text into the foreground program's input from outside it. The
options:

  • OSC 52 + bracketed paste is not it — OSC 52 sets the clipboard; pasting is still a
    keystroke.
  • Writing to /dev/tty with TIOCSTI is the classic trick and is disabled on modern kernels
    (dev.tty.legacy_tiocsti), so it is not a foundation.
  • Which leaves: the producer pastes. spoor prints the value (already the default Print) and
    the key binding does the pasting — tmux send-keys, felis' own paste action, kitty remote
    control.

If that is the answer, then paste is documentation, not code: a README recipe per producer
showing the binding that pastes what spoor printed. Worth deciding explicitly and recording it
in docs/design.md "Rejected alternatives" if we decline the flag, since the competitors have the
feature and its absence will otherwise look like an oversight.

## Summary Add `paste` as an `--action` / `--upper-action` value: put the picked value into the terminal's input rather than the clipboard. ## Why `Action` is `Print | Copy | Open | Command`. `docs/research.md` "Edge-case handling" records that both wezterm and foot bind **uppercase = paste** — it is the standard second action, and `--upper-action` was built precisely to offer a second action from one binding. Today the closest thing is `--action 'tmux send-keys {}'`-style command, which only works under one specific producer and is not injection-symmetric with the built-ins. ## Open question There is no portable way to push text into the foreground program's input from outside it. The options: - **OSC 52 + bracketed paste** is not it — OSC 52 sets the clipboard; pasting is still a keystroke. - Writing to `/dev/tty` with `TIOCSTI` is the classic trick and is disabled on modern kernels (`dev.tty.legacy_tiocsti`), so it is not a foundation. - Which leaves: the producer pastes. `spoor` prints the value (already the default `Print`) and the key binding does the pasting — `tmux send-keys`, felis' own paste action, kitty remote control. If that is the answer, then `paste` is **documentation, not code**: a README recipe per producer showing the binding that pastes what `spoor` printed. Worth deciding explicitly and recording it in `docs/design.md` "Rejected alternatives" if we decline the flag, since the competitors have the feature and its absence will otherwise look like an oversight.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
natsukium/spoor#7
No description provided.