SSHy icon indicating copy to clipboard operation
SSHy copied to clipboard

Updated to latest Chrome/Safari/wsProxy.

Open drgrussell opened this issue 4 years ago • 0 comments

  • Works with wsproxy, though you must set the connection to binary using setProxyEncoding('binary');
  • Updated to use the latest xterm.js
  • Can do binary websockets
  • Works again with the latest Chrome and safari (and maybe others!)\

Issues: #45 , #43 , #38 Probably #36 , #29 , #28

Long comments on the changes

css/xterm.css

  • Updated css/xterm.css with xtermjs 4.11.0

css/main.css

  • Some SSHy css had been added to the end of css/xterm.css previously, and this is now appended to css/main.css

js/xterm-addon-fit.js

  • FIT is now seperate from xterm, so include FIT imported using npm and translated from typescript (then tidied).

js/src/xterm.js

  • Updated to xtermjs 4.11.0. This is an npm import. Deleted the old version, which was originally called js/src/xterm.min.js

js/settings.js

  • xtermjs renamed some variables and functions or made them private. "Themes" was one of those.
  • The interface to FIT was also changed.

js/SSHyClient.js

  • The interface to FIT was changed.
  • Make sure the side panel is updated with row/col changes from FIT.
  • Previously the ssh transport to the ssh server was fed from an event handler using onkeydown. This meant that the feeder also had to translate key events into xterm escape codes. This used a private function which is now inaccessible. The code was changed to mostly use the onData event from xtermjs, which does all the transation for you. We still use an event handler though to get the username and password, and switch to onData once the connection is authenticated. Rather than use onkeydown, we now use xtermjs attachCustomKeyEventHandler. This greatly simplifies the code too. The code for local echo was lost in the update, but I dont think that worked anyway.
  • Code about pasting just doesnt work now. onPaste is triggered well after xtermjs processes the paste. So moved the Split code into onData to protect from any transmission of large blocks.
  • Added in a way to switch on binary transfer mode. Made the default still base64. But now you can setProxyEncoding('binary'); after loading the scripts to change to binary mode. It is much harder than it appears to do the string to arraybuffer conversion. Encode and decode do not work here.

fastbuild

  • Just wanted to build libraries which were not minimised for development and debugging. This trivial script seems to do the job

wrapper.html

  • FIT doesnt seem to work in ROWS when the enclosing DIV is not height:100%.
  • Include main.css, as this is now split out of the imported xterm.css
  • link has never supported async as far as I can see

index.html

  • link has never supported async as far as I can see
  • FIT doesnt seem to work in ROWS when the enclosing DIV is not height:100%.
  • Could not test this properly in base64, as I could not build the old wsproxy which is in this distribution (too many out of date dependencies). But I tested some of it, and it seems to be right. Works fine with the latest wsproxy in binary mode
  • You can do binary mode by calling setProxyEncoding('binary'); This is the default here as it then works with the latest wsproxy It is much harder than it appears to do the string to arraybuffer conversion. Encode and decode do not work here.

drgrussell avatar Mar 26 '21 19:03 drgrussell