Built-in Editor & Terminal Drawer
deccy-gui includes an embedded code editor for inspecting and modifying claimed files, rationale prose, and store settings, along with a collapsible bottom drawer housing a live PTY shell (Terminal) and the CLI action log (Outputs).
Built-in Code Editor
When you open a file for editing, the built-in code editor replaces the center graph pane while keeping the toolbar, right inspector rail, and bottom drawer available. No external $EDITOR or $VISUAL process is launched.
Ways to Open a File in the Editor
- From
Details→Claims: Left-click any claim path, or right-click a claim path and chooseopen in editor. - From
Rationale: Click the right-alignededitbutton at the top of theRationaletab. - From a Graph Card: Right-click a card and choose
open claims in editor(opens the first claimed file) oropen rationale in editor. - From Settings (
⌘,): Clickopen settings.jsonin the settings dialog (creates.deccy/settings.jsonfirst if it does not exist).
Opening a file sets a editing <path> toast in the feedback bar and focuses the editor buffer.
Editor Header & Controls
At the top of the editor pane is a 30px header bar containing:
- Buffer State Marker: Shows
savedin muted text when the buffer matches disk, ordirtyin accent blue when you have unsaved edits. - File Path: The path of the open file.
- Unsaved Warning Tag: Appears as
unsaved — esc again to discardif you tried to close a dirty buffer. saveButton: Writes the buffer to disk (highlighted in primary accent blue whendirty).closeButton: Closes the editor and returns to the graph view.
Editing Features
- Line Numbers & Indentation: A left gutter displays 1-based logical line numbers (soft-wrapped continuation lines are unnumbered) and indentation guides.
- Syntax Highlighting:
- Markdown:
.md,.mdx, and.markdownfiles (used by rationale and Markdown claims). - JSON:
.jsonand.jsoncfiles (such as.deccy/settings.json). - Plain Text: All other file extensions open in plain monospace.
- Markdown:
- Soft Wrap Toggle (
⌥z/Alt+Z): Soft wrap starts off when a file opens. Press⌥z(Alt+Zon Linux/Windows) while the editor has focus to toggle soft wrapping on or off; the feedback bar confirms withwrap onorwrap off.
Saving Files & Structural Integrity
Press ⌘s (Ctrl+S on Linux/Windows) or click save to write the buffer back to disk:
- On success, the feedback bar shows
saved <path>anddeccy-guiimmediately triggers a store reload. - On write failure, the buffer stays
dirtyand the filesystem error is shown in red in the feedback bar.
Important: The editor writes only the raw file you opened — it never rewrites node records on its own.
- If you edit and save a claimed file, its on-disk digest will change and the node will show
driftafter reload. Clickrefresh claimsin theDetailstab (or rundeccy claim <id> --refresh) to update the node’s claim snapshot, andrepinany downstream connectors that become stale.- If you edit and save a rationale file under
.deccy/rationale/, the node’s own digest changes, which may mark connectors pinning that node asstaleuntil you clickrepin.
Unsaved Changes Protection
deccy-gui guards against accidental data loss whenever the editor buffer is dirty:
- Closing (
Escorclose):- If the buffer is
saved, pressingEscor clickingcloseexits the editor immediately. - If the buffer is
dirty, the firstEsc(orcloseclick) keeps the editor open and displaysunsaved — esc again to discardin both the editor header and the bottom feedback bar. PressingEsc(or clickingclose) a second time discards the edits and returns to the graph.
- If the buffer is
- Opening Another File: Attempting to open a different file while the current buffer is
dirtyis refused withunsaved changes: save or close the editor first. - Quitting the App (
⌘q/Ctrl+Q): Pressing⌘qwhile the editor isdirtywarnsunsaved — ⌘q again to quit (esc again to discard)on the first press; pressing⌘qa second time quits immediately.
Bottom Drawer (Terminal & Outputs)
The bottom drawer starts closed when deccy-gui launches.
Opening, Closing, and Resizing the Drawer
- Status Bar Toggle: Click
▴ open drawer/▾ close draweron the left side of the bottom bar at any time (even before any action has run). - **Keyboard Toggle (
⌃`` /Ctrl+)**: Press `Ctrl+from any mode (graph, search, editor, or terminal) to open the drawer directly to theTerminaltab and focus it, or to close the drawer ifTerminalis already open. - Resizing: Drag the handle along the top edge of the drawer. Its height defaults to
240px, has a minimum of120px, and can grow up to60%of the window height. The drawer remembers its last height when closed and reopened during the same session.
Terminal Tab
The first time the Terminal tab is displayed, deccy-gui spawns an interactive shell inside a pseudo-terminal (PTY):
- Shell Executable:
- Uses
$SHELLwhen set and non-empty. - Falls back to
/bin/zshon macOS,/bin/shon Linux/other Unix, and%COMSPEC%(orcmd.exe) on Windows.
- Uses
- Environment & Working Directory: Starts in the store root directory with
TERM=xterm-256colorandCOLORTERM=truecolor. - Display: Supports 16-color, 256-color, and 24-bit truecolor ANSI sequences, bold text, inverse video, alternate-screen programs, and a solid block cursor. The PTY row/column grid resizes automatically whenever you resize the drawer or window.
- Process Exit: If the shell exits (for example, after
exitorCtrl-D), the terminal pane appends[process exited]in amber.
Terminal Focus & Keyboard Routing
- Opening the drawer on the
Terminaltab (or clicking anywhere inside the terminal pane) focuses the terminal so typing, arrow keys,Ctrlsequences, andAltsequences go straight to the shell. - Releasing Focus: Press
Escor click outside the terminal pane (such as the graph, toolbar, editor, or inspector rail) to return keyboard shortcuts to the viewer or open editor. - Paste: Press
⌘von macOS (Ctrl+Von Linux/Windows) while the terminal is focused to paste clipboard text into the shell. - Line & Word Editing:
- On macOS,
⌘←/⌘→jump to the start/end of the line (Ctrl-A/Ctrl-E),⌘⌫kills the line (Ctrl-U),⌥←/⌥→move by word (ESC b/ESC f), and⌥⌫deletes the previous word (Ctrl-W). - On Linux / Windows,
Ctrl+←/Ctrl+→andAlt+←/Alt+→move by word, andCtrl+Backspace/Alt+Backspacedelete the previous word.
- On macOS,
- Global Shortcuts:
⌃`` (toggle drawer) and⌘q/Ctrl+Q` (quit) remain active even while the terminal is focused.
(Note: Mouse text selection inside the terminal grid is not implemented; copy output directly from shell commands or use the Outputs tab / inspector buttons.)
Scrollback
- The terminal retains 1,000 lines of scrollback history.
- Scroll up with the mouse wheel or trackpad over the terminal pane to inspect earlier output; scroll down to return toward the live screen.
- While scrolled back, a
↓ bottom (<n>)button appears on the right side of the drawer’s tab bar showing how many lines above the bottom you are. Click↓ bottom (<n>), type any key, or paste into the terminal to jump straight back to the live prompt.
Outputs Tab
The Outputs tab is a scrollable monospace log of every deccy CLI action triggered from the UI (validate, validate --merge, repin, refresh claims, repin all) as well as any store reload failures:
- Before the first action runs, the pane displays
no actions yet. - Each entry displays:
- A header line:
$ deccy <arguments> · exit <code>(orreload · failedfor reload errors), colored green when the exit code is0and red when non-zero. - The captured
stdoutandstderroutput below the header.
- A header line:
- If a background store reload fails (for example,
.deccy/nodesbecomes unreadable), the drawer opens automatically and records the refusal inOutputs.