User guide / Files and buffers

Opening binary files

Development reference · View source

A file whose bytes contain a NUL, or do not decode as UTF-8, is binary. Opening one asks which program should have it instead of loading it as text.

KeyEffect
Up / DownChoose an offered program
EnterOpen the file with it
Tab on a remembered choiceDelete it, or make it the default selection
EscLeave the file alone
  • Offered programs. The prompt first selects the desktop’s preferred application: xdg-open on Linux, open on macOS, System default on Windows. Recent explicit choices follow, most recent first, and the most recent seeds the prompt.
  • Typing a program. Type a name on PATH or an absolute path. Explicit choices are remembered.
  • How it runs. The program starts detached with no terminal of its own: viewers and GUI applications work, but a terminal program cannot take over the screen.
  • Detection. An initial 8 KB probe avoids reading an obvious binary twice. The final read still validates the whole file before it becomes a buffer.
  • Where choices are kept. Runyte’s platform cache directory: $XDG_CACHE_HOME/runyte, else ~/.cache/runyte on Linux or ~/Library/Caches/runyte on macOS. Without an explicit XDG_CACHE_HOME on Unix, ~ comes from the effective operating-system account, not the inherited $HOME, so a privileged launcher cannot put cache files in another account’s home.

Opening binary files on Windows

  • Applications open in the background while editing stays responsive.
  • An explicit program is remembered only after Windows accepts its launch.
  • A launch still unresolved after five seconds reports that uncertainty and is not retried. Acceptance does not prove the application displayed the file.
  • Viewers can stay open after Runyte exits, subject to restrictions imposed by the process that started Runyte.
  • An explicit program uses native executable lookup and argument quoting. Quote paths with spaces: "C:\Program Files\Viewer\viewer.exe" --fit. The file is passed as one final argument.
  • Shell operators are literal arguments, and script wrappers are not found as native programs.
  • The system-default handler needs an equivalent ordinary path shorter than 260 UTF-16 units; an explicitly chosen viewer may support longer extended paths.
  • Opening from network shares is not part of the validated support.