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

Backspace key doesn't work on AOSP-based keyboards

Open 0xC0ffee1 opened this issue 1 year ago • 4 comments

When using a custom keyboard (AOSP based) on an Android device (tested on Android 14), the backspace key does not function as expected. This issue does not occur when using Gboard.

Steps to reproduce:

  1. Run the mock.dart example on any android device (Tested on Android 14, both physical and emulated).
  2. Switch to an AOSP-based keyboard (tested on OpenBoard, HeliBoard, and GrapheneOS stock keyboard).
  3. Attempt to use the backspace key.

Expected Result: The backspace key should function correctly, deleting characters as expected.

Actual Result: The backspace key does not work when using custom keyboards.

Flutter: Channel stable, 3.22.3

Demo: demo.webm

0xC0ffee1 avatar Aug 04 '24 16:08 0xC0ffee1

terminal.onOutput = (data) async{
   if(data.contains(utf8.decode([127]))){
      terminal.buffer.backspace();
      terminal.write("\x1B[1P");
      data = data.replaceAll(utf8.decode([127]), "");
     }
 }

The terminal.buffer.backspace() moves the cursor backwards and terminal.write("\x1B[1P"); delete the character at current cursor position.

heckmon avatar Jan 19 '25 12:01 heckmon

In my case backspace does not work on iOS too. The "terminal.onOutput" does not trigger a keypress at all.

I'm using Flutter 3.27.2 with xterm 4.0.0

LRSHRS avatar Feb 12 '25 08:02 LRSHRS

same problem for me, on iOS the backspace key isnt triggering. also is there a way to change the keyboard thats shown on iOS by xterm? the current one doesnt even have parenthesis

Image

oxelf avatar May 20 '25 17:05 oxelf

I have a pretty interesting use case for xterm on iOS with a local running terminal with lua, ssh, clang, wasi sdk etc so having backspace is necessary, if maybe someone from the xterm team could look at this issue with backspace on iOS? maybe @devmil?

oxelf avatar May 20 '25 17:05 oxelf