Problem
Both backends intercept p/P (and Ctrl+V in insert mode) to load the system clipboard into engine registers before dispatch:
- TUI:
intercept_paste_key (~37 lines) + insert-mode clipboard (~38 lines)
- GTK: clipboard read before paste (~20 lines)
Engine::load_clipboard_for_paste(text) already exists but the wiring around it (detecting the paste key, reading the system clipboard, calling the method) is duplicated.
Proposed fix
Consider whether the engine can own paste detection — e.g. Engine::handle_key could accept an optional clipboard provider callback, or the engine could expose needs_clipboard_for_key(key) -> bool so backends share the detection logic.
Context
Identified in Session 370 backend dedup audit.
Problem
Both backends intercept p/P (and Ctrl+V in insert mode) to load the system clipboard into engine registers before dispatch:
intercept_paste_key(~37 lines) + insert-mode clipboard (~38 lines)Engine::load_clipboard_for_paste(text)already exists but the wiring around it (detecting the paste key, reading the system clipboard, calling the method) is duplicated.Proposed fix
Consider whether the engine can own paste detection — e.g.
Engine::handle_keycould accept an optional clipboard provider callback, or the engine could exposeneeds_clipboard_for_key(key) -> boolso backends share the detection logic.Context
Identified in Session 370 backend dedup audit.