Edit files in Workspace

Open files in tabs, let autosave write them or save at once, know what saved means, resolve a conflict when Codex or someone else changed the file, and keep unsaved drafts across devices.

  • Availability: Experimental
  • Evidence: Recorded run
  • How-to guide

Before you start

Your environment must be Ready. Editing needs a role that can edit the project; a Viewer reads.

Open files

  • Open a file from Files, or choose Open a file and type part of a path. With nothing open the editor says "No file open".
  • Each file is a tab. Every project keeps its own tabs, and they are there again when you come back, also on another device.
  • Star a file in Files to keep it under Favorites.
Keys Action
Ctrl/Cmd+P Open a file
Ctrl/Cmd+S Save now
Ctrl/Cmd+W, or Alt+W in a browser, which keeps Ctrl/Cmd+W for itself Close the tab
Alt+. and Alt+, Next and previous tab

Opening or editing a file never changes what is selected for development.

Saving, and what "saved" means

Autosave writes a file shortly after your last edit, and Ctrl/Cmd+S writes it at once. The state of the file reads Saved, Unsaved, Saving, Conflict or Deleted on disk, and a save is announced as "Saved" with the path.

Saved means one thing: the file is written in the storage of your environment. It is not committed and nobody else has it. Workspace says it in Review: "Saved files live in your environment’s storage. A checkpoint commits them to your branch. Integrating shares them with the project." See Review and integrate changes.

A save always states the version of the file it started from. There is no save that overwrites blindly, which is what makes the next section possible.

When the file changed under you

Codex edits the same files as you, and so can another of your devices. If a file changes on disk:

  • with no unsaved text of yours, the tab follows the change: "was reloaded from disk";
  • with unsaved text, nothing is overwritten on either side. The tab reads Conflict and says "This file changed on disk while you had unsaved text." and "Your text is kept. Nothing is written until you choose."

There is no default choice:

Choice What it does
Compare Shows two versions at a time: On disk ↔ mine, Base ↔ mine or Base ↔ on disk. Decide later closes it without choosing
Keep mine Writes your text over the version that is on disk now. If the file changes again first, you get a new conflict, never a silent overwrite
Take theirs Replaces your text with what is on disk
Accept the deletion When the file was deleted: "This file was deleted on disk while you had unsaved text."

While a conflict stands, autosave does not write that file, and Ctrl/Cmd+S answers "has a conflict. Resolve it before saving." The same bytes written by someone else are not a conflict. A file that no longer exists reads "no longer exists on disk. Saving creates it again."

Drafts follow you

Text you have not saved is a draft. It is kept on the device at once and sent to the service, under your account and nobody else's.

  • On another computer you find the same tabs and the same draft.
  • Saving the file discards its draft. Nothing else removes a draft: not stopping the environment, not losing it.
  • If the file moved on while the draft waited, the draft comes back as a conflict, never as an overwrite.
You see Meaning
"Draft synchronized" The service has it
"Draft not synchronized on this device yet", and the banner "Drafts not synchronized on this device yet:" with their number The service could not be reached. The text exists only on this device until it is. Synchronize now tries again
"This browser cannot store them: keep this tab open." The browser refused local storage, so the draft lives in the open tab only
"Another device changed the draft of {path}. Both versions are kept." Choose Keep this device’s or Use the other
"Another device saved or discarded the draft of {path}. Yours is kept." Your text is still here; decide what to do with it

A draft typed on another device cannot show its base version here: "The base content is not held on this device: the draft was typed elsewhere. Compare on disk with mine instead."

With a read-only role

A Viewer can open the project, read its files and read Review. Workspace says so in a banner: "Read-only." and "Your role in this project can open, read and review. It cannot edit, so nothing you type is saved or kept as a draft." Where the editor otherwise shows the autosave delay, it reads "Read-only role". Text typed there goes nowhere: it is not written, and it is not a draft.

Rename and delete

In Files, Rename never overwrites: "A rename never overwrites an existing file." Delete asks first and says "Its history stays in the repository." Both are refused, with the reason, for a file with unsaved text, a file that changed since it was listed, or a path that already exists; a refusal does nothing. Refresh from disk reads the files again.

Limits

  • The editor checks TypeScript syntax only. Imports of Beyond modules are not resolved inside the editor, so errors of meaning come from the build: see Diagnostics, where they are shown as the text Packages delivers, without a position to jump to.
  • The read-only role ran in the browser journey against the fixture and in unit tests, not in the run against the real administration. The service's refusal of a Viewer's write has a recorded run of the service's own suite.
  • There is no terminal.

Next action

Review and integrate your changes.