Bug
Space key does not work on Android mobile virtual keyboard. All other characters work fine. Double-space (which triggers Android's auto-period feature) works, but single space is silently dropped.
Root Cause
In src/web/public/terminal-ui.js, the mobile input handler checks whether xterm.js already processed the input by inspecting the textarea value:
// Line ~174 in the mobile touch device input handler
const val = xtermTextarea.value;
if (!val || val.trim() === '') return; // BUG: skips space
When the user types a space:
- xterm's
attachCustomKeyEventHandler blocks it (keyCode === 229 → return false)
- The mobile input handler fires and checks the textarea
- The textarea contains
" " (just a space)
" ".trim() === "" → the handler thinks xterm already processed it → returns early
- Neither xterm nor the mobile handler sends the space → lost
Fix
if (!val || (val.trim() === '' && data !== ' ')) return;
This allows the space character through even when trim() produces an empty string.
Environment
- Codeman v0.6.3
- Android 14, Chrome, GBoard keyboard
- xterm.js with
attachCustomKeyEventHandler blocking keyCode === 229
Bug
Space key does not work on Android mobile virtual keyboard. All other characters work fine. Double-space (which triggers Android's auto-period feature) works, but single space is silently dropped.
Root Cause
In
src/web/public/terminal-ui.js, the mobile input handler checks whether xterm.js already processed the input by inspecting the textarea value:When the user types a space:
attachCustomKeyEventHandlerblocks it (keyCode === 229→return false)" "(just a space)" ".trim() === ""→ the handler thinks xterm already processed it → returns earlyFix
This allows the space character through even when
trim()produces an empty string.Environment
attachCustomKeyEventHandlerblockingkeyCode === 229