Skip to main content

Bundled TUI Code Editor

STABLE(Native cross-platform terminal editor built with Rust, Ratatui, Crossterm, and Tokio)

AdeshLang includes a lightning-fast, full-featured Terminal User Interface (TUI) Code Editor built directly into the toolchain. It provides a complete IDE experience directly inside your terminal with sub-5ms cold startup, zero graphical dependencies, and a memory footprint under 15 MB.

Looking for the Browser Version?

If you want an in-browser code editor without running a local terminal, check out the Online Web IDE (editor.adeshlang.org) which executes 100% in WebAssembly with Monaco editor and live diagnostics.

┌─ [File] [Edit] [View] [Run] [Info] ───────────────────────────────────────────────┐
│ 📁 EXPLORER │ main.adesh* ✕ │ math.adesh ✕ │
│ ▾ src/ │ 1 │ import { println } from "std:io"; │
│ ▸ net/ │ 2 │ import { JITCompiler } from "std:jit"; │
│ • app.adesh │ 3 │ │
│ • main.adesh │ 4 │ fn main(): int { │
│ ▾ tests/ │ 5 │ let numbers = [10, 20, 30, 40]; │
│ • jit_test │ 6 │ let total = numbers.reduce(fn(a, b) => a + b, 0); │
│ │ 7 │ println("Total: {total}"); │
│ │ 8 │ return 0; │
│ │ 9 │ } │
├────────────────┴─────────────────────────────────────────────────────────────────┤
│ ⚡ RUNNER [Cranelift JIT] — Status: Success (exit 0) — Execution time: 1.42ms │
│ Total: 100 │
├──────────────────────────────────────────────────────────────────────────────────┤
│ NORMAL │ UTF-8 │ AdeshLang │ Ln 6, Col 24 │ Backend: Native JIT │ F5: Run │ Ctrl+P│
└──────────────────────────────────────────────────────────────────────────────────┘

Quick Launch

Launch the bundled editor using either the adesh editor subcommand or the standalone adesh-editor binary:

# Open editor in the current directory with workspace file explorer
adesh editor .

# Open a specific file
adesh editor src/main.adesh

# Open multiple files into separate buffer tabs
adesh editor src/main.adesh src/lib.adesh tests/bench.adesh

# Open directly with a specific execution backend
adesh editor --backend jit-native main.adesh

Architectural Highlights

  • Native Rust Engine: Built on top of ratatui (v0.26), crossterm (v0.27), and tokio multi-threaded asynchronous runtime.
  • ALS Language Server Protocol: Embedded real-time diagnostics, type hover tooltips, code completion, and document formatting.
  • Multi-Buffer Tab Bar: Seamlessly switch between open files, split views, and scratch buffers.
  • Built-in Execution Runner: Execute your code directly within the editor using the Interpreter, Bytecode VM, Cranelift Native JIT, or Native AOT linker.
  • Interactive Terminal & Output Panel: Test CLI commands and view live streaming execution output without leaving the editor.
  • Fuzzy Command Palette: Quick access to all actions, files, themes, and configuration commands.
  • Hybrid Input System: Supports both modern desktop shortcuts (Ctrl+S, Ctrl+P, Ctrl+F) and classic modal navigation (Normal, Insert, Visual, Command-Line).
  • Mouse & Trackpad Support: Click to position cursor, select text by dragging, switch tabs, scroll with mouse wheel, and click top-bar menus.

User Interface Layout

