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.
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'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.
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.
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.
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?
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.
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.
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
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!
174 comments
[ 2.4 ms ] story [ 192 ms ] threadThe 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.
Expected behaviour from *nix would be that you'd either
Or Of course the extension is not technically required, but it would help in the UX for the user to try running it on the sh command.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.
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.
Browser is the new cool!
auto-complete doesn't work also (<tab>)
[1] https://tbfleming.github.io/em-shell/
[1] JS/UIX (2003) https://www.masswerk.at/jsuix/
In the code that handles the long form of ls, I'd suggest ensuring spaces between "file perms" and "file names": Safari gloms them together.
Not sure why "sh" is needed to "run" things, since items are encoded as objects: Why not for...in and if not found "command not found"?
I'd wager you could actually put a real linux shell in your website with that!
Code: https://github.com/zenithdb/zenith.tech