Does hterm not grok binary, then? I’m implementing ZMODEM in JavaScript.
-F
> On Sep 10, 2017, at 12:47 PM, Mike Frysinger <
vap...@chromium.org> wrote:
>
> actually double checking docs, don't be confused by t.print and t.io.print. the latter is probably what you want to be using and takes care of going through interpret. if you're hitting the terminal directly, you need to differentiate between .print and .interpret (and making sure you're sending UTF8 encoded content).
> -mike
>
> On Sun, Sep 10, 2017 at 12:07 PM, Mike Frysinger <
vap...@chromium.org> wrote:
> pretty sure you want to use t.interpret instead of t.print in ws.onmessage
> -mike
>
> On Sun, Sep 10, 2017 at 9:20 AM, <
fel...@felipegasper.com> wrote:
> Hello,
>
> I’m trying out hterm after having used xterm.js for a while. hterm seems not to parse the input from my server-side shell very well; does this pattern look familiar to anyone?
>
> It’s the same terminal server that serves up xterm.js reliably.
>
> Thank you!
>
> <Auto.png>
>
> Here is the code:
>
> Enter code here...hterm.defaultStorage = new lib.Storage.Memory();
>
> var t = new hterm.Terminal();
>
> var text_decoder = new TextDecoder();
> var ws = new WebSocket("ws://localhost:32000");
> ws.binaryType = "arraybuffer";
> ws.onmessage = function(evt) {
> t.print( text_decoder.decode(evt.data) );
> };
>
> t.onTerminalReady = function() {
> var io = t.io.push();
>
> io.onVTKeystroke = function(str) {
> ws.send(str);
> };
>
> io.sendString = function(str) {
> ws.send(str);
> };
> };
>
> t.decorate(document.querySelector('#terminal'));
>
> t.io.println('Print a string and add CRLF');
>
> t.installKeyboard();
>
>
>
> --
> You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
> To view this discussion on the web visit
https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/b2f1300d-26c2-422a-9ea9-e64b92321425%40chromium.org.
>
>
>
> --
> You received this message because you are subscribed to a topic in the Google Groups "chromium-hterm" group.
> To unsubscribe from this group and all its topics, send an email to
chromium-hter...@chromium.org.
> To view this discussion on the web visit
https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/CAAbOSckjGpi%2BTh8wTfTGCj_yZ5%3Dyk6JMzzMRHvW1E_rU2cs4Xg%40mail.gmail.com.