Four ways to open a file
Bring it in from the command line, or fetch it from inside the editor.
| Method | How it behaves |
|---|---|
| Name it at startup | erya a.txt b.txt — one tab per file, starting on the first (see 1.2.5). |
| Ctrl+O file dialog | A directory listing you navigate with the arrow keys; the file you choose opens in a new tab. |
| Ctrl+N new tab | A blank, untitled document; you name it on the first save. |
| F12 Save As | Saves the current text under a different name. Afterwards the tab follows the new file; the original stays on disk, untouched by this tab. |
If the path is already open in a tab, Erya switches to it and says “report.txt is already open in a tab”. That prevents the classic disaster of two tabs each holding half your edits and overwriting each other.
Using the file dialog
Five keys are enough: up, down, in, up a level, cancel.
| Key | What it does |
|---|---|
| ↑ ↓ | Move the selection. The list scrolls when it is taller than the panel. |
| PageUp PageDown | Move a page at a time. |
| Home End | Jump to the top or bottom of the list. |
| Enter or → | Enter a directory, or open a file. |
| ← or Backspace | Go up one level. The directory you just left stays selected. |
| Esc or Q | Cancel and return to editing. |
- Directories are marked 📂; files have a blank marker, so directories visually group together.
- Sorting is directories first, then files, each alphabetically and case-insensitively.
- The .. entry at the top is the parent, the same as ←.
- The selected row is black on grey with a ▶.
- The status bar shows the current directory and “which of how many”.
- The dialog opens in the directory of the current document; for an untitled document, the working directory.
This differs from most file browsers. Up one level is ← or Backspace; Esc closes the dialog entirely. Erya's Esc means “leave this screen” everywhere, and this screen is no exception (see 1.3.7).
Tabs: new, switch, close
Four keys, and you see the result in row 1.
| Key | Action | Notes |
|---|---|---|
| Ctrl+N | New blank tab | Creates an untitled document and switches to it. |
| F10 | Next tab | Wraps around from the last to the first. |
| F9 | Previous tab | Wraps the other way. |
| F11 | Close this tab | Asks first if there are unsaved changes (see 2.1.8). |
Erya always keeps at least one tab. Close the last one and you are left with a fresh untitled document. To leave the program, press Ctrl+X.
On exit, Erya walks through every background tab looking for unsaved changes, switching to each one that has them and asking (S save / Y discard / N return) before it finally quits. “I thought I had saved, but the third tab was not” cannot happen.
What each tab remembers
Almost everything is per tab; two things are shared.
Per tab
- Cursor and scroll position
- The selection and its kind
- Undo and redo history (100 steps each)
- The last search and replacement text
- Insert / overwrite mode
- Line wrap on or off
- Encoding and line endings
- Paragraph width
Shared by all tabs
- The clipboard — copy in tab A, paste in tab B
- Key profile and interface language — changing them in system settings applies to every tab at once (see 4.2.2)
Phrases and macros live in files; once loaded they apply to the current tab (see 2.4.5).
Select in file A, Ctrl+C, F10 to file B, Ctrl+V. Erya's clipboard is internal, though — it is not the system clipboard. To exchange text with other applications, use the terminal's own copy and paste (see 2.2.7).
Save and Save As
Ctrl+S writes back; F12 writes somewhere new.
- A document with a name: Ctrl+S writes it, the message row says “Saved …”, and the asterisk in row 1 disappears.
- An untitled document: Ctrl+S opens the “Save as:” input automatically. Type a name and press Enter. You do not have to remember to press F12 instead.
- Save As: F12 pre-fills the current path; edit it and press Enter. Afterwards the tab belongs to the new file.
- The input supports ← →, Backspace, and Delete, and scrolls for long paths.
- An empty name is refused with “Filename cannot be empty”, and it asks again.
- An existing directory as the target fails with “Cannot save a document as a directory”.
- Directories in the path must already exist; Erya does not create them.
What actually happens on save
Nothing is written over the original; a temporary file is swapped in.
- The temporary file is always in the same directory as the original. So the directory itself must be writable — a writable file in a read-only directory cannot be saved.
- On Unix the original permissions are preserved. A chmod you applied earlier is not reset, and the executable bit on a script survives.
- Saving as UTF-8 streams the content in chunks, so large documents are not copied into memory just to be written.
- The save also carries out any pending encoding and line-ending conversion (see 3.1.2).
When another program changes the file
Erya checks the disk every 250 ms; what happens next depends on whether you have edited.
You have not edited (clean document)
It reloads automatically and says “External update detected; file safely reloaded”. What you see is always the current file.
Typical causes: another window just saved, or git pull replaced the file.
You have edited (unsaved changes)
Nothing of yours is overwritten. The message row warns “The file changed externally; confirmation is required before saving”, and the red confirmation appears when you press Ctrl+S.
Typical cause: you are editing and a colleague saved a version too.
| Key | Action | Result |
|---|---|---|
| O | Overwrite | Your version wins. The changes on disk are gone. |
| R | Reload | Discards your edits and reads the file again. What you typed is gone. |
| N / Esc | Cancel | Nothing happens. Both versions still exist, so you can save yours elsewhere and deal with it calmly. |
Both O and R throw one side away, and neither can be undone. The safe move is N to cancel, F12 to save your version under a new name, and then F4 to merge the two with the comparison view (see 3.4).
After a clean document is reloaded, the undo and redo history is cleared too — those steps applied to the old content and would do damage if replayed onto the new. It is deliberate, but it startles everyone the first time.
Leaving with unsaved changes
Two situations stop you, both answered with S / Y / N.
| Key | What it does |
|---|---|
| S | Save first, then exit or close. An unnamed document is asked for a name. |
| Y | Discard the changes and go. Nothing recovers them after this. |
| N / Esc | Cancel and return to editing. |
Answering a question with a reflexive Y is the single easiest way to lose work. In Erya, Y always means “discard changes” — to save, press S. All three confirmations spell out every letter on the same row; read it first.
Common problems
The six that come up most often around opening and saving.
| Symptom | Cause and fix |
|---|---|
| “Save failed: Permission denied” | The file or its directory is not writable. The atomic save needs to create a temporary file in that directory (2.1.6). |
| “Save failed: No such file or directory” | A directory in the path does not exist. Create it first with mkdir -p. |
| “Cannot save a document as a directory” | Save As was given an existing directory. Add a filename. |
| “Filename cannot be empty” | You pressed Enter on an empty input; it simply asks again. |
| You edited the wrong version | The file changed externally and you missed the warning. Press N and save a copy (2.1.7). |
| Undo suddenly does nothing | The document was just reloaded automatically, which clears the history (2.1.7). |