Skip to content
This repository was archived by the owner on Mar 2, 2025. It is now read-only.

Latest commit

 

History

History
63 lines (39 loc) · 2.7 KB

Backends.md

File metadata and controls

63 lines (39 loc) · 2.7 KB

Supported Backends

Table of Contents
  1. Selecting a Backend
  2. Crossterm
  3. Ncurses

Selecting a Backend

Tuile is configured to use a prebuilt version of crossterm backend by default.

To select another backend, pass an option to Build.dependency in build.zig:

const tuile = b.dependency("tuile", .{ .backend = <backend name> })

Crossterm

Crossterm is a pure-rust, terminal manipulation library. It supports all UNIX and Windows terminals down to Windows 7 (not all terminals are tested, see Crossterm's Tested Terminals for more info).

By default, Tuile fetches a prebuilt version of the backend from tuile-crossterm. If you want Tuile to build it from source, set prebuilt to false:

const tuile = b.dependency("tuile", .{ .prebuilt = false })

Tuile uses Crossterm v0.27 which has a minimum requirement of Rust v1.58. Follow here to download and install Rust.

A word on Windows

By default Rust targets MSVC toolchain on Windows which makes it difficult to link from Zig. For that reason, tuile-crossterm compiles Rust with gnu ABI and does some (albeit small) crimes during linking. See build.crab description if you want to know more.

Nevertheless, Tuile is designed to be plug and play, and you should be able to just use it without worrying too much about what happens internally. If you face any problems, please submit a bug report.

(back to top)

Ncurses

To be able to use ncurses backend, ncurses must be installed and available as system library.

Tuile was tested with ncurses 5.7, but other versions should work regardless.

  • macOS

    A version of ncurses should already be installed in your system (or is it shipped with XCode and the command line tools?), so you don't have to do anything.

  • Linux

    sudo apt-get install libncurses5-dev libncursesw5-dev
  • Windows

    Prebuilt binaries are available on the official website.

(back to top)