┌─────────────────────────────────────────────────────────────┐
│ 1. Menu Bar (Alt+F, Alt+E, Alt+V, Alt+R, Alt+I) │
├──────────────┬──────────────────────────────────────────────┤
│ │ 2. Buffer Tabs Bar (Ctrl+Tab, Alt+1..9) │
│ ├──────────────────────────────────────────────┤
│ 3. File Tree │ │
│ Explorer │ 4. Code Editor Pane │
│ (Ctrl+E) │ • Syntax highlighting │
│ │ • Line numbers (absolute/relative) │
│ │ • Diagnostic error/warning gutter markers │
│ │ │
├──────────────┴──────────────────────────────────────────────┤
│ 5. Execution Runner / Interactive Terminal Drawer (Ctrl+`, Ctrl+J) │
├─────────────────────────────────────────────────────────────┤
│ 6. Status Bar (Mode, Position, Backend, Git, Diagnostics) │
└─────────────────────────────────────────────────────────────┘

Editing Modes

The editor features a familiar modal architecture with intuitive transitions:

ModeTriggerDescription
Normal ModeEscRapid navigation, buffer manipulation, code jumping, and command execution.
Insert Modei, a, o, I, AStandard text entry with auto-closing brackets, smart indent, and autocomplete popups.
Visual Modev (char) / V (line)Text block selection for copying, cutting, formatting, and indentation shifts.
Command-Line Mode:Ex-style command prompt for :w, :q, :theme, :backend, and settings.
Terminal ModeCtrl+JDirect focus on the embedded interactive terminal emulator.

Comprehensive Keybinding Reference

Global & File Operations

ShortcutActionDescription
Ctrl+PCommand PaletteOpen fuzzy command & action palette.
Ctrl+OOpen FileOpen file prompt with fuzzy path autocomplete.
Ctrl+SSave BufferWrite current buffer to disk.
Ctrl+WClose BufferClose active buffer tab (prompts if unsaved).
Ctrl+QQuit EditorExit editor safely.
Ctrl+TabNext TabCycle to the next open buffer tab.
Alt+1..9Jump to TabDirect switch to buffer tab by number.
Ctrl+EToggle ExplorerShow/hide workspace file tree sidebar.

ShortcutActionDescription
Ctrl+FFind in FileIncremental search with live highlight.
Ctrl+HFind & ReplaceSearch and replace single or all matches.
Ctrl+Shift+FWorkspace GrepGlobal regex search across all project files.
Ctrl+GGo to LineJump directly to line number or line:column.
n / NNext / Prev MatchJump between search occurrences in Normal mode.
gd / F12Go to DefinitionJump to symbol declaration via ALS language server.

Editing & Formatting

ShortcutActionDescription
Ctrl+Z / uUndoUndo last edit action.
Ctrl+Y / Ctrl+RRedoRedo previously undone action.
Ctrl+/Toggle CommentToggle line or block comments (// or /* */).
Ctrl+DDuplicate LineDuplicate current line or selected block.
Ctrl+K, FFormat CodeAuto-format current buffer using AdeshLang formatter.
Tab / Shift+TabIndent / OutdentShift line or visual selection by tab width.

Execution & Running

ShortcutActionDescription
F5Run ProgramExecute active file with current backend.
Ctrl+F5Run with BackendChoose execution backend (JIT, VM, Interpreter, AOT) and run.
F6Stop ExecutionTerminate currently running process/runner.
Ctrl+`Toggle Output DrawerOpen/collapse the bottom execution output log.
Ctrl+JToggle Interactive TerminalFocus interactive terminal shell.

Command-Line (:) Reference

Press : in Normal mode to open the command prompt:

CommandArgumentsDescription
:w[filename]Save current file (optionally with new name).
:qQuit active buffer / exit if last buffer.
:wq, :xSave and quit.
:q!Force quit discarding unsaved modifications.
:e <path><filepath>Open file at specified relative or absolute path.
:theme <name>emerald, dracula, monokai, nord, github-darkChange color theme instantly.
:backend <name>interpreter, vm, jit, native, aotSet default execution backend.
:set <option>wrap, nowrap, relativenumber, number, tabsize=4Toggle editor configuration options.
:formatFormat current document.
:goto <num><line_number>Jump to specific line.
:grep <query><pattern>Search workspace files for string pattern.

ALS (Language Server) Integration

The bundled editor connects seamlessly with the Adesh Language Server (ALS) to provide real-time IDE intelligence:

  1. Inline Diagnostics: Syntax errors and borrow-checker violations appear with underlined squigglies and status indicators in the gutter.
  2. Contextual Completion: Typing identifiers, object dots (.), or import paths opens an autocomplete dropdown with docstrings and type signatures.
  3. Type Hovers: Pressing K over any token in Normal mode displays its type signature and documentation.
  4. Auto-Format on Save: Automatically standardizes indentation, spacing, and bracket placement whenever a buffer is saved.

Configuration (editor.toml)

Customize your editor preferences by creating or editing ~/.adesh/editor.toml (Windows: %USERPROFILE%\.adesh\editor.toml):

# AdeshLang TUI Editor Configuration
# Location: ~/.adesh/editor.toml

[editor]
theme = "emerald-dark" # Options: "emerald-dark", "dracula", "monokai", "nord", "github-dark", "github-light"
tab_size = 4 # Number of spaces per tab
insert_spaces = true # Convert tabs to spaces
word_wrap = false # Enable word wrapping
line_numbers = "absolute" # Options: "absolute", "relative", "none"
highlight_current_line = true # Highlight active cursor line
auto_close_brackets = true # Auto-insert closing brackets and quotes
format_on_save = true # Format document on Ctrl+S

[runner]
default_backend = "jit-native"# Options: "interpreter", "bytecode-vm", "jit-native", "aot"
auto_open_output = true # Automatically open output drawer on execution
timeout_seconds = 15 # Watchdog execution timeout

[lsp]
enabled = true # Enable ALS language server integration
show_diagnostics = true # Show gutter error/warning markers
hover_tooltips = true # Enable hover inspection

[explorer]
show_hidden_files = false # Show dotfiles (.git, .env, etc.)
default_width = 28 # Explorer sidebar width in columns

Available Color Themes

Theme NameStyle / PaletteBest For
emerald-dark (default)Deep obsidian background (#0B0F19) with vibrant emerald green (#10B981) and cyan accents.Official AdeshLang brand experience.
draculaClassic dark purple/violet palette with pink and yellow highlights.Low-light coding environments.
monokaiHigh-contrast dark charcoal with green, yellow, and magenta tones.Maximum token contrast.
nordCalming arctic blue and frosted slate palette.Minimalist, soothing aesthetic.
github-darkStandard GitHub dark mode palette with crisp blue and orange tokens.Consistency with web workflows.
github-lightClean light paper background with sharp syntax coloring.Bright ambient environments.

Troubleshooting & Tips

  • Terminal Mouse Clicking: If your terminal supports mouse events (Windows Terminal, iTerm2, Alacritty, Kitty, WezTerm), you can click tabs, scroll, select text, and click top-bar menus directly with your mouse.
  • Fast Exit: In any mode, pressing Ctrl+Q safely exits the editor.
  • Diagnostics Inspection: Place the cursor over a marked line to read the exact compiler error and recommended fix in the status line.
  • Backend Switching: Press Ctrl+F5 to benchmark and compare execution speeds across backends on the fly.