News for hackers. Stuff that matters.

Show HN: I created a shell like website in plain JavaScript

Here's the link: https://ssrangisetti.github.io/jsshell/. It supports pipes, tab completions and history. It can type some commands on page load like https://ssrangisetti.github.io/jsshell/#cmd=cat.js%20docs/help.md|md.js&intervel=50.

It's built to understand html elements instead of normal terminal codes. So we can do something like below:

https://ssrangisetti.github.io/jsshell/#cmd=echo%20%3Ca%20href=%22javascript:term.typeAndExecute('cat.js%20docs/help.md%26%23x7c%253Bmd.js')%22/%3Eclick%20here%20for%20docs%3C/a%3E|md.js

or

https://ssrangisetti.github.io/jsshell/#cmd=echo%20%3Cbutton%20onclick='document.getElementById(%22rick-roll%22).style.display=%22block%22'%3Eclick%20here%20for%20a%20surprise%3C/button%3E%3Cimg%20src=%22https://media.tenor.com/SSY2V0RrU3IAAAAd/rick-roll-rick-rolled.gif%22%20id=%22rick-roll%22%20style=%22display:%20none%22%3E|md.js

it's based on https://uni.xkcd.com/ and https://aava.sh/

( 2 comments | on HN )
Re:Show HN: I created a shell like website in plain JavaScript by marginalia_nu on Friday April 21, 2023 @09:21AM (#35653340)
Way back in the day, this must have been like 2004, I for a moment had an actual shell on my website. I don't remember what I was doing to accomplish it, I think I was doing either CGI or PHP, but it talked to a C daemon process which execv'd a bash prompt. Then I did some crude AJAX code to render a terminal and pass keypresses.

Naturally I just had this fully exposed with no log-in because it was in the early 2004 and surely nobody would go on the internet and `rm -rf` stuff.

Anyway, thanks for coming to my TED talk.

Re:Show HN: I created a shell like website in plain JavaScript by osdotsystem on Friday April 21, 2023 @09:10AM (#35653168)
Nice potential for a teaching tool!