New issue
Advanced search Search tips

Issue 787170 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

hterm: Can't send Ctrl + [ when '[' key needs AltGr.

Reported by e.suarez...@gmail.com, Nov 21 2017

Issue description

UserAgent: Mozilla/5.0 (X11; CrOS x86_64 9901.66.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.82 Safari/537.36
Platform: 9901.66.0 (Official Build) stable-channel peppy

Steps to reproduce the problem:
1. Open crosh
2. Try to type Ctrl + [
3. 

What is the expected behavior?
Ctrl+[

What went wrong?
It just appears [.

WebStore page: https://chrome.google.com/webstore/detail/crosh-window/nhbmpbdladcchdhkemlojfjdknjadhmh/reviews

Did this work before? No 

Chrome version: 62.0.3202.82  Channel: stable
OS Version: 9901.66.0
Flash Version: 

Spanish keyboard layout.
 

Comment 1 by vapier@chromium.org, Dec 12 2017

Components: -Platform>Extensions Platform>Apps>Default>Hterm
Labels: -Pri-2 Pri-3
Summary: hterm: Can't send Ctrl + [ when '[' key needs AltGr. (was: Can't send Ctrl + [ when '[' key needs AltGr.)
what do you mean by "needs AltGr" ?  what keyboard input method are you using ?
The spanish keyboard layout requires "AltGr" (iso level3 modifier) to print '['.

Comment 3 by vapier@chromium.org, Dec 19 2017

this works fine for me.  i'll explain my process here (which i'm sure much of which you already know).

i'm looking at the Spanish QWERTY keyboard layout that's in wikipedia for reference (which seems to line up with the "Spanish keyboard" option in Chrome OS):
  https://en.wikipedia.org/wiki/QWERTY#Spanish
if you're using a different layout, please link to exactly what you're using (since "spanish keyboard" is vague).

in this layout, there is no [ key, there is only a ^`[ key.  i'll abbreviate as "CBLB" here to avoid confusion (short for Circumflex Backtick Left Bracket) as i don't think there's any other disambiguating name.  CrOS treats it as a dead key, but that doesn't seem super relevant here.

that means in order to type a literal [, you need to hold AltGr first (i.e the right Alt key) and then press CBLB.  this works for me in hterm.

further, if you want to type ^[ (or Ctrl+[), you need to hold AltGr and Ctrl simultaneously before pressing CBLB.  this works for me with either left or right Ctrl keys.

if you want to type Alt+[, you need to hold AltGr and left Alt (i.e. both alt keys) before pressing CBLB.  this works for me too.

so what exactly are you pressing that isn't working ?  if you mean you want to hold Ctrl and press CBLB directly to get a ^[ sequence, well i'm afraid that won't work and isn't supported, and doesn't work in any other system that i can see.

if you're comparing against macOS, in general their IMEs don't behave the same as Linux/CrOS, so i don't think trying to mimic macOS-specific behavior specifically in hterm makes sense.  IMEs & hterm should be coherent with the active OS.
> In order to type a literal [, you need to hold AltGr first (i.e the right Alt key) and then press CBLB.  this works for me in hterm.

So for me.

> if you want to type Alt+[, you need to hold AltGr and left Alt (i.e. both alt keys) before pressing CBLB.  this works for me too.

So for me too.

> further, if you want to type ^[ (or Ctrl+[), you need to hold AltGr and Ctrl simultaneously before pressing CBLB.  this works for me with either left or right Ctrl keys.

It does not work for me. I just get a '[' alone.

Comment 5 by vapier@chromium.org, Dec 19 2017

what version of CrOS & Secure Shell are you testing with ?  i'm using CrOS R64 and Secure Shell 0.8.41.

you can try this page:
  http://unixpapa.com/js/testkey.html
check the "modifiers" box first.

if i press AltGr+Ctrl+[, i get the stream:
keydown  keyCode=18        which=18        charCode=0        
         shiftKey=false ctrlKey=false altKey=true  metaKey=false
keydown  keyCode=17        which=17        charCode=0        
         shiftKey=false ctrlKey=true  altKey=false metaKey=false
keydown  keyCode=219       which=219       charCode=0        
         shiftKey=false ctrlKey=true  altKey=false metaKey=false
keypress keyCode=91  ([)   which=91  ([)   charCode=91  ([)  
         shiftKey=false ctrlKey=true  altKey=false metaKey=false
keyup    keyCode=219       which=219       charCode=0        
         shiftKey=false ctrlKey=true  altKey=false metaKey=false
keyup    keyCode=17        which=17        charCode=0        
         shiftKey=false ctrlKey=false altKey=false metaKey=false
keyup    keyCode=18        which=18        charCode=0        
         shiftKey=false ctrlKey=false altKey=false metaKey=false

you can see that keypress event in the middle where Ctrl+[ fires.
On 'chrome://version':

Google Chrome	62.0.3202.97 (Build oficial) (64 bits)
Revisión	0
Plataforma	9901.77.0 (Official Build) stable-channel peppy

On extensions:

Secure Shell    0.8.40.1

I wonder whether crosh and secure shell are the same thing.

If I start a Ubuntu Xenial via crouton (text mode), then I can run some commands:

$ evtest
...
Event: time 1513812133.569416, -------------- SYN_REPORT ------------
Event: time 1513812149.637629, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1513812149.637629, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1513812149.637629, -------------- SYN_REPORT ------------
Event: time 1513812149.813740, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1513812149.813740, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 1
Event: time 1513812149.813740, -------------- SYN_REPORT ------------
Event: time 1513812149.971847, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1a
Event: time 1513812149.971847, type 1 (EV_KEY), code 26 (KEY_LEFTBRACE), value 1
Event: time 1513812149.971847, -------------- SYN_REPORT ------------
[Event: time 1513812150.146293, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1a
Event: time 1513812150.146293, type 1 (EV_KEY), code 26 (KEY_LEFTBRACE), value 0
Event: time 1513812150.146293, -------------- SYN_REPORT ------------
Event: time 1513812150.342187, type 4 (EV_MSC), code 4 (MSC_SCAN), value b8
Event: time 1513812150.342187, type 1 (EV_KEY), code 100 (KEY_RIGHTALT), value 0
Event: time 1513812150.342187, -------------- SYN_REPORT ------------
Event: time 1513812150.517887, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1513812150.517887, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 0
Event: time 1513812150.517887, -------------- SYN_REPORT ------------
...

Next, I typed 'p', 'o', 'i', 'u', 'Ctrl-p', 'Ctrl-o', 'Ctrl-i' (inserted a tab), 'Ctrl-u', 'AltGr-[ (CBLB)', 'AltGr-]', 'Ctrl-AltGr-[', 'Ctrl-AltGr-]' (triggered a window action and did not reach crosh), 'Ctrl-c', 'Ctrl-d'.

$ showkey -a
LANG=C showkey -a

Press any keys - Ctrl-D will terminate this program

p       112 0160 0x70
o       111 0157 0x6f
i       105 0151 0x69
u       117 0165 0x75
^P       16 0020 0x10
^O       15 0017 0x0f
                  9 0011 0x09
^U       21 0025 0x15
[        91 0133 0x5b
]        93 0135 0x5d
[        91 0133 0x5b
^C        3 0003 0x03
^D        4 0004 0x04

Somehow it looks as if crosh is ignoring 'Ctrl' in '^['.
And I got same results you got in 'http://unixpapa.com/js/testkey.html'.

Comment 8 by vapier@chromium.org, Dec 21 2017

your OS is out of date.  peppy/stable is on 63.0.3239.116 / 10032.75.0 now.  please update your device.  we don't track bugs in older versions.

crosh & Secure Shell both use hterm.

you don't need all those layers to check behavior.  just run crosh (ctrl+alt+t), then hit Ctrl+V, then press Ctrl-AltGr-CBLB.  it should render:

crosh> ^[

that means the shell received Ctrl+[.
Today I finally got 63.0.3239.116.

I still get the same:

crosh> [

Comment 10 Deleted

Comment 11 Deleted

Sign in to add a comment