Skip to content

A basic bash-like shell written in C++ with support for external commands, pipes, redirection and simple builtins.

License

Notifications You must be signed in to change notification settings

paavoto7/westshell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WestShell

WestShell is a hobby and learning project aimed at deepening my understanding of how shells work. I'm incrementally building it with more features over time.

Getting started

Requirements

  • C++17
  • Make

The project currently has no external dependencies beyond the C++ standard library and some parts of the C standard library. It uses unistd.h for system calls, so it requires a POSIX-compliant system.

Building

git clone https://github.com/paavoto7/westshell.git
cd westshell
make
./westshell

!! WestShell does not currently generate a settings file automatically. See instructions below.

Features

The project can currently run external programs with basic argument support. To exit the program, use the command exit, Ctrl+D or Ctrl+C (Press an enter after).

Currently supported operations are:

  • Piping ( | )
  • Forward redirection ( > )
  • Background jobs ( & )
    • Currently not working as expected

Builtins

Current builtin commands include:

  • cd
  • echo
  • history
  • hash
  • exit

Builtin commands can only take single argument as of now

Planned features

  • History navigation (with arrow keys)
  • Other redirection operations
  • Background processes (Currently doesn't work properly)

The code structure and organisation are very much subject to change. My primary goal is to first to implement the core functionality and refine from there.

Settings file

You can configure WestShell using a .westshell.ini file placed in your home directory. Each line should follow the format: key=value

  • No spaces are allowed around the = sign
  • he primary colour is set by primaryColour and secondary by secondaryColour.

Values must match the colour variable names specified in style.h.

Why C++?

While the program is largely procedural and could be written in C, I chose C++ because I enjoy the language and its many features over C. This project serves as a way for me to learn more about both shells and modern C++.

About

A basic bash-like shell written in C++ with support for external commands, pipes, redirection and simple builtins.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published