New issue
Advanced search Search tips

Issue 704468 link

Starred by 1 user

Issue metadata

Status: Verified
Closed: Apr 2017
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug

Sign in to add a comment

hterm: enable "alt-backspace-is-meta-backspace" may cause delete key broken

Reported by, Mar 23 2017

Issue description

UserAgent: Mozilla/5.0 (X11; CrOS x86_64 8872.76.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.105 Safari/537.36
Platform: 55.2.56 (Developer Build - neverware) developer-build chromeover64

Steps to reproduce the problem:
1. Enable "alt-backspace-is-meta-backspace" in the profile settings.
2. Open up a Secure Shell and connect.
3. Type something and use "delete" key to delete them, and it's working.
4. Use "alt + tab" to switch to other window, and then switch back to Secure Shell.
5. Repeat step 3 and find out "delete" key is broken.
6. Press "alt" once and repeat step 3, it's working again.

What is the expected behavior?
In step 5, "delete" key should work.

What went wrong?
In step 5, "delete" key behave just like I press "alt + backspace".

WebStore page:

Did this work before? N/A 

Chrome version: 55.0.2883.105  Channel: n/a
OS Version: 8872.76.0
Flash Version: 20170214.1.999.999

I checked the source code of libapps/hterm. The root cause of this problem is that the "blur" event was not handled properly. I guess the handler "hterm.Keyboard.prototype.onBlur_" is to handle situation like "alt + tab". However, the event never happen. Therefore, "hterm.Keyboard.KeyMap.prototype.onKeyDel_" will send '\x1b\x7f' instead of '\x1b[3~'.

If I was correct above, I would like to submit a patch to fix this problem. Thanks.

Comment 1 by, Mar 24 2017

The submitted patch is at

Comment 2 by, Mar 24 2017

Components: -Platform>Apps Platform>Apps>Default>Hterm

Comment 3 by, Apr 12 2017

Status: Started (was: Unconfirmed)
posted a diff fix at

Comment 4 by, Apr 17 2017

Status: Fixed (was: Started)
this is fixed in hterm-1.62+ and nassh-
Project Member

Comment 5 by, Apr 17 2017

The following revision refers to this bug:

commit c527161735d4970cecff1d4461dea5cec8eb27f7
Author: Mike Frysinger <>
Date: Mon Apr 17 17:14:28 2017

hterm: fix alt key tracking

We track the status of the alt key to so we can undo some keyboard
shortcuts (like "alt-backspace-is-meta-backspace" for Chrome OS).
In order to track alt+tab (which normally changes windows), we use
the blur event.  This ends up not working because:
- the blur event does not bubble
- we set the listener on the body element
- the x-screen element is the one that has focus

Thus when we switch away, the blur event fires for x-screen only
and we never see it.  This manifests as the alt key being "stuck":
- enable alt-backspace-is-meta-backspace
- type some text in a bash shell prompt
- alt+tab to a different window
- alt+tab back to Secure Shell
- try pressing the delete key and see it act as alt+backspace

Instead, let's use the focusout event to track the focus state.
This event bubbles, so the body element is properly notified.

BUG= chromium:704468 

Change-Id: I7990c6e8e7c7a70e052deaf41f72ebb05c46c692
Reviewed-by: Brandon Gilmore <>
Reviewed-by: Rob Ginda <>
Tested-by: Mike Frysinger <>


Status: Verified (was: Fixed)

Sign in to add a comment