xterm.js icon indicating copy to clipboard operation
xterm.js copied to clipboard

Erratic text output from typing into xterm console on Chrome on Android devices

Open Bardia95 opened this issue 4 years ago • 6 comments

We are using xterm at replit to provide users with a console, and our app runs on mobile as well. A significant number of our Android users are reporting that they are having issues with typing into their console, specifically, they are seeing their characters get jumbled up, duplicate characters, and weird text.

I found this from CodeMirror which would explain it:

Chrome Android, especially in combination with GBoard, not only doesn't reliably fire regular key events, but also often surrounds the effect of enter or backspace with a bunch of composition events that, when interrupted, cause text duplication or other kinds of corruption.

They've documented the workaround they use for their code editor here, which you can use as reference for fixing this bug around the Android Chrome limitation.

We would be very appreciative if you could prioritize this fix given the significant number of people affected by it.

Details

  • Browser and browser version: Chrome (latest)
  • OS version: Android (Galaxy S9)
  • xterm.js version: 4.14.1

Steps to reproduce

  1. Type a number into the console.
  2. See duplicated text output of the number.

Bardia95 avatar Jan 08 '22 23:01 Bardia95

We would be very appreciative if you could prioritize this fix given the significant number of people affected by it.

You're welcome to contribute improvements as this is very low on my priority list.

Tyriar avatar Jan 10 '22 15:01 Tyriar

+1 This problem also bothered me and other people using android devices

luxi78 avatar Jan 17 '22 17:01 luxi78

Same here, even with Firefox on Android. Coming from MeshCentral.

mwllgr avatar Mar 09 '22 18:03 mwllgr

Same here, the default keyboard on Android is not usable so I am trying to combining customized virtual keyboard with this. However, virtual keyboard (such as KioskBoard) expose event handlers in JavaScript and there need to be a way to inject those key events to xterm.js.

I think if there is an API like the SendKey mentioned here, a lot of problems can be solved externally. #3578

HALOCORE avatar May 01 '22 11:05 HALOCORE

Actually by adding JavaScript code that creates virtual keyboard to the webpage or put the original webpage containing xterm.js in an iframe, it is working on android chrome. No need to focus the element when typing on the virtual keyboard and the android keyboard will not pop up. Events created by the virtual keyboard are sent to document.getElementById("terminal").querySelector(".xterm-screen").querySelector(".xterm-helpers").querySelector(".xterm-helper-textarea"). Anyway, it would be more convenient if xterm.js has such keyboard builtin. demopic

HALOCORE avatar May 04 '22 04:05 HALOCORE

related PR: https://github.com/xtermjs/xterm.js/pull/4007

ink404 avatar Aug 11 '22 16:08 ink404

DId you get any solution to it.

sravyak avatar Jan 05 '23 14:01 sravyak

still a problem and its present at cockpit project as well and it is super annoying

EPXOL avatar Mar 17 '23 18:03 EPXOL