Skip to content
/ dvlsh Public

Dievilz Shell - Inspired by Zsh, but improved from the ground up with a modern UX focus and POSIX + Ksh compliance - Written in Zig⚡️

License

Notifications You must be signed in to change notification settings

dievilz/dvlsh

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

dvlsh - Dievilz Shell

🧭 Core Philosophy

Grug like Unix philosophy, Grug want to spread it so world be better place, Grug remain hopeful.

  • POSIX-compliant, Ksh-compatible shell
  • Written entirely in Zig ⚡️, with modules designed to be cleanly testable and maintainable
  • Clear separation between core shell, plugins, CLI, configuration, and runtime state
  • Support for several config file formats, may end up just supporting one lol
  • Built-in plugin API so if a feature is wanted, it can be added quickly.
  • Emphasis on interactive shell UX: modern prompt, autosuggestions, syntax highlighting, and more
  • Always ready for customization. New prompt? Just type :reload-prompt... New session behavior? Just type :reload-config
  • Live session monitoring on demand. No more subshells for debugging/tracing
  • No fallback or automatic behaviors: user must opt-in explicitly to advanced features

🧱 Architecture Draft

src/
├── main.zig
├── shell/            → Shell lifecycle, executor, session, job control
├── input/            → Editor, keymaps, autosuggest, history
├── output/           → Prompt, themes, ANSI control
├── parser/           → Lexer, parser, AST
├── builtins/         → cd, set, trace, jobs, etc.
├── config/           → Loader, schema, registry, multiple format support
│   └── format/       → zigrc.zig, gitstyle.zig
├── core/             → Env, vars, shellcontext, hooks
├── posix/            → Signal handling, redirection, fds
├── util/             → str.zig, io.zig, fs.zig
├── plugins/          → registry.zig, api.zig
└── test/             → Unit + integration tests

🔩 Config System

  • Supports multiple formats: Zig DSL, JSON, Git-style
  • Provenance tracking: every config entry tagged with source (default, user, plugin)
  • Reloading must be explicitly triggered by user (:reload-config) — no live file-watching.

🧠 Script & Function Layer

  • POSIX scripting is the only supported script language for now
  • POSIX scripts can use shell-defined functions
  • No separation between POSIX and non-POSIX behavior for now — design must remain coherent.

⚠️ Error Handling & Diagnostics

  • POSIX set options supported: -e, -u, -x
  • Add :trace command for live session tracing
  • Errors should clearly display filename and context
  • Tracing should be enabled on demand, not just at shell startup.

🔌 Plugin System

  • Users do not need to write Zig for plugins — secondary language planned (TBD)
  • Plugins may override or extend default behavior
  • Features baked into shell but overridable:
    1. Prompt customization
    2. Syntax highlighting
    3. Autosuggestions
    4. History substring completion
    5. Command completion support and more.

💡 UX Innovations

Fixed Prompt Zone / Transient Prompt

  • Prompt is always rendered at the bottom of the terminal
  • Older prompts remain in scrollback with different visuals
  • Prompt redraws cleanly (not reflows) on window resize* (May just leave it to Ghostty?)
  • Prompt zone and buffer zone are clearly separated
  • Feature must be explicitly enabled — no automatic fallback in tmux or multiplexers

🔎 Traceability & Live Monitoring

  • dvlsh will expose internal shell state (env, config, vars, history, trace logs)
  • Users can inspect this live during a session or via external tools (e.g. Ghostty Inspector)
  • Mechanism:
    • UNIX domain socket-based stream (initial)
    • Optional: Plan 9-style virtual FS (e.g. /tmp/dvlsh-inspect/config/PATH)
    • Future: experimental 9P protocol interface

✅ Confirmed Milestones Implemented


Author's note

This is a POC so I can learn Zig and systems programming, sounds like the ultimate learning project at that but I can accept the challenge 😅.

About

Dievilz Shell - Inspired by Zsh, but improved from the ground up with a modern UX focus and POSIX + Ksh compliance - Written in Zig⚡️

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published