Skip to content

The Desktop

rafageist edited this page Dec 3, 2026 · 31 revisions

The Desktop

divide is a Turbo Vision desktop: a menu bar on top, overlapping windows in the middle, a status line at the bottom. If you used Turbo Pascal or Borland C++, your fingers already know it.

Window > Tile with the project, a template and a component

windows tiled, zoomed and cascaded; the themes previewed on the whole desktop

A folder, a file, or nothing

divide works on one folder at a time, the project, as an editor such as VS Code does. What it opens depends on how it starts:

Command Opens
divide ~/sites/shop that folder as the project, with the project window (divide .: the folder you are in)
divide page.tpl the file on its own, without a folder
divide ~/sites/shop page.tpl the folder, and the file in it
divide nothing: the Welcome window

the Welcome window: start, the folders and files opened lately

The Welcome window starts with a new file, open a file (F3), open a folder and the help. Below that are the folders and files you opened lately, newest first, each with the folder it is in. Enter opens the one under the bar, Del takes it off its list, and typing filters, as in every list. It goes away when something opens; Help > Welcome shows it again.

the File menu: open a file or a folder, close the folder

  • File > Open file... (F3) opens a file, with or without a folder.
  • File > Open folder... makes a folder the project. The windows of the folder before close, and divide asks about unsaved changes first. Its language servers, debugger and web server stop.
  • File > Close folder closes every window and goes back to the Welcome window.

Without a folder, Ctrl+B, Find in files and the project's Div setup offer to open one, and Go to file lists the open files. Rendering, includes and git take the folder of the file being edited.

Menus

F10 opens the first menu, Alt + the red letter opens a menu directly (Alt+F File, Alt+R Run, Alt+T Tools, Alt+W Window…). Inside a menu, the arrows move, the red letter or Enter chooses, Esc closes. The mouse works too.

the Run menu

Menu What is there
File New, Open file (F3), Open folder, Close folder, Save (F2), Save as, Save all, Exit (Alt+X)
Edit Undo, Redo, Cut, Copy, Paste, Select all, Complete (Ctrl+Space)
Search Find, Replace, Search again, Find in files (Shift+F2), Go to line, Go to included template, Outline (Ctrl+O: see Outline), Go to file (Ctrl+P), Command palette (Alt+P): see Finding Files and Commands, Previous / Next error
Run Run (Ctrl+F9: render a template, run a PHP script or a Runner Flow), Step over (F8), Trace into (F7), Step out, Go to cursor (F4), Program reset (Ctrl+F2), Parameters, Run in terminal, Web server, Check (Alt+F9), Output, Data file, Edit data, Data tree (Ctrl+T), Flow structure (Ctrl+T on a Runner Flow: Flow Structure)
Debug Evaluate (Ctrl+F4), Watches, Call stack (Ctrl+F3), Add watch (Ctrl+F7), Toggle breakpoint (Ctrl+F8): see Debugging PHP; Render trace: see Render Trace
Git Changes, History, Branches, Commit, Pull, Push, Fetch, Diff of the file, File history, Blame, Pull requests and issues: see Git
Tools Dialector, Translate a template, Composer packages
Window Project (Ctrl+B), Messages, Tile, Cascade, Zoom, Next, Previous, Close, Close all
Options Colors (the theme and the colour depth), Language (of the interface), plain symbols or file type marks, language servers, Div engine, Div setup, Xdebug, MCP server
Help Contents, Books, Index (Shift+F1), Topic search (Ctrl+F1), Search (the books by words, ranked), Previous topic (Alt+F1), Using help (F1), Welcome, About: see Help

Windows

Every window has a number on its top border (Alt+1…9 goes to it) and, for editors, * line:col on the bottom border, where * means unsaved changes.

  • F6 / Shift+F6 (also Ctrl+PgDn / Ctrl+PgUp): next / previous window.
  • F5: zoom the window to the whole desktop and back.
  • Alt+F3 or Ctrl+W: close it (divide asks about unsaved changes).
  • Drag a window by its title, resize it from a bottom corner, click [■] to close, [▲] to zoom.
  • Window > Tile arranges the windows in a grid beside the project window, which keeps its place at the left edge; Cascade stacks them.

