Skip to content

Repository files navigation

DraftPane

A small, security-first terminal Markdown editor with a live side-by-side preview. It is designed for modern terminals, including Ghostty, without depending on terminal-specific APIs. The high-contrast preview theme brings familiar dark documentation styling to terminal cells.

Status: MVP. Back up important files and review the documented limitations.

Why

DraftPane keeps the useful editing model of split-pane Markdown tools while treating every document as untrusted input. Document control characters are neutralized before rendering, saves detect external conflicts, and editing has no network, link-launching, PDF, plugin, or broad syntax-parser surface.

Install

One-line install

curl --proto '=https' --tlsv1.2 -fsSL https://github.com/qike-ms/draftpane/releases/latest/download/install.sh | sh

That's it—Cargo and Rust are not required. The installer supports macOS and Linux on arm64 and x86-64, verifies the release archive against SHA256SUMS, and installs draftpane to ~/.local/bin.

To install an immutable version:

curl --proto '=https' --tlsv1.2 -fsSL https://github.com/qike-ms/draftpane/releases/download/v0.7.0/install.sh | sh -s -- --version v0.7.0

To build or contribute, install Rust 1.88 or newer and use the locked source build documented in SAMPLE_COMMANDS.md.

Upgrade

Once installed, update to the latest checksummed release with:

draftpane update

The updater uses the verification logic embedded in your installed binary, downloads the matching release archive plus SHA256SUMS over HTTPS, verifies the checksum, refuses downgrades, and atomically replaces the running executable. It never downloads and executes a remote script. If DraftPane was installed somewhere requiring elevated write access, reinstall it to a user-writable directory instead of running DraftPane as root.

Use

draftpane README.md
Key Action
Ctrl+S save
Ctrl+Q Quit; with unsaved changes, press Y to confirm discard
Left click in editor Move cursor to the clicked character/line
Mouse wheel over editor Scroll editor and synchronized preview
Mouse wheel over preview Scroll wrapped preview content independently
Ctrl+D / Ctrl+U Scroll editor and synchronized preview; at an editor boundary, scroll the preview
Ctrl+K Delete the current line, or all selected lines
Shift+Up / Shift+Down Select whole lines; repeat to extend the selection
Delete / Backspace Delete selected lines; otherwise edit normally
Escape Clear the line selection
Arrow keys, Home, End Move cursor; preview follows editor position
Enter, Backspace, Delete, Tab Edit

The layout is horizontal at 80 columns or wider and stacked in narrower terminals.

MVP boundaries

  • Opens one regular, non-symlink UTF-8 Markdown file, up to 1 MiB.
  • Renders headings, emphasis, links, lists, block quotes, code, rules, task markers, GFM tables with aligned Unicode borders, row dividers, and wrapped cells, and a safe Mermaid subset with terminal-native boxes/arrows. The terminal controls the font; DraftPane can select color and text attributes only.
  • Moves the cursor on left click, supports visible whole-line selection and deletion, scrolls either pane with the mouse wheel, and synchronizes preview progress proportionally with editor scrolling/cursor movement.
  • Does not open links or make network requests while editing; only the explicit draftpane update command accesses GitHub Releases.
  • Mermaid preview currently supports only top-down linear flowchart/graph diagrams with declared rectangular nodes and --> edges. Unsupported Mermaid remains visible as source code rather than being rendered incorrectly.
  • Does not support mouse text selection, undo, search, clipboard integration, PDF, syntax highlighting, configuration, or automatic file reload yet.
  • Saves compare the current file with the opened/saved baseline and refuse known conflicts. A concurrent writer can still race the final replacement; keep backups.
  • Atomic replacement preserves existing permission bits and CRLF style, but extended attributes and ownership behavior remain platform-dependent.
  • Cursor movement operates on Unicode scalar values rather than grapheme clusters, so combining characters and multi-code-point emoji may require multiple keypresses.
  • Install and update checksums detect corrupted or mismatched downloads. GitHub release hosting remains the distribution trust root; signed artifacts and provenance attestations are release-hardening work.

License

Licensed under either Apache-2.0 or MIT, at your option.

About

Secure terminal Markdown editor with a live side-by-side preview

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages