sdether / josh.js

Toolkit for building a bash-like shell in the browser, including full readline support
http://sdether.github.com/josh.js/
Apache License 2.0
390 stars 76 forks source link

mobile compatibility #40

Open moore3071 opened 8 years ago

moore3071 commented 8 years ago

Currently on mobile (Android Marshmellow using Chrome or Firefox) the javascript seems to run fine (there is a blinking cursor), but the field is not accessible to input and the keyboard won't appear for input.

sdether commented 8 years ago

The problem as far as I can tell is that mobile keyboards only show up when a textbox has focus. Since josh emulates its own input for the shell, it's just listening to keypresses, but mobile browsers do not know that.

moore3071 commented 8 years ago

That makes sense. Looking over the code I can only come up with one possible solution (and it's hacky).

It might be possible to have a text input field in the foreground over the console that sets readline to active when focused. Meanwhile js would intercept the input and pass it to readline.