Neat! If I can make one suggestion: I know this is usually not at all what people should with websites, but consider hijacking basic browser hotkeys to augment the shell. Tab for auto complete instead of select next element would be a good start, and I think in this type of situation its acceptable to hijack.
I agree, hijacking is good when it leads to the expected user behaviour. I kept pressing tab to auto-complete the command, but the cursor jumped to the address bar.
There we go, I opened this thread with two things in mind that immediately struck me - tab completion and pressing up for previous command and those two are the top comments!
The first command I ran was `ls`, which worked as expected, but then I tried running `./cowsay blah`, which didn't work. I wasn't sure how to run it until eventually I guessed `sh cowsay blah`, and it worked.
Maybe make the `./` shortcut for executing stuff?
While I'm not sure how much work it would be, it might also be kind of cool to implement the `cd` command as well.
I personally think this is the best solution besides implementing ‘./‘: take the colouring off and simply return “permission denied” when someone tries to ‘chmod’
Yes, I plan to implement './' which is the expected behavior for running executables. I also plan to implement 'cd' and organize the content into nix style directories.
I have two suggestions:
1) Add support for tab key so users don't have to type the entire file names
2) On initiation display the available commands or a brief intro text automatically, then let users dive deep into whatever they are interested in (help command works fine but it's a personal website so you would like to give people as much info as possible as fast as you can in the most original way.) It's a quite original idea.
hi thanks for the suggestions. Yeah, I also thought whether I should display the available commands at the start or not, but it makes more sense to do so.
Absolutely do this. The initial blank prompt felt intimidating without any suggestions; and would help with the esoteric aspect of it for certain user sets. :)
It’s hard to make a shell that works like a real shell. Make it a shell from a parallel universe instead, or something more like a text adventure game, or a REPL in a context specific to your home page.
A weird aavshr command prompt for probing your inner mind. ADB: aavshr debug bridge. The visitor has just interrupted execution in a novel lisp that runs in your head and can inspect current state and run a handful of functions.
Something less familiar than a shell will give you more freedom to be really weird. REPLs are all the rage and a lot more flexible. Good luck!
Such a great idea! I'd personally consider using busybox in WASM instead of reimplementing a shell. Quick Google search found [1]. Have you considered that?
This is cool. My personal website (https://iamlocaljo.com/) is visually a terminal, though it doesn't support ls, cat, etc and only has commands for page names. Maybe I should add support for ls, cat and other typical shell commands. Good idea.
I've enjoyed working on similar projects, they are fun.
A small usability suggestion, since your whole page is a shell and the input field isn't well visually defined, I would make clicking nearly anywhere give focus to the input field.
He means, don't override it to give it its normal shell meaning, as the current meaning (add bookmark) is pretty desirable for him as owner of the site.
Nice job! If you want to see a (very hacky) example of autocomplete, history, and inline-image support check out a shell I wrote recently: https://zenith.tech
Very cool! Add some “directory” as sections to your website, so people would “cd” into them to see the various sections (with probably index.html as a default MOTD?). There is also a mini bug when one lists the directory with “-l”: the filenames come right next to permissions. Just add a space in between. Great job!
If you want some inspiration, have a look at https://replit.com/site/careers.
I believe they're running a docker container, which gives you the full bash experience!
I tried `curl` and `wget` before finding the `help` command. Kinda bummed out that tab completion doesn't work. And neither does `ls -la`. Also make it so I can click anywhere to get my cursor back on the right line for typing.
Cool idea, though I kept experiencing something akin to the uncanny valley, where it was "close enough" to a shell that it really bothered me that it didn't work as expected :)
Eg I immediately tried to use tab-completion (as have many others) only to land in the URL field. Then I tried to use "less" to read the file, only to have that not work. Finally had to look up the help.
I guess the UX lesson here is if you're going to emulate a really familiar interface, you have to do it fully or otherwise people's muscle memory is going to lead them astray.
It's really hard to use I would say. No completion, no history. You need to click directly over the input. It's nice exercise to create Terminal from scratch, but I don't understand why people don't use jQuery Terminal. Maybe they are afraid that it have jQuery in the name.
Here is advanced example that use real like commands with Pipe operator (from Bash). With figlet, lolcat and cowsay commands that can be mixed: https://codepen.io/jcubic/pen/vYLvvXx
I've done a similar thing few years ago. You can check it out at the bottom of the website at http://138.68.65.145/ (website is old and needs updating, same with the domain). I decided to print the output to the alert popup. I have `clear` and `exit` implemented, and going up/down the command history.
Awesome, did you get a chance to check out the out-of-the-box-thinkers at https://replit.com/site/careers?
The original application of the idea aS A full-fledged hiring shell.
That's pretty cool. I'm working on a text adventure and I end up creating a "shell" as well. One thing I did that I liked very much is auto complete and history. I think it would aggregate a lot to your website as well. Great job!
I love the idea, but there are a few UX issues which area rather annoying. One such issue is that the <input /> loses focus rather easily, like with as hitting the TAB key. The other thing which I find suboptimal is that the input does not get focus when I click on the "terminal".
If I use the shell, I expect to be able to type whenever the pane receives focus.
Another non-technical thing is that as a non-tech user I would be lost, since there's no indication of what to do on the page, a little hint in form of a MOTD would be a nice touch to round it up.
thanks for the suggestions! Yes, the input not focusing is very annoying and other people have also pointed it out in this thread. Will definitely fix that. Also agree about the second point, will probably display help first on load.
Hey love your site man,
I was actually surprised when I found out about your work.
Your company is building amazing product and I remember being interviewed as a user by your company.
Idea: implement history to log and show what the other users tried to do with the shell. It would also probably be a great way to get new feature ideas.
Love this idea. I’ve used a shell-like Hugo theme for my personal website, which at least preserves readability when JS is disabled. At this point, I wonder if you shouldn’t just plug a real shell to the website instead of faking one.
I don't understand why this has reached HN frontpage, sorry.
There are thousand of weird, demoscene, experimental sites and this one in particular is dull. Dull, dull, dull, dull, dull (as a monty python's reference)
I love these, put one together for my own site with some hidden features like a theme switcher. One suggestion I'd make on yours is focusing when clicking anywhere on the screen.
I've been waiting for Linux terminal emulators to have inline images, video and particularly GUI for certain programs. I've been thinking of writing this for years now.
I was also rather disappointed that when curling this "shell", nothing happens. Or rather, you just get the minified javascript just like it would give to your browser and using a shell to access this would-be-shell does absolutely nothing. And no tab complete, up arrow, and I see elsewhere in the thread that even ./ didn't use to work. It seems the author has very limited experience with shells and made an -- I would say 'elaborate' but it wasn't -- rick rolling page.
Come on, you cannot infer that the author has "very limited experience with shells" from an incomplete (early!) implementation. Read the rest of the thread anyway, you'll understand that you are mistaken very fast.
I agree that a fallback website when JS is disabled (with complete relevant content) would be good (progressive enhancement), with a hint that one may want to try enabling Javascript for fun.
hello yes sorry, './' and auto-completion don't work as of yet. The website is still early, I plan to implement most of the expected unix shell features soon.
Neat (if not that original) idea and side project, but I hope you know that not too many people will take the plunge to extract info out of something like this. About sites should be about easy showcases. This approach would be better for an online utility/tool.
hi thanks for the suggestion. I thought about this but decided against it as:
1. It's slower, I want to emulate the speed of running a shell in your local machine
2. I don't need all the nix shell features since it's a personal website. I can add features that only seem necessary for what I want to tell others about myself.
No command history, no tab completion. One assumes that "shell" is aspirational rather than descriptive. It's an interesting idea, but if you present what appears to be a shell interface to users expecting a shell interface, they're going to wander away pretty quickly after discovering it's merely facade. I wish you luck, but this isn't really ready for visitors yet.
It is totally ready for visitors. I visited, I enjoyed it. Doesn’t seem particularly wise to advise people something isn’t ready for people to visit, when those visitors are the only ones who can actually give useful feedback.
One hopes that the author didn't need me, a stranger, to tell them that this site is missing most of the fundamental features of a shell. Feedback is valuable, but strangers aren't going to visit something that clearly doesn't work a second time to see if they're making progress. There is a reason that early testing and feedback on prototypes is limited to in-house or pre-existing customer review. The author is entitled, and even encouraged, to ignore me--but my feedback is that they should have waited until they were closer to their goal and general feedback would be more valuable than hundreds of copies of "it doesn't work".
> but my feedback is that they should have waited until they were closer to their goal and general feedback would be more valuable than hundreds of copies of "it doesn't work".
This is the exact opposite of useful feedback. I hope you realise project that is literally intended for fun...
What definition of "shell" are you basing this on? Some (current) Unix systems I use have default shells that have neither command history nor tab completion.
Easy access to command history and tab completion are certainly niceties that came along at some point, but are in no way part of the definition of a shell.
ksh93 supports both completion and history. I lost interest in looking before uncovering information about versions of ksh more than thirty years old, but neither feature is mentioned in descriptions of differences between ksh93 and predecessors, so I suspect the feature has been there for longer. Posix compliance is neither necessary nor sufficient for a reasonable colloquial definition of "shell."
hi thanks for the input, yes it is very early and I just posted this mainly for validation; I wanted to know if only I thought this was cool or if others also saw it as something fun. I did not anticipate so many people using this. I plan to implement most of the expected shell features soon.
I think you’re being overly critical of someone’s hobby project. This isn’t an enterprise app. It’s a fun little thing they made and wanted to share with us. If this is how the community reacts to what is really barely a hobby project it doesn’t surprise me at all that devs are burnt out from supporting OSS projects that probably have 1000s of ppl like you that complain and expect the world for free.