Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Nice start, Dustin ;-D#526

linuxontheweb started this conversation inShow and tell
Feb 2, 2025· 2 comments· 1 reply
Discussion options

Greetings,

I see you been working on your project for ~4 years. Since I've been working on mine roughly 3 times as long, I can divide the development process into 4 year chunks of beginning, middle and end phases.

The first 4 years were concerned with the "wow" factor of making things that seemed to be an "actual" system, i.e. doing a lot of things with the DOM and associated event listeners to enable stuff like draggable icons, windows and a fancy MacOS-like magnifiable toolbar.

In the middle phase, I began to get rid of all the unnecessary visuals in order to start the process of building a reliable underlying system. There was also plenty of time spent on fairly trivial "eye candy" demo applications involving the likes of THREE.js and ammo.js (port of Bullet physics). And there was quite a bit of time wasted on trying to integrate with Google App Engine's free python backend, to enable various (frivolous) P2P-type things.

So I began my final phase about the time you started on your project. I started reintroducing the desktop elements that you can now see inthe online version (mainly just a boring "Begin" button sitting on a boring taskbar), and I got rid of all back-end Google dependencies. The last couple of years, though, have really been spent doing nothing but getting the command-line interface up-to-par with the "true" *nix (Unix/Linux/POSIX) experience. Early last year, I got the machinery of my implementation of vim pretty close to the "real" vim that you get in "real" *nix distros (here's a blog entry about it from 2+ years ago). But the albatross hanging around my neck for god-only-knows-how-long had been the fact that my implementation of the Shell Command Language (aka bash, zsh, ksh, etc.) had always been terribly hacky, brittle and downrightugly. So the last four months of my life have been spent in the depths of my own personal hackathon for the purpose of getting it (nearly) 100% up-to-par withthe published spec (IEEE Std 1003.1, Chapter 2).

I find that the best motivation for demonstrating what my system is capable of is to give a demonstration for a kind of command that is very simple, but also seems somehow "wrong" (logically speaking), or at least very strange.

Take, for example, the command:

$ cat | less

Now, when "cat" is supplied with an argument, it is very easy to understand what is going on: simply output the contents of the given file in order to pipe it into the system's bi-directional pager, less.

Without any arguments, however, the cat command defaults to reading standard input from the physical console via the shell's interactive readline functionality. But hold on! With the "screen grabbing" less command in the pipeline, readline is going blind here. That is, whereas readline ismeant to be used much like we use typewriters -- when you press a character's key, you immediately see the associated character (usually ASCII 0x20-0x7E) "printed" in front of your eyes -- in the present case involving a "screen grabber", the characters are rather buffered offscreen until they "magically" appear on the pager's screen upon the pressing of the Enter key.

So I began working on the case ofcat | less within this past week, and I think I've come to a fairly good implementation. But there's something I'm leaving out here: how to terminate cat's inner readline loop, and then cleanly exit the pager's "screen grab", to return back to the normal command line loop. I'll leave that as an exercise for the reader! (Hint: it requires the use of the Control key)

Thanks for any feedback you might want to give!

You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

Very cool that you've been working on something that long. I hope to keep going with my project for the rest of my life ideally.

It sounds like you are taking the terminal quite serious which is good, Puter is doing something similar with the POSIX goal.

My Terminal can do some pipingfortune | cowsay | lolcat to make a poetic rainbow cow, but I don't have many advanced terminal commands and I doubt everything would work perfectly if I just started taking shell/batch scripts and running them.

I wish I had some feedback but I am not sure what I can add as you seem to be in a good place on your project. Good luck!

If you want to discuss specific things I am up to chat more about our projects.

You must be logged in to vote
0 replies
Comment options

Greetings Dustin & LOTW,

First of all, I want to express my deep gratitude and admiration for both of your projects, linuxontheweb and daedalOS (and AaronOS). Your work has been a tremendous inspiration for my own project,Stephan's OS, and both of you are mentioned as inspirations at the top of my README! Thanks to linuxontheweb, I discovered the Origin Private File System (OPFS), which has been crucial in implementing persistent client side storage in my web OS environment. This implementation ensures that all user data, including files and icon placements, persists across sessions without server-side dependencies, meaning data will remain private and inaccessible to others, including the developer.Which is the big idea 👍🏻

Understandably, my project aims to emulate an operating system environment within a browser, offering a unique and interactive user experience. I've been working on and off for 2 months, and while I have made significant progress in various aspects, such as window management, file system implementation, iframe browser, and real time system monitoring widgets, I am currently facing challenges with implementing a POSIX compliant shell.

I would like my shell to follow the Ubuntu/bash CLI and be POSIX compliant. I have set up a file system, but I am struggling with how to start implementing commands from scratch, especially those that involve parsing and manipulating files.

Given your extensive experience and the impressive work you have done with your own CLIs, I would greatly appreciate any guidance or advice you can provide on the following:

Command Parsing and Execution:

  • How did you approach command parsing and execution to ensure POSIX compliance?
  • What strategies did you use to handle complex command chaining, piping, and I/O redirection, such ascat | less?

User Input Handling:

  • How did you implement interactive commands that require user input, likecat without arguments?
  • Any tips on managing buffering and display for commands that modify the display, such asless orvim?

Execution Environment:

  • How did you ensure that executing commands within your terminal does not compromise the security of the user's environment (e.g., protecting against reflected or stored XSS)?
  • What methods did you use to manage resources and avoid performance bottlenecks, particularly for resource-intensive commands?
  • What are the benefits of sandboxing in this context?

Integrating Utilities:

  • Did you build essential utilities (e.g.,cat,grep,find) natively, or did you integrate existing JavaScript-based implementations?
  • Any recommendations on libraries or frameworks that could facilitate this process?

Your insights and experiences would be incredibly valuable to me as I strive to enhance the functionality and authenticity of Stephan's OS. Thank you for your time and for the inspiration your projects have provided. Any words would be much appreciated, you guys are so talented & I hope to reach your level one day!

Here's a preview of what it's looking like so far :)
Snapshot

Best regards,
Stephan

You must be logged in to vote
1 reply
@DustinBrett
Comment options

Thanks for the long and detailed question. Sorry it's taken me so long to respond.

I hope you are doing well with your project.

For my terminal I used xterm.js and various plugins which I customized in some cases such ashttps://github.com/wavesoft/local-echo which is a controller for xterm that does some of what you are asking.

I did a custom piping strategy, I think it was some kind of recursion but I don't even recall tbh.

The commands could cause issues with daedalOS, but a refresh would likely solve them.

If you have more specific questions maybe list them here in shorter form and I can try and do rapid fire.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
None yet
3 participants
@linuxontheweb@DustinBrett@StephanVolynets

[8]ページ先頭

©2009-2025 Movatter.jp