Skip to content

Web Mode

rafageist edited this page Dec 4, 2026 · 2 revisions

Web Mode

divide can also run in a web browser on your own computer. It is the same divide, with the same menus, keys and windows: the browser shows a terminal, and each tab runs its own divide.

divide in Chromium, served with --res 120x40

Start it

divide --web PROJECT                         # 127.0.0.1:8000, the screen follows the browser window
divide --web 127.0.0.1:9090 --res 120x40 PROJECT

divide prints an address with a secret token in it:

Serving divide at http://127.0.0.1:9090/?token=...
The address opens once, within 10 minutes; then that browser stays in for 12 hours. Restarting the server gives a new address and shuts every browser out.
Terminal size: 120x40. Press Ctrl+C to stop.

Open that address in your browser. The token leaves the address bar at once, and a cookie keeps you in.

  • --web takes HOST:PORT, HOST or :PORT. Only this computer's own addresses are served (127.0.0.1, localhost, ::1).
  • --res 120x40 keeps the screen at 120 columns and 40 rows whatever the window's size; the page changes the font size to fit. --res auto (the default) makes the screen follow the window.
  • --mcp does not go with --web.

--res auto: the screen fills the window

Tabs and ending

  • Each tab is a separate divide, up to 4 at a time. A second tab of the same browser opens with the address without its token.
  • Alt+X ends the divide of that tab, after asking about unsaved changes, as always. The page then says the session ended.
  • Closing or reloading a tab ends its divide; the browser asks first.
  • Ctrl+C where you started divide --web ends every tab's divide, then the server. Programs a tab started (a PHP script, the debugger, a language server) end with it.

Keys, mouse and clipboard

The Search menu, opened with a click on the menu bar

  • The F-keys, Alt+letters, Ctrl+P and the mouse work as in a terminal. F5 zooms the window: the browser does not reload the page.
  • The browser keeps some keys for itself. In divide, use instead:
    • Alt+F3 (or Window > Close) for Ctrl+W, close the window;
    • Run > Data tree for Ctrl+T;
    • Ctrl+Space for Ctrl+N, completion.
  • Copy (Ctrl+C in the editor) reaches your computer's clipboard. Paste with the browser's own paste: the text arrives as typed.

Security

  • The address opens once, within 10 minutes. Until you open it, treat it like a password.
  • The cookie lets that browser in, new tabs included, for 12 hours. After that, new tabs are refused, but a tab already open keeps running until you close it or stop the server.
  • Restarting the server makes a new address and shuts every browser out.
  • To use divide from another computer, forward the port over SSH (ssh -N -L 9090:127.0.0.1:9090 user@server) and open the address there, with the same port.

The installed program

divide --web works from the divide command that pip installs (divide.exe on Windows) and from the standalone program of a release: each tab starts that same program again.

Clone this wiki locally