8 ms·
Xterm.js
- tyingq 5y agoRelated is https://hterm.org/ https://hterm.org/ , used with the built in ssh terminal in chromebooks.
- gkfasdfasdf 5y agoAnyone know how they compare, feature wise?
- apignotti 5y agoA well made library, we use it as part of the REPL demos for CheerpX, our WebAssembly-powered X86 virtual machine. https://nextrepl.leaningtech.com/?python3 https://nextrepl.leaningtech.com/?python3
- hulitu 5y ago"Build terminals in the browser" ... and give your passwords there, and type commands. What can go wrong.
- emilfihlman 5y agoRunning in the browser is no more (or less) untrusted than running a dedicated terminal client.
- tyingq 5y agoThat a terminal in the browser can't make ssh connections without a separate http or websocket bridge complicates that. Depends on that bridge and who/how/where it's running.
- rbanffy 5y agoWhen was the last case when a malicious website or script could capture content or keystrokes directed at another tab? Really curious, because it seems an obvious attack vector.
- amalcon 5y ago2018 at the earliest: https://en.wikipedia.org/wiki/Spectre_(security_vulnerability) https://en.wikipedia.org/wiki/Spectre_(security_vulnerabilit... It's not a browser vulnerability per se, but it's still mitigated by having a separate address space.
- colejohnson66 5y agoAt least in the last decade, I don’t think that’s even possible on the “big” browsers. There were vulnerabilities involving <iframe>s, but I don’t know enough about those.
- noergl 5y agoI tend to disagree. The fact, that a browser engine and JS is involved raises the bar significantly during security audits. It brings additional third-party players into the chain you have to trust. Meanwhile I suggest to read https://xtermjs.org/docs/guides/security/ https://xtermjs.org/docs/guides/security/.
- intc 5y agoOf course it is. In most cases you do not have any sort of guarantees regarding the browser (which it self usually is more complex piece of software than all your operating system and it's accessories calculated together - difficult to audit - known to collect metrics etc etc). In addition one can sandbox their local terminal pretty effectively - With Tomoyo or some other MAC technology. It's not so bad idea to actually isolate your browser too (with Mandatory Access Control) - It usually has no business for a global view on your filesystem or local network resources.
- lhnz 5y agoAre terminals better sandboxed when run outside of a browser?
- rbanffy 5y agoUsually yes. They are running in a completely different process than the browser.
- chungy 5y agoDon't be ridiculous. The only and obvious answer to the question is "no" -- the terminal itself and all commands inside it run unimpeded.
- rbanffy 5y agoA malicious website would have a hard time capturing (or injecting) info an OS terminal running on an entirely different process than it would on a browser with imperfect context separation. You clearly misunderstood the issue.
- sime2009 5y agoYou are aware that millions of people use web browsers each day to do their banking, purchase products, and generally run businesses?
- saimiam 5y agoThat’s quite a roster of clients using xtermjs.
- messe 5y agoThe demo on the homepage seems to be broken in Safari on macOS. I'm not seeing any text.
- Tyriar 5y agoThis is related to some issue with Safari's new WebGL 2 implementation they shipped recently[1]. Currently we disable the webgl renderer on Safari inside github.dev/codespaces to work around this. [1]: https://github.com/xtermjs/xterm.js/issues/3357 https://github.com/xtermjs/xterm.js/issues/3357
- messe 5y agoLooks to be the case. Disabling WebGL 2.0 at the browser level fixes the issue.
- Mikeb85 5y agoEverything fun on the web is broken in Safari... Pretty sure it's by design.
- rbanffy 5y agoI wonder how well it fares on the VT100 torture test curl -q http://cdn.preterhuman.net/texts/art/torturet.vt http://cdn.preterhuman.net/texts/art/torturet.vt
- Tyriar 5y agoIt should fare fairly well, at least for the most common sequences. We have detailed what VT features we support on the website[1]. Some things that stand out that I know won't work are blinking and double height/width text. [1]: https://xtermjs.org/docs/api/vtfeatures/ https://xtermjs.org/docs/api/vtfeatures/
- rbanffy 5y agoNot quite: https://news.ycombinator.com/item?id=28801308 https://news.ycombinator.com/item?id=28801308 Apple's Terminal: https://imgur.com/a/8IgJBdC https://imgur.com/a/8IgJBdC
- echeese 5y agoWonder no more: https://i.imgur.com/DGuoj9p.png https://i.imgur.com/DGuoj9p.png
- adamrezich 5y agohow about termbench? https://github.com/cmuratori/termbench https://github.com/cmuratori/termbench
- echeese 5y agoThat would be considerably more work. Could make a fun Thanksgiving weekend project, though.
- npteljes 5y agoI cringe every time at the name "torture test". Prime95 uses it too for example. Is it really a torture for a software to demonstrate each of its features? Or for my CPU to work at near 100%? So insensitive.
- kevincox 5y agoI like that the default renderer allow copy-paste.
- fimdomeio 5y agojust throwing a related idea in here in the hopes someone finds it interesting enough to develop. Having a very simple cli app generator that allows one to have independent terminal applications that run just like normal app. Independent in the sense that you can open them as any other app, run on their own window, and and you can reach them through the app switcher.
- mbreese 5y agoIf you're on a Mac, you can do this with AppleScript. If you open the Script Editor, you can use this chunk of code to get started: tell application "Terminal" do script "~/test.sh" end tell This will run the script ~/test.sh in a new terminal window. Closing the window automatically is a bit more difficult, but it can also be done. You can save this as an Application, which will let you click to open it, just like any other application. See here for more information: https://stackoverflow.com/questions/1870270/sending-commands-and-strings-to-terminal-app-with-applescript https://stackoverflow.com/questions/1870270/sending-commands... https://stackoverflow.com/questions/27453987/how-to-close-a-terminal-tab-using-applescript https://stackoverflow.com/questions/27453987/how-to-close-a-...
- c0wb0yc0d3r 5y agoIs this different than opening the executable from the file manager?
- rasengan 5y agoFun fact - xterm.js was originally created by chjj who also wrote the code for Handshake DNS among other things. My favorite is blessed [1]. He’s definitely a super programmer. Thank you for all your contributions to this world @chjj! [1] https://github.com/chjj/blessed https://github.com/chjj/blessed
- williamstein 5y agoterm.js was originally created by Fabrice Bellard -- see the headers of @chjj's term.js file [1]. Bellard wrote term.js since he needed a way to interact with his amazing port [2] of Linux to a web browser. Term.js had a non-open-source license and @chjj spent time a decade ago successfully convincing Bellard to relicense term.js open source (I watched and greatly appreciated this as it happened!). Xterm.js is a very significant rewrite and improvement of term.js, mostly done by Daniel Imms who is on the VS Code team at Microsoft; xterm.js is a great contribution of Microsoft to open source, and is used at VS Code's terminal. I watched all this happen over the years, visited Daniel at Microsoft, etc.; I think this is all very useful tech (e.g., we use it in JupyterLab and CoCalc). [1] https://github.com/chjj/term.js/blob/master/src/term.js https://github.com/chjj/term.js/blob/master/src/term.js [2] https://bellard.org/jslinux/ https://bellard.org/jslinux/
- Tyriar 5y agoJust to clarify, xterm.js is not a Microsoft project and tries to remain neutral, but MS is essentially sponsoring it through my work. Also, a good deal of my time spent working on it particularly early on was for the love/fun of it in my spare time. The WebGL renderer for example was a pure fun personal exercise.
- humility 5y agoTIL chrome has an ssh client extension which can be used in a browser tab. Anyone care to share their experience with it? https://chrome.google.com/webstore/detail/secure-shell-app/pnhechapfaindjhompbnflcldabbghjo https://chrome.google.com/webstore/detail/secure-shell-app/p...
- gizdan 5y agoI used to use it some years back when I was still on Windows and using Chrome. It was pretty good for a Windows environment. For a Linux/Mac environment, it doesn't come close to a proper terminal emulator. It'll do the job, but I recall there were a few things that were annoying.
- corybrown 5y agoUsed this as my daily driver for dev work for years, works great. Only downside is it doesn't do emoji rendering well
- adamrezich 5y agoI made it through my first semester of computer science using Secure Shell on a cheap Chromebook and a linux box back in my apartment.
- Tyriar 5y agoHi all, I'm one of the maintainers of xterm.js, open to answer any questions! Here's a little history on the project, some of which is already called out in other comments: - Fabrice Bellard created jslinux[1]. - Christopher Jeffrey (@chjj) forked the terminal component into term.js[2], this eventually became unmaintained. - Paris Kasidiaris (@parisk) forked it into xterm.js for use in SourceLair[3]. - I showed up around 2016 when investigating options for VS Code's integrated terminal and eventually joined as a maintainer, spending a good deal of my time at work on the project since then. We currently have 5 active maintainers in the xterm.js team as well which I'd like to call out because the project has only come this far as a result of everyone's efforts. [1]: https://bellard.org/jslinux/ https://bellard.org/jslinux/ [2]: https://github.com/chjj/term.js https://github.com/chjj/term.js [3]: https://www.sourcelair.com/ https://www.sourcelair.com/ EDITS: Formatting
- jimmar 5y agoI'm an educator and I to teach things like symmetric cryptography. I just used full virtual machines in class to demonstrate ccrypt to encrypt and decrypt files. Would xterm.js be a valid way to implement that kind of exercise to avoid relying on virtual machines? Do you know of any resources that would point me in the right direction for building educational exercises?
- Tyriar 5y agoxterm.js is only a frontend, you still need to plug it into a backend or write you own. A VM would probably be the way to go.
- jimmar 5y agoThanks. I was curious because the demo on the homepage doesn't appear to be communicating with a backend. (The xterm.js code just seems to interact with https://xtermjs.org/js/demo.js https://xtermjs.org/js/demo.js.) So I guess this demo presented an experience that people should expect with xterm.js, but not necessarily the standard implementation.
- thinkafterbef 5y agoLove xterm.js! We use it to stream logs and as an in-browser terminal for our upcoming CI[1]. It's blazing fast especially with the WebGL renderer turned on. [1]https://buildjet.com https://buildjet.com
- parhamn 5y agoI've used this to create recorded terminals to Kubernetes for an internal app I built. We'd basically proxy the kube exec socket endpoint with a write log so we can playback what folks did. Worked wonderfully. Thanks maintainers!
- dugmartin 5y agoThis is a great project. I played with it a few years ago to create a tiled ssh client in Electron as a proof of concept for an idea I had and it was very easy to integrate. It has only gotten better since then with all the love from the Microsoft sponsored commits (it is used in VSCode).
- biginkorea 5y agoWe're using xterm.js to teach programming to kids in a block-based (like MIT scratch) editor: https://app.code-it-studio.de/makerspace/57 https://app.code-it-studio.de/makerspace/57
- DonHopkins 5y agoI wrote a VT100 emulator in PostScript for NeWS in 1987! I worked for a company called Wedge Computer (ha ha!), who ported NeWS to the Mac II running A/UX, which needed a way to connect to Unix servers from NeWS without running a terminal emulator client remotely. It could passed vttest! https://donhopkins.com/home/archive/NeWS/tnterm.ps https://donhopkins.com/home/archive/NeWS/tnterm.ps https://en.wikipedia.org/wiki/NeWS https://en.wikipedia.org/wiki/NeWS Two versions of NeWS on Mac II Make Debut https://books.google.nl/books?id=Cj8EAAAAMBAJ&pg=PA31&lpg=PA31&dq=%22wedge+computer%22+%22news%22+%22mac%22&source=bl&ots=OGlB_t3fXQ&sig=ACfU3U1AJciLsfbqkbKQjMX02zNq9z1hpA&hl=en&sa=X&ved=2ahUKEwiooee50bvzAhWQ2aQKHWvFCiMQ6AF6BAgCEAM#v=onepage&q=%22wedge%20computer%22%20%22news%22%20%22mac%22&f=false https://books.google.nl/books?id=Cj8EAAAAMBAJ&pg=PA31&lpg=PA... Yep, Unix ran on Macs in 1988! https://en.wikipedia.org/wiki/A/UX https://en.wikipedia.org/wiki/A/UX
- oso2k 5y agoAnother older terminal JS library that might interest people is https://www.masswerk.at/termlib/ https://www.masswerk.at/termlib/
- webwanderings 5y agoWould somebody (if reading this) want to be generous and help me out? I'm not a programmer. I'd wish to use xterm.js in either a md or the mdx file (looking to incorporate a terminal in docusaurus site). My google-fu fails me for this.