Skip to content

feat(tui, coding-agent): add pasteToEditor to ExtensionUIContext#1351

Merged
badlogic merged 1 commit intobadlogic:mainfrom
kaofelix:feat/paste-to-editor
Feb 7, 2026
Merged

feat(tui, coding-agent): add pasteToEditor to ExtensionUIContext#1351
badlogic merged 1 commit intobadlogic:mainfrom
kaofelix:feat/paste-to-editor

Conversation

@kaofelix
Copy link
Copy Markdown
Contributor

@kaofelix kaofelix commented Feb 6, 2026

I think this looks fine and simple enough. I did have to add handleInput to the EditorComponent interface, but as far I could tell, all concrete implementations should have it anyways, e.g. the custom editor examples like modal and rainbow inherit from CustomEditor and they implement it.

Tested by making my fzf extension use it and got the bracketed paste text for larger text.

Clanker summary

Add pasteToEditor(text) method that pastes text into the editor via bracketed paste sequences, triggering paste handling (including collapse for large content). Unlike setEditorText which directly replaces content, pasteToEditor routes through handleInput on the active editor component.

  • Add pasteToEditor to ExtensionUIContext interface
  • Add handleInput to EditorComponent interface (was missing, all concrete implementations already had it)
  • Implement in interactive mode via bracketed paste sequence
  • Add fallback in RPC mode (delegates to setEditorText)
  • Document in extensions.md

Add pasteToEditor(text) method that pastes text into the editor via
bracketed paste sequences, triggering paste handling (including collapse
for large content). Unlike setEditorText which directly replaces content,
pasteToEditor routes through handleInput on the active editor component.

- Add pasteToEditor to ExtensionUIContext interface
- Add handleInput to EditorComponent interface (was missing, all
  concrete implementations already had it)
- Implement in interactive mode via bracketed paste sequence
- Add fallback in RPC mode (delegates to setEditorText)
- Document in extensions.md
@kaofelix
Copy link
Copy Markdown
Contributor Author

kaofelix commented Feb 6, 2026

Debating with the clanker here if the escaping sequence for the paste should actually be encapsulated in a method Editor.paste(text). Feels like might be cleaner, but also increases the blast radius of the change a bit...

@badlogic badlogic merged commit 6a3d6fe into badlogic:main Feb 7, 2026
2 checks passed
@badlogic
Copy link
Copy Markdown
Owner

badlogic commented Feb 7, 2026

Fine as is for now, cheers!

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.

2 participants