Commit 8440cb2
committed
Using e.ctrlKey inplace of keys[17].
Problem: Terminal become unresponsive when browser short-cuts are keyed in.
Ctrl + l clears terminal and moves focus to location bar in browser (firefox).
After keying this short-cut terminal will not show any output even if user presses any key till he/she press Ctrl key alone.
Similar behavior is observed with Ctrl + [b, B, o, j, A, s, S, f, k, K, d, D, b, I, e, E , f4, n, P, tab, T, N, sht + del] etc.
Problem Analysis: When Ctrl is pressed in combination with other key(s) then key up event is fired for the key which is released first. For example if Ctrl + l is pressed and l is released first then key-up event will be fired for l key not for Ctrl key. So keys[17] will not be deleted and the next key-press is treated as pressed with Ctrl key(sends as "keyCode" not as "command). But when Ctrl is pressed alone and released, it deletes keys[17] and hence terminal works again.
Fix: Instead of relying on keys[17] for checking combination with Ctrl key we should use e.ctrlKey. Same can be done for alt key, keys[18] should be replaced with e.altKey where e is the event.1 parent 554c547 commit 8440cb2
1 file changed
Lines changed: 11 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
153 | | - | |
154 | | - | |
| 153 | + | |
| 154 | + | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| |||
164 | 164 | | |
165 | 165 | | |
166 | 166 | | |
167 | | - | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
| 167 | + | |
173 | 168 | | |
174 | 169 | | |
175 | 170 | | |
| |||
185 | 180 | | |
186 | 181 | | |
187 | 182 | | |
188 | | - | |
| 183 | + | |
189 | 184 | | |
190 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
191 | 193 | | |
192 | 194 | | |
193 | 195 | | |
| |||
0 commit comments