- Build a terminal-first editor workspace with split panes, tabs, and multiple viewers (code, hex, image) selected by MIME.
- Keep the renderer/input loop robust: raw mode, mouse resize/drag, focus handoff, and low-flicker double-buffered drawing.
- Maintain modularity: rendering, buffers (text/byte), MIME detection, grammars, and viewers evolve independently, with shared style helpers on renderer/style set.
- Split view: left vertical tabs (Files/Project/Git/About/Settings/Help), right viewer chosen by MIME (text → code editor, image → ASCII/Braille image viewer, else hex viewer). Splitter is mouse-draggable.
- Status line: bottom row shows FPS, used memory (MB), and CPU% while leaving the rest of the canvas for the app surface.
- Startup: shows a centered splash dialog with shortcut reminders and a "Press Enter to begin" prompt while the initial project scan reports progress on the bottom line.
- File tree uses [+]/[-]/[=] icons, expands/collapses, and opens files in the right viewer; focus follows click for correct input routing.
- Code editor: guttered view, full mouse/keyboard navigation (select, word-jump, page up/down), cursor/selection rendering, and focus-aware input. Undo/Redo via
Alt+U/Alt+R(redo stack clears on new edits). - Code shape preview: Braille minimap on the right edge of the editor, centered on the cursor line; click in it to jump the editor viewport.
- Code intelligence (current): background regex scanning indexes declarations/usages per file and across the workspace; declarations render blue + bold, usages render blue + italic underline, with debounced version-gated updates to avoid stalls while typing. Ctrl-click jumps to definitions and shows a usage popup; ctrl+Space opens suggestions (workspace symbols + locals) near the cursor. Definitions/usages/suggestions come from an external
codeintel/definitions.jsonshipped alongside the jar; per-language block modes (brace/indent/paren/regex/sql) guide scanning. LSP integration is planned; the Settings panel already lists a catalog (lsp/servers.json) and can download/install servers intolsp/next to the jar. - Project state: Kode writes
.kode.jsonin the project root (debounced ~3s) to persist recent files and open editor state (cursor/selection/scroll, unsaved buffer text, undo/redo history, grammar/lang, mtime guard). On startup, it restores the project session, including recently opened files and their editor positions; stale entries (older than on-disk mtime) are discarded and reloaded fresh. - Working folder: defaults to the shell directory you launch from; pass
kode <path>(e.g.,kode .orkode x/y/z) to open a different root and read/write.kode.jsonthere, or click[change]in the Files tab header to pick a new workspace folder. Source indexing scans only the folders listed in the Project panel. - Find/Replace:
Ctrl+Fopens the IntelliJ-style bar above the code viewport (shrinks content);Enterfinds next,Ctrl+Enterfinds all,Ctrl+Rreplaces current,Ctrl+Shift+Rreplaces all,Tabswitches between find/replace fields, and the[x]button closes the bar.Alt+Fopens project-wide search. The find box accepts regex patterns (invalid patterns turn the box red); replacements honor capture groups via$1,$2, etc. All matches stay highlighted (with an active-match accent) while the search state lives in the text buffer.Ctrl+Ssaves the current buffer, and the header shows*when there are unsaved changes. Selection text pre-fills the find box (escaped for regex) when invokingCtrl+F. - Project-wide search:
Alt+Fopens a centered modal over the workspace. It reuses the find/replace bar, adds a file-regex filter row (pre-filled with the current file extension), and shows a split view with match hits above (selectable list with highlighted tokens and a[ ]/[*]marker) and a full editor below. Selecting a hit opens the file in the embedded editor with the match centered;Ctrl+Ssaves directly from this view and updates recents. The embedded editor and hit list both apply syntax colors based on detected language/extension, so matches render with the same token styling as regular editors. - Shell escape: press
Ctrl+Tto temporarily drop to your$SHELL(fallback/bin/bash); typeexitto return to Kode. The TUI restores raw mode/alternate screen automatically. - About panel: lists the current build version, the Kode MIT license, and credits (license links + source URLs) for bundled libraries (JGit, Korim/Korio, kotlinx-coroutines, kotlinx-serialization).
- Installation/run: build generates
kode.sh/kode.bat/kode.cmdandkode.ps1launchers that set-Dkode.hometo the install folder, so resources (styles, tm-scopes) load correctly even when binaries are invoked from elsewhere.kode.jarlives alongside these scripts in the bundle. The PowerShell launcher enables VT output for Windows consoles before runningjava -jar. - Code highlighting: keyword-only regex highlighter; patterns come from
keyword-patterns.txt(language=regex) and colors fromtoken-colors.txt(qualifier=hex). Tokens carry fg color directly to avoid stylesheet lookups. - Hex editor: dual cursors (hex/ASCII), scroll keys, selection, and byte-buffer backing.
- Image viewer: ASCII and Braille modes, width/gray/contrast sliders (mouse drag/click, toggle button), aspect-aware sizing, per-cell color from Korim-rendered samples.
- Terminal/Renderer: ANSI canvas with back buffer diffing;
CanvasRenderer.withStyleandStyleSet.withDefaultscentralize styling. Raw-mode event loop normalizes key/mouse/resize. - Buffers:
TextBuffer(cursor, selection, word/nav ops) andByteBuffer(hex editor) power the editors; viewport slicing drives rendering. - MIME:
DefaultMimeTypeDetectoruses a literal lookup table with hardcoded categories (TEXT/IMAGE/BINARY) plus signature/byte-scans; routing picks the viewer accordingly. - Grammars: Lightweight keyword-only regex provider. Patterns are loaded at runtime from
keyword-patterns.txt; colors fromtoken-colors.txt. Tokens include fg color, so the editor skips per-scope stylesheet lookup. A TM4E loader exists (TmProvider) but is not wired in by default. - Viewers: Code editor (focus-aware input, optional TM token styling), Hex viewer (byte cursors), Image viewer (Korim ASCII/Braille renderer with per-cell bg/fg and adjustable sliders).
- UI Components: TabView for left panel, SliderControl (component with track/indicator styles) for viewer controls, splitter drag logic in
SplitPanelsApp. - Panels: Files (tree + open callback), Project (source roots list for indexing), Git, About (version/licensing/credits), and Settings (shows the LSP catalog, install root, install/update/remove actions, and highlights the selected server). File tree and Git panels auto-refresh periodically (~5s) without blocking the render loop, keeping status/commits and directory listings up to date. The file tree header shows the project root with
[+d][+f]; each folder row has[r][+d][+f][-]and each file row[r][-]for inline rename/create/delete; clicking[r]opens an inline prompt (Enter to apply, click outside to cancel). Resources (styles/grammars) resolve relative to the launcher directory viakode.home/KODE_HOME.
- Use
GRADLE_USER_HOME=./.gradle-user ./gradlew build|test|fatJar; target Java 21.fatJaremitskode-1.0-SNAPSHOT-all.jar.distBundlecopies the fat jar plustoken-colors.txt,keyword-patterns.txt,styles/app.css(understyles/), andlsp/servers.jsonintodist/.releaseBundlepackages a release folderkode-rel-<latest-tag>withkode.jar(renamed fat jar),keyword-patterns.txt,token-colors.txt,styles/app.css,lsp/servers.json, and this README for distribution. - Syntax config: provide
keyword-patterns.txt(lineslanguage=regex) andtoken-colors.txt(qualifier=hex, e.g.,keyword=#CC7832) next to the jar or in the working directory. Missing/invalid lines will throw with stacktrace on load. - Test focus/input flows, buffer mutations, MIME routing, and viewer rendering; add fixtures from
samples/for MIME detection and rendering checks. - Dependencies: JGit for Git panel, Korim/Korio + coroutines for image loading, TM4E available for TM tokenization, and internal StyleSet/Renderer helpers for consistent styling.
- Tasks:
generateTmScopesbuildsgrammars/tm-scopes.cssfrom grammar scopes (optional if using TM4E). Keep README aligned when adding viewers, sliders, detector/grammar changes; style names live instyles/app.css(e.g.,slider-track,slider-indicator,image-*,code-*).
using in combination with tmux with codex and the command promp


















