Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not correctly handle keyboard input on iOS/Android #29

Open
yku12cn opened this issue Nov 19, 2019 · 6 comments
Open

Can not correctly handle keyboard input on iOS/Android #29

yku12cn opened this issue Nov 19, 2019 · 6 comments

Comments

@yku12cn
Copy link

yku12cn commented Nov 19, 2019

I have setup SSHy on a server and it works perfectly while accessing from PC based web browser.

However, when accessing from either "iOS + safari" or "android + chrome", the terminal failed to response to keyboard events.

It seems SSHy doesn't support such "virtual keyboard" on mobile devices.

Is this a bug or intended?

@stuicey
Copy link
Owner

stuicey commented Nov 19, 2019

Its a known shortfall, xtermjs is used as the frontend to handle xterm escape codes so until mobile support is provided by that library it won't trickle down to here:
https://github.com/xtermjs/xterm.js

I think some of the newer versions of xtermjs might actually have mobile support if you were interested in trying to update the library

@yku12cn
Copy link
Author

yku12cn commented Nov 19, 2019

Thanks for the quick reply.

By replacing xtermjs, do you mean changing the following files?
./js/src/xterm.min.js
./css/xterm.css

Besides, I think there is something wrong with handling the virtual keyboard-popup.
Say, when keyboard-popup happens, the web page should adjust its layout dynamically so the cursor won't be covered. However, SSHy was not able to do so.
Is this something can be easily supported from your end? I'm not an expert of web design. It's your call.

@stuicey
Copy link
Owner

stuicey commented Nov 19, 2019

Yeah those two files are the core pieces of xtermjs - so updating them should bring in any fixes or updates that have went into the library.

Personally I haven't done much mobile web design so I'm not entirely sure on exactly how the keyboard popup interacts with the page. Currently SSHy uses xtermjs-fit module to calculate how many rows/columns are available on the current page and sends those over to the SSH server. So if the soft keyboard interacts with the page at all to reduce the resolution then it should be quite easy to put the resize hook on that.

To note: official mobile support looks like its a WIP xtermjs/xterm.js#1101

@yku12cn
Copy link
Author

yku12cn commented Nov 19, 2019

I did a naive swap of both ./js/src/xterm.min.js and ./css/xterm.css with current official release.
It seems you can't update lib this way.
First of all, replacing ./css/xterm.css breaks the page.
Second, replacing ./js/src/xterm.min.js or even removing it does absolutely no effect to anything...

I did clear cache by performing a "empty cache and hard reload" from user end and restart the server..

@stuicey
Copy link
Owner

stuicey commented Nov 19, 2019

If you're changing any of the JavaScript for SSHy you'll need to rebuild the distributed js file. Check the Build section in the readme for the commands

I wouldn't be surprised that the css update on its own might break the page but there could be a couple things in there that are relied on. Not something I can remember unfortunately 😢

@yku12cn
Copy link
Author

yku12cn commented Nov 19, 2019

Thanks a lot..

I was wondering how index.html was able to access code in xterm.js without even reference it once. It turns out that all js code is bundled into combinedLibs.comb.js.. Guess I'm really new in this area...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants