Built a Unix Shell in Pure C with Raw Terminal Editing and Trie Autocomplete
Built a Unix shell in pure C with raw terminal input, trie-based autocomplete, pipes, redirection, background jobs, command history, and ghost-text suggestions.
One of the hardest parts was handling cursor movement and live terminal redraws correctly using termios raw mode and ANSI escape sequences. I also built a trie-based autocomplete system that loads commands from PATH and ranks suggestions based on command frequency instead of just returning the first match.
I started this project mainly to learn Unix commands and understand how shells actually work internally. What began as a small shell prototype slowly turned into something surprisingly usable. Building it taught me a lot more about Unix, processes, terminal behavior, signals, and systems programming than tutorials alone.
Currently working on:
- local AI integration
- command suggestions
- error explanations
- natural language → shell commands
GUI support is planned later, but for now I’m focused on making the terminal experience solid first.
I’d genuinely appreciate feedback, advice, or suggestions from people more experienced with systems programming and shell design. Even if the project feels basic compared to production shells, it has been a huge learning curve for me and I want to keep improving it.