The scroll bars are on the border of the active window, as in Turbo Pascal: the vertical one on the right border (▲ ▒ ■ ▼), the horizontal one on the bottom border after the line:col (◄ ▒ ■ ►), so the text keeps the column and the row a bar inside the window would take. An arrow moves a line, a click on the track a page, and the ■ can be dragged; the focus stays in the text. Windows in the background show a plain border, and a bar only shows when there is something to scroll.

Kinds of windows: editors (templates, data, PHP, and the other files of a project: HTML, CSS, JavaScript, Markdown, YAML, CSV…), the Project Window, the Output of a render or a script, the Messages window, the Watches and Call stack windows of the debugger, the log of the Web Server, the data tree, the Dialector and the Help window.

Status line

The left side shows the keys that matter. The right side tells you about the window you are in:

  • in a template, Div (plus the dialect's name when it is not the default), or the error or warning under the cursor, or the count of problems;
  • in a data file, JSON ok or the JSON error with its line and column;
  • in any other file, its language (Markdown, YAML, CSV…);
  • in the Output window, which template and data file were rendered, or which script ran and its exit code, and how long it took;
  • while debugging, where the script is paused and the debugger's keys;
  • in the project window, the dialector and the help window, their keys;
  • while something runs in the background (a render, for example), a turning spinner (| / - \) and what is running.

Filtering a list or a tree

Every tree and list has a filter line above it: » type to filter. With the list focused, type: only the items that hold what you typed stay (a piece of the name, upper or lower case alike), and the line says how many, » tpl 5/14. Backspace takes a letter back, Esc empties the filter (only then does Esc close a dialog). Space keeps its job: fold, choose.

In a tree you see what matches, the branches above it, and everything below a node that matches: filter by a folder or a vendor and you see what it holds. The Project Window looks in the whole project, also in folders you never opened.

the project window filtered by tpl: the templates of every folder

typing in the project window and in the outline: only what matches stays

The filter is in the project window, the Outline, the data tree, the Composer packages, the Messages and Find in files windows, Watches, Call stack, the Render Trace, the sections of the Dialector and of the Div Setup, the files of File > Open, and the input line history (there in the list's frame). The command palette, Help > Search and Composer's add assistant have a search line of their own.

Dialogs

Dialogs work as in Turbo Vision: Tab / Shift+Tab go from one control to the next, Alt + the yellow letter jumps to a control, Enter presses the default button (also from an input line or a group of options), Esc cancels.

File > Open file (F3), Open folder and Save as are laid out like Turbo Pascal's: the name line at the top, the files of the folder below it on cyan with their own scroll bar, the buttons in a column at the right, and a pane at the bottom with the folder (and its wildcard) and the file under the bar, with its size and date. Type a wildcard (*.php) to list other files, a folder name or .. to go there, or a full path. The mouse wheel moves the bar of the list, three rows a notch, as in every list of a dialog.

File > Open

Input line history

Input lines remember what you accepted in them, as in Turbo Pascal: the ▐↓▌ at the right of a line opens the earlier entries, newest first. ↓ in the line (or a click on the arrow) opens the list, Enter or a click puts an entry back in the line, Esc closes the list. Each kind of line has its own history: file names, texts to find and to replace, line numbers, the parameters of a program, watch expressions… An entry is remembered when the dialog ends with OK, not with Cancel, and the histories are kept in the config for the next session.

the history of the file name

Opening and saving files

  • Save (F2) writes the whole file at once: divide writes it beside the original and then puts it in its place, so an interrupted save never leaves half a file, and the file keeps its permissions.
  • If another program changed the file since divide read it (a git checkout, another editor), F2 asks first: Overwrite writes divide's text, Cancel leaves the file on disk as it is and keeps your changes in the editor.
  • Save as asks before replacing a file that already exists, and refuses a file that is open in another window.
  • A file that cannot be edited as text is not opened, and a message says why: not a regular file, larger than 5 MB, binary, or not UTF-8 (saving could not write it back as it was).
  • A file keeps its own newlines: one written with \r\n (Windows') is saved with \r\n, one with \n with \n, lines you added included. A new file gets \n.
  • A setting that cannot be kept (a read-only home folder) applies for the session, without an error.

Colours

Options > Colors chooses the colour theme:

Theme Look
Turbo Pascal (the default) Turbo Vision's colours: gray menus and dialogs, blue windows, yellow text
Turbo C the same, with Turbo C 2.01's white-on-black menu hotkeys
Free Pascal Turbo Vision's layout in Windows Terminal's Campbell colours, as Free Pascal's IDE looks on Windows today
Modern dark deep grays, light text and a blue accent, high contrast
Phosphor White a monochrome screen: white and grays on black
Phosphor Green, Phosphor Green Black green phosphor, on a dark green screen or on black
Phosphor Amber, Phosphor Amber Black amber phosphor, on a dark amber screen or on black

The five phosphor themes are one hue each, in levels of light, as on a monochrome monitor. They do not rely on hue, so in them divide tells things apart in other ways:

  • Reverse video, a bright bar with dark text: the selection, the line about to run, an error, a menu item or list entry under the bar.
  • Light: an error's bar is brighter than a breakpoint's or a warning's; a removed line in a diff is darker than an added one.
  • Attributes: warnings are underlined; what a mutation took away and a removed diff line are struck through; comments are in italics; the hotkey letters of menus and buttons are underlined.
  • Marks in the editor's margin: ► the line about to run, ■ a breakpoint, and +, -, ~ the lines Git sees added, removed above and changed.
  • Text: Messages always says Error or Warning; diffs keep their + and -; the project window keeps Git's M, A, ? and •.

The black variants keep the screen pure black (#000000) and the same light levels for everything on it. With 16 colours, a phosphor theme uses only black and its hue's two ANSI colours (white: the grays), so it never turns multicoloured; how those look is up to the terminal's palette.

Moving through the themes with the arrows paints the whole desktop in each one (the dialog and its sample of a template too). OK keeps the theme, also for the next start; Cancel goes back to the one you had. divide --palette modern-dark starts with a theme without changing the one chosen. The pictures in this manual use the Free Pascal theme.

Options > Colors, previewing Modern dark

Modern dark

Turbo Pascal

Turbo C colours and the Window menu

Phosphor White: the editor with a breakpoint (■), the line about to run (►) and Git's changes (+ - ~) in its margin

Phosphor Green: the editor with a breakpoint (■), the line about to run (►) and Git's changes (+ - ~) in its margin

Phosphor Green Black: the editor with a breakpoint (■), the line about to run (►) and Git's changes (+ - ~) in its margin

Phosphor Amber: the editor with a breakpoint (■), the line about to run (►) and Git's changes (+ - ~) in its margin

Phosphor Amber Black: the editor with a breakpoint (■), the line about to run (►) and Git's changes (+ - ~) in its margin

Colour depth

divide sends its colours as the terminal says it can show them: true colour when it announces it (COLORTERM=truecolor, Windows Terminal, iTerm2, most Linux terminals), the 256-colour palette otherwise (TERM=xterm-256color), and the 16 ANSI colours on a basic terminal. In 16 colours each colour goes to the one it stands for in its theme (a light green stays light green). The operating system plays no part, only what the terminal says.

Over ssh or inside tmux COLORTERM is often lost and the terminal looks like a 256-colour one. If it can do better, choose True colour under Colour depth in Options > Colors (it applies from the next start), or start with divide --colors truecolor. The dialog says what the terminal gets now.

Language

divide speaks English and Spanish. It takes the language of the system (LANG, LC_ALL…) when it has it, English otherwise. Options > Language chooses another one, and divide remembers it; it applies from the next start. When the choice cannot be kept, a warning says why.

Options > Language

Menus, dialogs, hints, messages and the status line are translated, with hotkeys of their own in each language (Alt+A opens Archivo, Alt+J opens Ejecutar). The keys of the commands stay the same: F2 saves and Ctrl+F9 runs in any language. The help follows the interface: in Spanish, the manual and Div's documentation are shown in Spanish (see Help#the-help-in-spanish).

the Run menu in Spanish

To use another language for one run only, start with divide --language es (or --language en); the variable DIVIDE_LANGUAGE does the same and wins over everything else.

Clone this wiki locally