Ternux
Workspace

File Editor

Open and edit files directly inside the workspace using the built-in CodeMirror editor with syntax highlighting for multiple languages.

The File Editor turns your workspace into a lightweight IDE. Double-click any file in the file explorer sidebar to open it in a persistent editor tab with full syntax highlighting.

Opening Files

Open files from the file explorer in two ways:

  • Double-click a file in the file tree.
  • Right-click a file and select "Open" from the context menu.

Each file opens in a new inner tab alongside the existing Terminal tab in the workspace's tab strip.

Inner Tab Strip

The inner tab strip sits at the top of the workspace content area:

[ Terminal ]  [ index.ts ]  [ config.toml ]
  • The Terminal tab is always first and cannot be closed. Selecting it returns you to your terminal panes.
  • File tabs appear to the right. Each tab shows the file name, a ● indicator for unsaved changes, and a close button.
  • When there are too many tabs to fit, the strip scrolls horizontally.

Editing Files

The editor uses CodeMirror 6 with full syntax highlighting support for the following languages:

LanguageFile Extensions
JavaScript / TypeScript.js, .mjs, .cjs, .jsx, .ts, .mts, .cts, .tsx
HTML.html, .htm
CSS / SCSS.css, .scss, .sass
JSON.json, .jsonc
YAML.yaml, .yml
Markdown.md, .mdx
PHP.php
Shell.sh, .bash, .zsh
Environment.env
TOML.toml
Rust.rs
Go.go

Language detection is automatic based on the file extension and content (shebang lines, XML/HTML doctypes, JSON/YAML structure).

Image Preview

Raster image files (.png, .jpg, .gif, .webp, .bmp, .ico) open in a dedicated image preview pane. The image is displayed with object-contain scaling, centered in the pane. There is a 20 MB file size limit for image preview.

SVG Files

SVG files (.svg) open in a dual-mode pane with a toggle bar at the top:

  • Preview — renders the SVG as an image, exactly as it would appear in a browser.
  • Source — shows the SVG's XML source code with full HTML syntax highlighting in an editable CodeMirror editor.

You can edit the SVG source and press Cmd+S / Ctrl+S to save. After saving, the Preview image automatically refreshes to reflect your changes. A ● dirty indicator appears when there are unsaved changes.

File Encoding

The editor supports files in multiple encodings beyond UTF-8:

  • UTF-8 (with and without BOM)
  • UTF-16 (LE and BE)
  • Windows-1252
  • ISO-8859-1
  • Shift-JIS, GBK, Big5, EUC-KR, EUC-JP

The detected encoding is displayed in the editor's status bar. When you save a non-UTF-8 file, the original encoding is preserved — the file is not silently converted to UTF-8.

Binary files (containing null bytes) that do not match a known text extension are shown as an error message and cannot be edited.

Saving Files

  • Press Cmd+S (macOS) / Ctrl+S (Linux/Windows) to save.
  • A Save button is also available in the editor header bar when changes are detected.

The dirty indicator (●) appears in the tab and the editor header whenever there are unsaved changes. If you undo all changes back to the original file content, the dirty indicator clears automatically.

Closing Tabs

  • Cmd+W / Ctrl+W closes the active file tab first.
  • If you close the last file tab, the terminal panes are shown again.
  • Pressing Cmd+W again closes the workspace tab (with confirmation).

If a file has unsaved changes when you try to close it, a confirmation dialog appears: "Discard changes?" with options to keep editing or discard.

Adjusting Font Size

Use the following shortcuts to zoom the editor font size in or out:

ShortcutAction
Cmd+= (macOS) / Ctrl+= (Windows/Linux)Increase font size
Cmd+- (macOS) / Ctrl+- (Windows/Linux)Decrease font size

The font size change applies globally to all open file editor tabs.

On this page