Features

A POSIX-compliant shell with modern conveniences, written in Fortran by a single maintainer.

POSIX Compliance

3,776 tests passing

Comprehensive POSIX compliance test suite covering all shell requirements.

Full shell grammar

Pipes, redirections, command substitution, here-documents, and all standard syntax.

POSIX builtins

All required builtins: cd, echo, test, printf, read, export, and more.

Signal handling

Proper POSIX signal handling with trap support for EXIT, ERR, DEBUG, and standard signals.

Modern Interactive Features

Autosuggestions

Fish-like history-based suggestions appear as you type. Accept with Right Arrow.

Syntax highlighting

Real-time command validation with color-coded feedback. Green for valid, red for errors.

Fuzzy completion

Tab completion with fuzzy matching for commands, files, and variables.

Smart history

Persistent history with Ctrl+R search, deduplication, and expansion (!! !$ !^).

Abbreviations

Fish-style abbreviations that expand as you type. Define with abbr.

Directory navigation

Type a path and press Enter to cd. No cd command needed.

Bash Compatibility

~99% compatible

Most bash scripts run without modification. Tested against common patterns.

Arrays

Indexed arrays with arr=(a b c), ${arr[@]}, ${#arr[@]}, and slicing.

Associative arrays

declare -A for key-value storage with ${!assoc[@]} for keys.

Parameter expansion

Full expansion: ${var:-default}, ${var#pattern}, ${var//find/replace}, case conversion.

Process substitution

Advanced patterns with <(cmd) and >(cmd) using FIFOs.

Extended test

[[ ]] with regex matching (=~), pattern matching, and logical operators.

60+ Builtin Commands

Navigation

cd, pwd, pushd, popd, dirs, prevd, nextd, dirh

I/O

echo, printf, read, cat (via external)

Variables

export, declare, local, readonly, unset, printenv

Control

if/then/else, for, while, until, case, functions

Jobs

jobs, fg, bg, wait, kill, trap

Completion

complete, compgen for programmable completion

Unique to fortsh

Written in Fortran

70,000+ lines of Fortran 2018. Proving Fortran works for systems programming.

AST-based parsing

Modern parser architecture with proper grammar handling, not ad-hoc.

Memory profiling

Built-in memory command shows real-time allocation statistics.

Performance metrics

perf builtin for timing parse, expansion, and execution phases.

Known Limitations

fortsh is a single-maintainer project. These limitations are documented for transparency.

macOS Apple Silicon

127-character command line limit due to flang-new compiler limitations.

Nested brace expansion

Patterns like {a,{b,c}} are not supported.

Vi mode

Partial support. Yank/put and marks not implemented.

Performance

Slower than C shells on very large scripts. Fine for interactive use.

Screenshots

Coming soon: Terminal screenshots demonstrating key features.

[Syntax Highlighting]
[Autosuggestions]
[Tab Completion]

Ready to try fortsh?