cat / 012
clone

a spreadsheet for the terminal: lotus 1-2-3 looks, google sheets keys and formulas, one go binary

cat/module-path
012 / docs / files / saving.md
saving.md 2.4K rendered
1---2title: "Saving"3sidebar_position: 34---56# Saving78Saves are atomic: 012 writes a temporary file and renames it. Saving over9the open file when something else wrote it since it was opened or last10saved (another program, or another session of [012 serve](../terminal/ssh.md)) asks11first: Enter overwrites, S saves under another name, Esc cancels. Save12as (and `:w name`, `:wq name` with vim keys) onto another file that13exists asks the same way: Enter replaces it, Esc cancels, and cancelling14`:wq`'s question cancels its quit too.1516Under `012 serve`, a session that idles out or is ended by the server17stopping keeps its unsaved changes in `.012-recovery/` in the served18directory, and the next session opening that file offers them back: see19[Serving over SSH](../terminal/ssh.md#unsaved-work).2021## If 012 crashes2223An internal error (a bug, a Go panic) stops 012 rather than leaving24the terminal broken: the screen goes back to what the shell showed,25and 012 says what happened and where it put things:2627```28012: stopped on an internal error (a panic in update: ...)29012: unsaved changes kept in ~/.config/012/recovery/%2FUsers%2Fann%2Fbudget-20260929-101112.012; open budget.012 again to restore them30012: a report is in ~/.config/012/crashes/crash-20260929-101112.txt; include it when reporting the problem31```3233- **Unsaved changes** are written, the whole workbook, to `recovery/`34 in 012's config directory (the one `012 config path` prints the35 [config file](../reference/config.md) of, `~/.config/012` on Linux),36 named after the file's full path. Opening that37 file again, or starting `012` on nothing for a sheet never saved,38 asks on the context line: Enter restores them as unsaved changes to39 the file, D deletes them, Esc leaves them for next time. Saving a40 restored workbook removes its recovery file. Nothing is kept without41 unsaved changes, and only the newest three files per name.42- **The report** goes to `crashes/` beside it: where the error43 happened, the error, its stack of calls, 012's version, the system,44 the file's name and where its changes went, never what the workbook45 holds. The newest ten are kept.4647If the error happened while drawing the screen, the terminal also48shows the stack of calls above those lines. Under `012 serve`, the49session's changes go to `.012-recovery/` as above, the client is told50that 012 stopped on an internal error, and the report goes to the51server's log.