A lightweight, feature-rich shell implementation with advanced process management capabilities.
SimpleShell is a modern, POSIX-compliant shell designed for both usability and extensibility. Built with C++, it offers a robust alternative to traditional shells with enhanced process management, customizable prompts, and intuitive job control.
- Foreground & Background Execution: Run commands in the foreground or background with the
&operator - Job Control: Pause running processes with Ctrl+Z and resume them with
fgorbgcommands - Process Tracking: Comprehensive tracking of all running and stopped processes
- Customizable Prompt: Personalize your shell experience with color-coded, dynamic prompts
- Command History: Navigate through previous commands with built-in history support
- Tab Completion: Efficiently complete commands and file paths with tab completion
- INI Configuration: Easily customize shell behavior through simple configuration files
- Environment Variables: Set and manage environment variables with intuitive syntax
- Aliases: Create shortcuts for frequently used commands
- Graceful Interruption: Properly handles Ctrl+C (SIGINT) and Ctrl+Z (SIGTSTP)
- Child Process Management: Automatically cleans up zombie processes
- C++ compiler with C++20 support
- POSIX-compliant operating system (Linux, macOS, etc.)
- GNU Readline library
git clone https://github.com/fszontagh/simpleshell.git
cd simpleshell
mkdir build && cd build
cmake ..
make
Send command to Terminal
./simpleshell
$ reload_config
Send command to Terminal
$ ls -la
$ echo "Hello, world!"
$ cd ~/Documents
$ sleep 30 &
Running in background: sleep 30 &
Process 123456 running in background.
$ sleep 60
^Z
$ jobs
Background jobs: 1
[1] PID: 123455 started: 2025-04-19 11:56:45.123
status: running, Command: sleep 30
Stopped jobs: 1
[1] PID: 123456 started: 2025-04-19 11:57:00.456
status: stopped, Command: sleep 60
$ bg
Continuing process 123456
Process 123456 completed.
$ fg 123457
Bringing job 123457 to foreground
# In ~/.pshell configuration
[shell]
prompt_format = "${COLOR_GREEN}[${PWD}]${COLOR_RESET}$ "
[shell]
prompt_format = "${COLOR_RED}${USER}${COLOR_RESET}@${COLOR_GREEN}${HOSTNAME}${COLOR_RESET} [${PWD}]${SHELL_PROMPT} "
[environment]
HOSTNAME=`hostname`
[variables]
SHELL_PROMPT="$"
[aliases]
ls= "ls -ltrh --color=auto"
ll= "ls -ltr --color=auto"
l= "ls -ltrh --color=auto"SimpleShell is built with a modular architecture:
- SimpleShell: Core shell functionality, command parsing, and execution
- ProcessManager: Handles process creation, tracking, and signal management
- Configuration: Manages user preferences and environment settings
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by traditional UNIX shells like Bash and Zsh
- Built with modern C++ practices for reliability and performance
"SimpleShell: The power of a full-featured shell with the simplicity you deserve."