Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FomaShell

License: FPL Build & CI Go Version Platform IDE

A modern, lightweight, cross-platform, and highly optimized shell developed by FomaDev.

Author: MOLENGO MALANDA FORDI (FomaDev)


Overview

FomaShell is a modern shell designed to provide a fast, responsive, and streamlined command-line environment. It operates as a fully standalone shell while also serving as a highly optimized default terminal for the C Studio Code (CSCode) IDE.

It natively addresses common issues found in traditional terminals on Windows and Unix systems, including transparent UTF-8 encoding, dynamic compiler toolchain isolation (PATH isolation), transparent pipeline execution, signal handling (Ctrl+C), and dedicated C/C++ development commands (foma check, foma build, foma info).


Key Features

  • Native UTF-8 and 24-bit ANSI Support: Automatic configuration of the Windows terminal (SetConsoleOutputCP(65001) and ENABLE_VIRTUAL_TERMINAL_PROCESSING) for reliable rendering of Unicode characters, symbols, and colors.
  • Dynamic PATH Management (PATH Isolation): Dynamically prepends the compiler toolchain (for example, C:/tools/w64devkit/bin or MinGW/bin) to the process PATH without modifying the operating system's global environment variables.
  • Dedicated foma Commands:
    • foma check: Comprehensive diagnostics for installed compilers and tools (gcc, g++, clang, make, cmake, ninja, gdb, git).
    • foma build [file.c|file.cpp]: Intelligent detection and fast compilation of C/C++ source files with optimized flags (-Wall, -Wextra, -O2).
    • foma info: Details about the FomaDev runtime environment, CSCode integration status, and FPL license terms.
  • Full System Transparency: Complete support for pipelines (cmd1 | cmd2), input/output redirection (<, >, >>), and forwarding Ctrl+C signals without closing the shell session.
  • Git-Aware Prompt: Displays the FomaDev badge, the current directory (using the ~ shortcut), the active Git branch, a modification indicator (*), and the dynamic λ symbol.

Source Code Structure

fomashell/
├── cmd/
│   └── fomashell/
│       └── main.go       # Main entry point (CLI, REPL, flags)
├── internal/
│   ├── builtins/        # Built-in commands (cd, exit, foma check, build, info)
│   ├── config/          # Configuration, PATH isolation, and Windows UTF-8
│   ├── executor/        # System execution, pipelines (|), and redirection (<, >)
│   └── prompt/          # Prompt formatter and Git status
├── go.mod               # Go module definition
├── LICENSE              # FomaDev Public License (FPL)
└── README.md            # Documentation and CSCode integration

Installation and Build

Prerequisites

  • Go 1.21+
  • A C/C++ compiler (GCC, Clang, or w64devkit) is recommended for the build features.

Build the Project

# Clone the repository
git clone https://github.com/fomadev/fomashell.git
cd fomashell

# Build the executable
go build -o fomashell.exe ./cmd/fomashell

Run the Executable

./fomashell.exe

Usage

Command-Line Options

Usage:
  fomashell [options]

Options:
  -compiler, -cpath <path>  Inject and isolate compiler path at the head of PATH
  -command, -c <cmd>        Execute command string non-interactively and exit
  -no-banner                Suppress welcome banner
  -v, --version             Display version information
  -h, --help                Display help message

Command Examples

1. Check the Compiler Toolchain

foma check

2. Build a C or C++ File

foma build main.c
foma build app.cpp -o myapp.exe

3. Display Metadata and License Information

foma info

4. Pipelines and Redirection

echo "Hello from FomaShell" | findstr "Hello"
dir > listing.txt

C Studio Code (CSCode) Integration

To make FomaShell the default terminal for the C Studio Code (CSCode) IDE:

settings.json Configuration (CSCode)

Add the following configuration to the IDE's settings file:

{
  "terminal.integrated.defaultProfile.windows": "FomaShell",
  "terminal.integrated.profiles.windows": {
    "FomaShell": {
      "path": "C:\\path\\to\\fomashell.exe",
      "args": [
        "-compiler", "C:\\tools\\w64devkit\\bin"
      ],
      "icon": "terminal-powershell",
      "env": {
        "CSCODE_ACTIVE": "1"
      }
    }
  },
  "terminal.integrated.defaultProfile.linux": "FomaShell",
  "terminal.integrated.profiles.linux": {
    "FomaShell": {
      "path": "/usr/local/bin/fomashell",
      "args": ["-compiler", "/usr/bin"]
    }
  }
}

Project License

This project is distributed under the FomaDev Public License (FPL).

FomaDev Public License (FPL)
Copyright (c) 2026 FomaDev (MOLENGO MALANDA FORDI). All rights reserved.

1. Personal and Educational Use: Free for developers, students, and CSCode integration.
2. Contributions: Forks are permitted only for contributing to the official project through a pull request.
3. Commercial Use (PAID): A paid license is required for resale, redistribution, or competing derivative tools.
4. Contact: MOLENGO MALANDA FORDI (FomaDev).

See LICENSE for the complete legal text.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages