Orbit
- 14 Devlogs
- 20 Total hours
Alpha version (α) A simple, modular, and interactive Linux shell written in C, with command history, aliases, and the use of wrappers for system command executions
Alpha version (α) A simple, modular, and interactive Linux shell written in C, with command history, aliases, and the use of wrappers for system command executions
I was here thinking about whether to continue developing something more complete/add more features here. It just so happens I was working on other projects and liked them, so I kind of set Orbit aside. Actually, every now and then I would come here (I mean to its directory) and test things, skim through the code to think of more stuff, you know. I’d run the program and that was pretty much it.
Then I was testing some parts and features of the language related to the course. And since before fully developing the project I studied, checked out, and learned certain things here, I came back and did the same. I even turned off Wakatime since it wasn’t really for the project, but after messing with the others I’d turn it back on and that was that. So yeah, here I am and I tinkered with the project a bit more in the parts I got feedback on. I forgot to translate the version I’d be showing for the demo into English, now I did, I was thinking of leaving the binary and executable program multiplatform and I also went after that.
Anyway, there’s already a release with it for Linux, macOS, and Windows. In that and in the translation, I used Antigravity. Now the project is more organized.
Now the aliases you create stay saved and don’t get lost when you close that session. I also tweaked things with the voters’ feedback to make it look more professional and like how bash really is. Creating a process and running things withexecvp()(the other one isfork()) or it already kind of gave the clue on how to do it.
I’m done for now. I spent time writing the README and fixing a few things in the code, as well as resolving an issue syncing the Git repository—specifically, a discrepancy between the remote and local versions. I also deleted the binary that had been uploaded there by mistake :|
On top of that, I created this architecture diagram right in Canva. That’s basically it; now I’m going to ship the Alpha version.
Massive session in the last days. Honestly, the past few days have been a heavy grind balancing school work and academic study. Between reviewing some Python automation scripts and touching up minor EDA/hardware schematic concepts, I had to take a step back and deeply review C fundamentals. I spent a good chunk of time writing tests to push the limits of basic features, function definitions, and pointer scopes that the language offers.
All this testing made it obvious that the old monolithic, single-file structure was hitting a wall. To scale Orbit properly into the Alpha phase (vα), I executed a complete architectural overhaul, breaking the codebase down from 1 single file into 5 highly modular files, all cleanly decoupled and tied together using structured header files (.h) and a dedicated Makefile.
Key implementations finalized in this block:
Refactoring the main execution loop with M365 Copilot. Moving away from the messy string comparisons and building a cleaner internal structure for command handling. Spent time debugging memory allocations and ensuring tokens from strtok don’t leak between cycles.
Implemented a dynamic dispatch system using an array of structures and function pointers. Replaced the entire nested if/else chain inside main with a clean lookup table. Commands like echo, sum, and run are now isolated functions mapped to their respective triggers. Much easier to extend now.
It was supposed to be working here. Now the CLI has the repeat command that takes the number 'n', which is the parameter the user puts in, and looks in history.txt for which 'n' command should be executed and repeats it.
I realized that adding history using the ↑↓ (keyboard arrows) would be more complicated and could, not break/bug, but slow me down in what I was doing and testing.
Today I finished implementing the cd command. Now I can change directories within the project terminal. The process is to run run ls and then use cd. In this case, I left it without the run command, just using cd directly.
I started making the directory changes. Actually, I spent more time testing and thinking about what to do and running tests. I didn’t even get the idea to be able to see/repeat the last commands like ↑↓ that are in normal terminals. I haven’t done that many upgrades, but I’ve studied and am still developing the idea
Continuing here, I was working and studying (Chemical Kinetics :\ ) with the M365 Copilot and it said something like: why not put an enumerator of the commands in the history?
I thought it was a good idea and that’s what I went looking for. I had to change, replace, you know, the part where I saw the commands to keep doing a ++ for the counter. But when it worked (compiled and had changed to this new logic) it ended up, for some reason, printing 35949 commands in memory!. Basically some kind of memory flow or something like that related to the command that calls the system (run). I have to see why this happened…
So, here I put something REALLY COOL: executing system commands in the terminal inside the terminal -\°°/-. It’s kind of funny, but like, I can run ls, cat, date, pwd, etc.
I thought it would take longer, but it didn’t. I just needed to pass the tokens, concatenate the command setting the `run’ as the one that connects the app to the system terminal.
It turned out I was doing some C things for the course and I was already testing this… And I used M365 Copilot to help me. Well, I already use it to reinforce the content of the classes, lessons, learn some things and also to debug my code, exercises/lists that the teachers gave. So I kind of just continued where I was.
That’s a cool thing… I added a command to clear the history, which in this case is clear_history.
It’s a simple thing, but it improves the app’s usability. That’s pretty much it.
Basically, I added a very simple history file to the app, like a .bash_history. But in this case, I’m using a history.txt file. It opens and writes exactly everything typed in the terminal, skipping a line.
Man, messing with/manipulating files here is quite difficult… using * for pointers and dereferencing confused me a bit. Sometimes I forgot it and it gave me errors. The good part is that my own editor recommended clangd. Actually, I don’t know exactly what it is, but it seems like a lintter and automatic pre-compiler. It’s helping me…
One thing I miss is being able to attach more than one media file. At least I had the
copy and pasteimage option, and it didn’t work.
Hello. I started this project. Actually, I had thought of something different, and that’s why it has this name “Orbit”. But now that I’ve decided to do this, I’ll change the name later.
Basically, I’m starting out in C (really learning it right now), and since I’m a beginner and I got my first laptop, which is Linux (because I didn’t want to pay for a Windows license/I don’t have anything tying me to it, considering this is my first machine), and since I’m in this Dev and Builder life and C is the basis of many things and OSs…
So I decided to do something along the lines of Unix/Linux. I thought, “nothing better than playing with the Terminal for this,” so I started with this simple version here. Which:
echo command (to print) and sum (to sum)Uses strtok (which I’m learning) to manipulate strings and the
tokensfor what they call them. I think that’s it :p