While typing in the xterm js terminal (Android chrome) - backspace is giving previous command history

230 Views Asked by At

I am using ng-terminal in my project. I observed this unexpected behaviour when I use terminal in android chrome. When I backspace in the terminal, I erase previous command input by 1 character and keep going to previous command history.

Browser and version: Android Chrome - 109.0.5414.46 xterm.js version: 5.0.0

The key issue I think we're facing, aside from the behaviour being odd, is the backspace buffer. I suspect that the keyboard has its own buffer of text that isn't being cleared when the app decides to consume the text, and when you backspace, it moves back in to this buffer This is why each word reappears when you backspace.

2

There are 2 best solutions below

1
On

Update the terminal emulator to a newer version As newer version may include fixes or issues like this. It is possible that there may be a configuration option of setting that you can use to change the behaviour of the back space key in the terminal emulator.

0
On

I've actually encountered this bug too and its super annoying, I reported it onto cockpit since I toughed it was problem in their code, but turns out that gboard and xterm.js are kind of broke and I don't think there is a fix for this yet. Github issue on cockpit: https://github.com/cockpit-project/cockpit/issues/18138