News for hackers. Stuff that matters.
Re:Unix-like virtual shell inside browser by ks on Sunday January 24, 2010 @05:45PM (#1073938)
Very interesting. It seems that each visitor is in a self contained environment. I made a simple HTML called "test.html" that I could access from http://cb.vu/test.html. This file was only visible in my own browser,
Re:Unix-like virtual shell inside browser by Luyt on Sunday January 24, 2010 @07:18PM (#1074053)
Indeed, there is minimal communication between your browser and the server. Nearly everything happens locally in your browser. Many responses from the commands you can use are canned. Watch the source code to see how it's done ;-)
Re:Unix-like virtual shell inside browser by wanderr on Sunday January 24, 2010 @09:42PM (#1074262)
the password for root is...root

Interestingly, I ran rm -rf / as root, and it acted like it wiped out everything. reboot made it act like it was rebooting, and refreshing the page showed "you broke it!" until I deleted the appropriate cookies. Fun!

Re:Unix-like virtual shell inside browser by biotech on Sunday January 24, 2010 @10:41PM (#1074326)
If you refresh the page 4 times, the page shows:

You can use "fortune" you know...

Re:Unix-like virtual shell inside browser by r11t on Sunday January 24, 2010 @05:55PM (#1073943)
This has been built using terminal.js : http://www.masswerk.at/termlib/index.html

This sort of in browser shell seems to be useful for building stuff like "MongoDB Browser Shell" http://mongo.kylebanker.com/

Re:Unix-like virtual shell inside browser by twism on Sunday January 24, 2010 @06:37PM (#1074006)
I wish I knew about terminal.js before I started working on an implementation of a shell in the browser: http://tsh.ashafa.com/

I needed more than the traditional input text type or textarea for input I saw all the time while I was researching a solution.

Re:Unix-like virtual shell inside browser by kordless on Sunday January 24, 2010 @10:45PM (#1074333)
I've been working on something like this as well, and your approach is closer to what I've done than terminal.js. To me, it makes more sense to pass the commands back to the server for parsing and handling - let JS just be the display handler. Oh, I like the tab completion stuff too.

Your source code indicates it may have an Open Source license on it. Do you have the raw source available somewhere? Happy to share what little I have done so far.

Re:Unix-like virtual shell inside browser by twism on Monday January 25, 2010 @06:42AM (#1074876)
Thanks and yes I will put the entire source on github as soon as I clean it up. The current un-minified javascript can be found here:

http://tsh.ashafa.com/static/global.js

It was really a quick experimental hack that turned into something worth dedicating a little more time to. Not my best javascript at all.

Re:Unix-like virtual shell inside browser by martinp on Sunday January 24, 2010 @05:42PM (#1073931)
Trying the traditional bash fork bomb gives a rather fun screen. Try entering the following

  :(){ :|:& };:
Re:Unix-like virtual shell inside browser by blaiset on Sunday January 24, 2010 @08:18PM (#1074135)
Well that was fun :P "If problems continue, install linux"
Re:Unix-like virtual shell inside browser by enomar on Sunday January 24, 2010 @05:25PM (#1073898)
I hope Chrome OS includes something like this. Ssh support would be especially useful.
Re:Unix-like virtual shell inside browser by blasdel on Sunday January 24, 2010 @06:41PM (#1074014)
Google Native Client opens up a world of possibilities for client-side apps that still live within the Browser > Tab > DOM.

I'd mostly just want a TTY w/ OpenSSH, VNC, and RDP. Usermode Linux would be nice too.

Re:Unix-like virtual shell inside browser by enomar on Sunday January 24, 2010 @05:29PM (#1073906)
Surprised vi works, but hitting backspace made my browser go back in the history.
Re:Unix-like virtual shell inside browser by est on Sunday January 24, 2010 @05:37PM (#1073922)
Backspace doesn't work in chrome 4.0.266.0 (r33992)
Re:Unix-like virtual shell inside browser by sax on Sunday January 24, 2010 @05:43PM (#1073935)
Ubiquity allows a similar interface, at an arguably better abstraction level: https://mozillalabs.com/ubiquity/
Re:Unix-like virtual shell inside browser by TheSOB88 on Wednesday January 27, 2010 @06:31PM (#1082346)
Hey, I wanted to meet up with you in Boulder (Qualcomm interview guy). I couldn't find your email, so I'm spamming all your comments, which is probably against the law. Please email me at [email protected], or read my longer comment: http://news.ycombinator.com/item?id=1078343
Re:Unix-like virtual shell inside browser by raphar on Sunday January 24, 2010 @08:18PM (#1074134)
Doesn't work in iPod! :(

It must be because you need an input or text area to make the virtual keyboard to appear.

Re:Unix-like virtual shell inside browser by alexitosrv on Monday January 25, 2010 @12:34AM (#1074509)
If you want to try, type "invaders" (without the quotes), and enjoy...
Re:Unix-like virtual shell inside browser by rman666 on Sunday January 24, 2010 @06:24PM (#1073982)
Seriously cool! Thanks Colin, for sharing this with the world :-)
Re:Unix-like virtual shell inside browser by d0m on Sunday January 24, 2010 @09:11PM (#1074222)
Pretty cool.. I did mostly play snake thought.
Re:Unix-like virtual shell inside browser by elblanco on Sunday January 24, 2010 @08:18PM (#1074137)
And so the circle is complete.
Re:Unix-like virtual shell inside browser by ez77 on Sunday January 24, 2010 @08:15PM (#1074128)
Try invoking ed =).
Re:Unix-like virtual shell inside browser by gnosis on Sunday January 24, 2010 @10:08PM (#1074291)
Looks like you can even use vi.
Re:Unix-like virtual shell inside browser by mbubb on Sunday January 24, 2010 @08:30PM (#1074151)
or sudo
Re:Unix-like virtual shell inside browser by throw_away on Sunday January 24, 2010 @09:19PM (#1074231)
please port lynx :)