Kata Shell
Contents

User Guide › How to do things

Editing text and Markdown files

Kata Shell has a built-in viewer and editor for text and Markdown.

Because double-click and Enter open files in your Mac's default app (why), opening a file inside Kata Shell is its own explicit action — so a .md can go to your default Markdown app or be read here, whichever you want, from the same file.

Three ways in

  • F3 opens every applicable file in your selection in Preview (read-only) mode; F4 does the same in Edit mode.
  • The Ribbon's View and Edit buttons — enabled whenever your selection contains text or Markdown files — do exactly the same.
  • Right-click a text file → View (F3) or Edit (F4). The bold Open at the top of that menu is the default action — your Mac's app — not the internal editor.

These reach any file that Preview mode itself can show as text or Markdown, which you control in Settings → File Types (details). Folders, images and other non-text files in the selection are simply skipped.

  • If a file is already open, pressing F3 or F4 again switches its mode instead of opening a second tab for it.
  • Selecting more than 8 applicable files asks you to confirm before opening that many tabs.
  • Whichever file you selected last becomes the active tab once they are all open.

Changed from earlier versions: double-clicking a .md/.markdown/.txt used to open it in Kata Shell's editor. It now opens in your Mac's default app, like every other file. Use F3/F4, the View/Edit buttons, or the right-click menu to open it here instead. The first time you select a text file, a one-time tip points this out; turn these off in Settings → Ribbon → Tips.

Large and binary files

Just like the Preview panel, an editor tab guards against them: over 10 MB shows "File is too large to display", and a non-text file shows "Binary file — not shown", each with an Open anyway button.

On one of these screens there is nothing to preview or edit, so Escape, F3 and F4 all simply close the tab. Once you have pressed Open anyway it becomes an ordinary editor tab and the keys behave as below.

Switching modes, and leaving

  • Click Edit, or press F4, for a plain text box with the raw contents.
  • Click Preview, or press F3, to see it rendered.

What Preview shows follows Settings → File Types (details): a Markdown file renders as Markdown, a calendar invitation (.ics) as the same readable summary the Preview panel shows, and anything else as plain text. Edit always shows the raw text, so you can change an invitation in Edit and see the result the moment you press F3.

You can select text in Preview and copy it with ⌘C — rendered Markdown and calendar summaries included. A selection stays within one paragraph, heading, code block or table cell; to copy more at once, switch to Edit and copy the raw text.

Some calendar programs break long lines in the middle of a letter — common with Cyrillic, Greek or accented text. Such a file opens with its broken lines joined back together, and a note at the top says so: saving it writes the joined lines.

The same key also closes the tab once you are already in that mode. F3 heads toward Preview and F4 heads toward Edit — so pressing F3 while already previewing, or F4 while already editing, leaves the file, exactly as Escape does.

Inside an open editor tab, F3 and F4 are equivalents of Escape. If you have used FAR or Volkov Commander, this is the behaviour already in your fingers.

The Ribbon's Preview/Edit buttons only ever switch modes — a button labelled "Edit" never closes anything.

Saving

  • Save in the Ribbon is enabled only once you have made changes. The tab's title shows a "•" while there are unsaved changes. File → Save (⌘S) does the same.
  • File → Save As… (⇧⌘S) writes the file somewhere else: pick a name and folder, and the tab then continues editing the new file — its title, the address bar and ⌘S all follow it, and the original is left as it was. It stays available even when you have changed nothing, which is how you get your own copy of a file off a disk you cannot write to.

If a save can't go through

A read-only disk, or a file you do not have permission to change: Kata Shell tells you why instead of failing quietly, and offers Save As… so you can put your work somewhere that will accept it.

Your changes stay in the tab either way. If this happens while you are closing the tab, the tab stays open and still shows "•", so nothing is lost.

Kata Shell won't overwrite a file you don't have permission to change — one belonging to another user, or one that has been locked — even when the folder it sits in would technically allow it.

Closing an editor tab

Closing — the × on the tab, Escape, or the F3/F4 exit above — asks first if it still shows "•":

Choice Does
Save Writes your changes and closes the tab
Don't Save Closes without saving
Cancel Keeps the tab open so you can keep editing

This is the same question however you leave, so an accidental F3/F4 can never lose your work.

Once the tab actually closes, if the file's folder is open in another tab, that tab becomes active with the file selected — otherwise you land wherever you were before.

Quitting Kata Shell or closing its window asks the same question — see Closing and quitting.

The address bar

While an editor tab is open — in either mode — the address bar shows the file's full path as plain, read-only text, with a copy-to-clipboard button and no button for typing a path. It never acts like the folder breadcrumb, since an open file isn't a place to navigate from.

Text size

A small slider in the top-right corner sets that tab's text size, 10px to 24px — the same control the terminal has.

It applies in both Edit and Preview modes: the raw text, the rendered Markdown and a calendar summary, headings included, scale together. Each editor tab remembers its own size for as long as it is open; a newly opened file starts back at the default.

Images in Markdown

A relative image reference — ![diagram](images/foo.png) — resolves against the file's own folder and displays inline, in both the Preview panel and the Content pane's rendered view. .svg references render too.

An oversized (over the same 10 MB limit as above), missing, or unreadable referenced image shows a small marker in its place instead. A remote (http:///https://) image reference is never fetched — opening a Markdown file never causes Kata Shell to make a network request.

This guide describes Kata Shell 0.9.8, the latest release.