I'm not sure quite what you're doing with inbuf? If you just had USB.on('data', data => LoopbackB.write(data)) I'd have thought up-arrow and stuff like that would work fine.
USB.on('data', data => LoopbackB.write(data))
Ctrl-C doesn't work because JS is effectively single-threaded. Data is only transferred between USB/Loopback when your JS is run which transfers it - but if you are running other code then the JS that does that doesn't run. To work around it normally there's some special code in the interpreter which looks for Ctrl-C as it comes in, in the interrupt.
If you want to figure out how to properly interpret the data you're getting, google VT100 - that's effectively what you have. Espruino does have a very simplistic implementation in https://www.espruino.com/modules/VT100.js which handles writing everything out to a Graphics instance, and potentially you could use that if you really needed to.
Thanks for all answers and advices you have given me! All of that was extremly helpful.
© Espruino, powered by microcosm.
Report a problem