liuzhe02 / shellinabox

Automatically exported from code.google.com/p/shellinabox
Other
0 stars 0 forks source link

-_ key does not work in firefox with 2.10 (and newer?) #202

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. use firefox to access shellinabox and try to use the -_ key (US keyboard), 
nothing happens. The - key on the keypad does work

I can also reproduce this problem on the example shell on the project home page

I did not have this problem with chrome, but with it I was getting a large 
memory leak.

Original issue reported on code.google.com by david.eu...@gmail.com on 31 Aug 2012 at 2:04

GoogleCodeExporter commented 8 years ago
This is happening to me also, on a UK keyboard.

The - (minus) and _ (underscore, shift-minus) keystrokes are not registering 
under Firefox 15 on MS Windows 7 SP1. However these keystrokes do work under 
Internet Explorer 8 on Win7SP1.

This *only* applies to the minus key on the main alpha keypad. The minus key on 
the numeric keypad seems to work okay.

A workaround is to use the minus key on the numeric keypad. However this 
workaround does not work for underscore. To enter an underscore, I have to copy 
it into the clipboard from another program (e.g. Notepad) and then paste it 
into the Shellinabox tab in Firefox.

This bug appears to be limited to Firefox. However I can input a minus and 
underscore correctly on any other web page that I load on Firefox (e.g. to 
report this bug. This bug comment was submitted using Firefox 15, and I can 
type minus or underscore to my heart's content ----____ but in the very same 
browser instance, on another tab, I cannot enter a minus or underscore into 
Shellinabox.

ShellInABox version 2.10 (revision 186)
Firefox 15

This issue is has suddenly made Shellinabox unusable for me (I write a lot of 
shell commands which require minus to pass parameters), which is very 
frustrating. I would be most grateful for the developers to investigate 
urgently.

Original comment by evilandi on 31 Aug 2012 at 1:36

GoogleCodeExporter commented 8 years ago
I strongly suspect this is due to a recent change in the Firefox/Gecko virtual 
key codes which affects Firefox 15.

Quote from https://github.com/openlayers/openlayers/issues/605
> Firefox 15 is likely to break some of the KeyboardDefaults funtionality.
> Currently in FF 15b1, the minus (-) key does not get captured by the
> KeyboardDefaults Control anymore.
> 
> Any other key seem to be fine so far, but according to the following docs,
> the plus (+) key will change as well:
> https://developer.mozilla.org/en/DOM/KeyboardEvent#Virtual_key_codes
> 
> New minus code (-): 173
> New plus code (+): 171
> (both are for the 'normal' keyboard. The keypad codes don't seem to have
> changed (yet))
> 
> None of the OpenLayers.Event.KEY_* are affected atm AFAICT.

Original comment by evilandi on 31 Aug 2012 at 1:44

GoogleCodeExporter commented 8 years ago

Reverting to Firefox 14 and preventing automatic updates (Tools - Options - 
Advanced - Update) works around this problem.

However it is not a good idea to use an outdated browser in the long term.

Firefox 14 can be downloaded from:
http://www.oldversion.com/Mozilla-Firefox.html

Original comment by evilandi on 31 Aug 2012 at 2:04

GoogleCodeExporter commented 8 years ago
Can confirm this issue on FF15 German Keyboard on WinXP SP3 and Win7 x64

Original comment by kujans...@gmail.com on 3 Sep 2012 at 7:49

GoogleCodeExporter commented 8 years ago
Forgot to mention. 

The following keys are broken too (at least on german keyboards):
1) # '
2) + * ~

Original comment by kujans...@gmail.com on 3 Sep 2012 at 7:52

