Problem
On Termux (Android terminal), the long-press context menu paste injects characters one at a time, including newlines as raw KeyEnter events. This means pasting any multiline text submits on the first \n before the user can review or edit it.
The existing tea.PasteMsg (bracketed paste / Ctrl+Shift+V) works fine, but Termux context menu paste bypasses bracketed mode entirely.
Proposed fix
A timing-based paste detector that tracks consecutive keypresses within a 100ms window. When Enter arrives inside such a burst, it inserts a newline instead of submitting. The burst counter is reset at every intentional action boundary (submit, modal enter/exit, etc.) so normal typing is unaffected.
See PR #573 for the implementation.
Environment
- Termux on Android ARM64
- Any terminal app using long-press context menu paste
Problem
On Termux (Android terminal), the long-press context menu paste injects characters one at a time, including newlines as raw
KeyEnterevents. This means pasting any multiline text submits on the first\nbefore the user can review or edit it.The existing
tea.PasteMsg(bracketed paste / Ctrl+Shift+V) works fine, but Termux context menu paste bypasses bracketed mode entirely.Proposed fix
A timing-based paste detector that tracks consecutive keypresses within a 100ms window. When Enter arrives inside such a burst, it inserts a newline instead of submitting. The burst counter is reset at every intentional action boundary (submit, modal enter/exit, etc.) so normal typing is unaffected.
See PR #573 for the implementation.
Environment