Welcome to the Custom Shell project! This project implements a custom shell with autocompletion and a modern user interface using PyQt5. The shell supports both built-in commands and external executables, along with many advanced features to enhance user productivity.
- Built-in Commands: Supports common shell commands like
cd
,pwd
,echo
,type
, andclear
. - External Command Execution: Automatically detects and executes external executables from the user's PATH.
- Autocompletion: Offers command and path autocompletion using a Trie-based algorithm.
- Environment Variable Support: Set and export environment variables using the
set
andexport
commands. - Command History and Search:
- Maintains command history across sessions.
- Navigate previous commands using the Up/Down arrow keys.
- Search through history with Ctrl+R.
- File Redirection: Supports output and error redirection using operators such as
>
,1>
,2>
,>>
, and2>>
. - Relative Path Handling: Seamlessly manages relative paths (e.g.,
./
,../
,~
,~/
). - Syntax Highlighting: Provides syntax highlighting for commands, paths, strings, and error messages.
- Directory Preview on Autocomplete: When a directory is uniquely completed, displays a preview of its contents.
- Modern UI & Customization:
- Built with PyQt5 for a sleek, modern look.
- Customize the interface by changing the font and text color.
- Switch between Dark and Light themes for optimal viewing.
- Python 3.x
- Pipenv
- PyQt5
-
Clone the repository:
git clone https://github.com/Emir2099/ShellPy.git cd ShellPy
-
Install dependencies:
pipenv install
-
Running the Shell: To run the shell locally, use the following command:
python main.py
-
Usage: Once the shell is running, you can use it like a regular shell. Here are some examples of supported commands:
Change Directory:
$ cd /path/to/directory
Print Working Directory:
$ pwd
Echo Text:
$ echo "Hello, World!"
Clear Screen:
$ clear
Type Command:
$ type echo
Set and Export Environment Variables:
$ set VAR value $ export VAR
Command Redirection:
$ echo "Hello, World!" > output.txt
History Search
Ctrl + R
-
Customization: You can customize the shell's appearance through the settings menu:
Change Font: Select "Settings" > "Change Font" to choose a different font. Change Color: Select "Settings" > "Change Color" to choose a different text color. Themes: Switch between Dark and Light themes from the "Themes" menu.