GoogleCodeExporter commented 8 years ago
just found that < > | also does not work :(

Original comment by kujans...@gmail.com on 3 Sep 2012 at 9:02

GoogleCodeExporter commented 8 years ago
We had trouble with #, ~, -, and _

Here is a patch that seems to fix it:
@@ -2685,6 +2685,8 @@ VT100.prototype.handleKey = function(event) {
     }                                                                                                                                                      
     if (ch == undefined) {                                                                                                                                 
       switch (key) {                                                                                                                                       
+      case 163: /* # for FF15   */ ch = this.applyModifiers(35, event); break;
+      case 173: /* - for FF15   */ ch = this.applyModifiers(45, event); break;
       case   8: /* Backspace    */ ch = '\u007f';                       break;                                                                             
       case   9: /* Tab          */ ch = '\u0009';                       break;
       case  10: /* Return       */ ch = '\u000A';                       break;                                                                             
@@ -2859,6 +2861,8 @@ VT100.prototype.fixEvent = function(event) {
     var u                   = undefined;                                                                                                                   
     var s                   = undefined;                                                                                                                   
     switch (this.lastNormalKeyDownEvent.keyCode) {                                                                                                         
+    case  163: /* # -> ~ FF15 */ u = 96; s =  126; break;
+    case  173: /* - -> _ FF15 */ u = 45; s =  95; break;
     case  39: /* ' -> " */ u = 39; s =  34; break;                                                                                                         
     case  44: /* , -> < */ u = 44; s =  60; break;                                                                                                         
     case  45: /* - -> _ */ u = 45; s =  95; break;   

It's applied to an older version of vt100, so the line numbers may not be 
exactly right, but I checked and they're in the right ball-park. I put the 
changes at the start of the switch statements so it should be easy to find.

Original comment by glenn.k....@gmail.com on 3 Sep 2012 at 1:05

GoogleCodeExporter commented 8 years ago
Glen, that's great, thank-you. I'll have a go compiling and testing it over the 
next few days if I get time.

Do your changes enable both IE8/Chrome/FF14 *and* FF15, or do your changes make 
it such that the program only works in FF15?

Thanks again,

Original comment by evilandi on 3 Sep 2012 at 2:03

GoogleCodeExporter commented 8 years ago
They're additions, so Chrome and co. should work fine. I did some basic testing 
and everything seems to be OK in all browsers. I'd love to hear how this 
behaves on other nationality keyboards, though. I have a UK keyboard.

Original comment by glenn.k....@gmail.com on 3 Sep 2012 at 2:11

GoogleCodeExporter commented 8 years ago
how do i apply this patch to my existing shellinabox install?

Original comment by delgado....@gmail.com on 3 Sep 2012 at 3:38

GoogleCodeExporter commented 8 years ago
Thx Glenn.
My setup only had issues with "-" and "_". (Firefox 15.0, windows 7, US 
keyboard, shellinabox 2.14)
This is my patch for the 2.14 source archive in case anyone is interested.

diff --git a/original/shellinabox-2.14/shellinabox/vt100.js 
b/patched/shellinabox-2.14/shellinabox/vt100.js
--- a/original/shellinabox-2.14/shellinabox/vt100.js
+++ b/patched/shellinabox-2.14/shellinabox/vt100.js
@@ -2742,6 +2742,7 @@ VT100.prototype.handleKey = function(event) {
    case 187: /* = */ ch = this.applyModifiers(61, event); break;
    case 188: /* , */ ch = this.applyModifiers(44, event); break;
    case 189: /* - */ ch = this.applyModifiers(45, event); break;
+   case 173: /* - */ ch = this.applyModifiers(45, event); break; // FF15 Patch
    case 190: /* . */ ch = this.applyModifiers(46, event); break;
    case 191: /* / */ ch = this.applyModifiers(47, event); break;
    // Conflicts with dead key " on Swiss keyboards
@@ -2886,6 +2887,7 @@ VT100.prototype.fixEvent = function(event) {
    case 187: /* = -> + */ u = 61; s = 43; break;
    case 188: /* , -> < */ u = 44; s = 60; break;
    case 189: /* - -> _ */ u = 45; s = 95; break;
+   case 173: /* - -> _ */ u = 45; s = 95; break; // FF15 Patch
    case 190: /* . -> > */ u = 46; s = 62; break;
    case 191: /* / -> ? */ u = 47; s = 63; break;
    case 192: /* ` -> ~ */ u = 96; s = 126; break;

Original comment by Sean....@gmail.com on 6 Sep 2012 at 7:29

GoogleCodeExporter commented 8 years ago
FYI:  This patch (6 Sep 2012 from Sean) is applied in fedora 16+ (2.14-9). 

Original comment by j...@cryregarder.com on 19 Sep 2012 at 4:27

GoogleCodeExporter commented 8 years ago
Thanks a lot for writing this very useful pease of software! I'm using your 
shellinabox since some time and I'm very satisfied with it. I further analysed 
and found the following keycodes. However, I don't understand your modifier 
implementation. Now I'm running on ff14 which is really unsatisfying! I would 
really appreciate some help on this. Probably I'll find time in the next 
weeks...

German keyboard layout.

Keycode, normal, shift, alt-gr
173,-,_
60,<,>
171,+,*,~
63,ß,?,\
160,^,°
192,´,`
163,#,'

Original comment by antangu...@gmail.com on 20 Sep 2012 at 2:42

GoogleCodeExporter commented 8 years ago
Sean,

I applied your patch, but the problem persists.
Still no hyphen or underscore for me.

ShellInABox version 2.10 (revision 239)
Firefox 15.0.1
Ubuntu 10.04

Original comment by tehra...@gmail.com on 26 Sep 2012 at 4:33

GoogleCodeExporter commented 8 years ago
Ok, I found some time. I fixed the problem with the German keyboard. However, 
the fix is really stupid, because I still don't understand the meta-key 
handling. The patch is against the version source 2.14. The attached binary can 
be used in Debian. Just install the shellinabox_2.9-1_i386.deb package and 
replace the binary with the attached one.

Changes:
- fix keyboard problem (tested with German keyboard)
- change window title to "News"
- clear screen if connection is lost

I hope it can help someone.

Original comment by antangu...@gmail.com on 1 Oct 2012 at 9:12

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the german diff ! :)

Original comment by layhe...@googlemail.com on 12 Nov 2012 at 3:13

GoogleCodeExporter commented 8 years ago
We are maintaining a fork with some of our patches for these kinds of issues:

https://github.com/pythonanywhere/shellinabox_fork/commits/master

Original comment by harry.pe...@gmail.com on 22 Nov 2012 at 3:27

GoogleCodeExporter commented 8 years ago
Thank you Harry! You made my day! :D

I made a little gentoo overlay for it: 
https://ceras.dyndns.org/ceras-overlay.xml

Original comment by sirko.sc...@gmail.com on 2 Jan 2013 at 4:31

GoogleCodeExporter commented 8 years ago
I have a fix for the Swiss and French keyboards under Firefox 15.
Attached is the patch to apply to r239.

Original comment by macgar...@gmail.com on 8 Jan 2013 at 1:34

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

I have a different approach to fix this problem. Firefox is correctly creating 
the keyPress events with charCodes. So the only thing to do, is to ignore the 
keys during keyDown and let the keyPress event handle the keys. So the new 
keyCodes simply should be recognized as normal keys.

Original comment by alex.ani...@googlemail.com on 8 Jan 2013 at 2:48

Attachments:

GoogleCodeExporter commented 8 years ago
thx alex, tested and confirming fix.
only nonworking keys here are now alt gr modifier combos on a german layout.

Original comment by a.hei...@gmail.com on 10 Jan 2013 at 2:41

GoogleCodeExporter commented 8 years ago
I tried the 0001-add-new-keyCodes-used-by-FF15.patch and it fixed the issue for 
Firefox. However TAB stopped working for Chrome, not sure if any other keys 
were affected.

Original comment by drenna...@gmail.com on 14 Jan 2013 at 5:39

GoogleCodeExporter commented 8 years ago
Oh you are right. There was in error with the operators. Here is the correct 
patch.

Original comment by alex.ani...@googlemail.com on 14 Jan 2013 at 6:03

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks ! that new patch is working fine in both Firefox 17 and Chrome for me.

Original comment by drenna...@gmail.com on 16 Jan 2013 at 8:00

GoogleCodeExporter commented 8 years ago
Hi, there's still a problem with french layout keyboard even with the latest 
patch

Following keyCodes are not caught :
 ^ (160 - dead key)
 $ (164)
 * (170)
 ù (165)
 ! (161)
 : (58)
 < (60)

Found keycodes on http://www.asquare.net/javascript/tests/KeyCode.html

I'll try to find a solution by myself but it'll take some time, perhaps someone 
can find an answer more quicker.

Original comment by furydonn...@gmail.com on 2 Feb 2013 at 8:41

GoogleCodeExporter commented 8 years ago
Found it ... don't hurt me : I hadn't reload in Firefox after update :)

However, I guess the patch should also be applied in function keyUp

Sorry.

Original comment by furydonn...@gmail.com on 2 Feb 2013 at 9:19

GoogleCodeExporter commented 8 years ago
Is this fix not going to go into git clone 
https://code.google.com/p/shellinabox/ ?

I really would rather not apply a patch to be able to use _ or - ...

-Tom

Original comment by tom.at.t...@gmail.com on 25 Feb 2013 at 8:41

GoogleCodeExporter commented 8 years ago
I have the same question as Tom.

Original comment by strubblm...@gmail.com on 27 May 2013 at 6:35

GoogleCodeExporter commented 8 years ago
Here is a patch file that works for me with FF19+

Original comment by furydonn...@gmail.com on 30 Jul 2013 at 6:28

Attachments:

GoogleCodeExporter commented 8 years ago
The sib.patch seemed to work fine for me.

Can you please pull this change?

Original comment by buzypi on 21 Aug 2013 at 8:27

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
None of these patches work with a german layouted Firefox 25.

Original comment by Matthias...@googlemail.com on 9 Dec 2013 at 2:38

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Same Problem here with FF 27.0.1 and german Layout

Original comment by byteki...@gmail.com on 18 Mar 2014 at 8:32

GoogleCodeExporter commented 8 years ago
FF30 and the issue is still occurring, both on debian7.5 and centos6.5

Original comment by stephane...@koozali.org on 25 Jun 2014 at 9:12

GoogleCodeExporter commented 8 years ago
So I took the ubuntu upstream sources, and added some fixes (including 
firefox/ipad fixes from the fork at pythonanywhere/shellinabox_fork)

Source: https://github.com/anilgulecha/shellinabox
Debian package: 
https://github.com/anilgulecha/shellinabox/releases/download/2.14.2/shellinabox_
2.14-1_amd64.deb

Install this via:
sudo dpkg -i shellinabox_2.14-1_amd64.deb

Original comment by a...@hackerrank.com on 5 Jul 2014 at 9:22

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
What would be the required set of tests to get one of these patches applied to 
the main code stream for Shell In a Box?  I'm willing to test on EN_US 
keyboards with a smattering of distros, but I don't use the foreign keyboards. 
I have other minor changes to the source for my implementation on Debian Wheezy 
so it would be nice to not fork very far from the main code.  For now I can 
work with the copy/paste from text editor workaround, but that isn't a long 
term solution.

I'm on a windows 7 client with FF 35.

--thanks-for-a-cool-package,
Von

Original comment by obivonha...@gmail.com on 24 Feb 2015 at 4:42

GoogleCodeExporter commented 8 years ago
Hi, obivonha...@gmail.com 

We are also interested in maintaining shellinabox project, but we cannot contact
original owners. You can checkout issue #261 and leave a message there, if you 
want to help us or join us :)

https://code.google.com/p/shellinabox/issues/detail?id=261

For starters we created a fork on github and will try to gather patches from
this issues.

https://github.com/shellinabox

Hope that helps.

Original comment by luka.kra...@gmail.com on 5 Mar 2015 at 1:48

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
FWIW you can use the "minus" key in the 10 key part of your keyboard as a 
workaround for the "dash" key not working...no underscore (etc.) though.  Or 
use Chrome etc.  (can't believe google code doesn't let you *edit* a comment. 
yikes. maybe that's why it is going away LOL).

Original comment by rogerdp...@gmail.com on 9 Jul 2015 at 4:03