Zterm

Zterm icon
Contents

Introduction

Zterm is a simple terminal emulator using Vte and Gtk+ writting using the Zig programming language. Currently basic functionality works including opening and closing terminals in tabs and panes, giving it a program to run on the command line and setting the title from the command line.

Installing

  • Arch Linux and derivatives - Zterm is in the aur
  • FreeBSD - A binary tarball is provided for the latest release of FreeBSD (at the time of release) on the releases page over at codeberg Other Linux distros or operating systems will have to build from source, see building.

Building

You will need the Zig compiler, version 0.9.0, available from ziglang.org. You will also need the Gtk-3.x and vte libraries plus development headers installed on your system.

Zterm can be built using the Zigmod package manager for Zig.

Zigmod

zigmod ci
zig build -Drelease-safe=true

Alternatively, build and install with the included Makefile (still requires zigmod).

make all
make install-strip

Keyboard Shortcuts

The following table gives the default keybindings. If any customization is desired, see configuration | Shortcut | Action | | -------- | ------ | | Ctrl/Shift/T | New Tab | | Ctrl/Shift/Enter | New Pane | | Alt/R | Change Pane Orientation | | Alt/[1-9] | Goto [num] Tab | | Alt/UpArrow | Previous Tab | | Ctrl/PageUp | Previous Tab | | Alt/DownArrow | Next Tab | | Ctrl/PageDown | Next Tab | | Alt/RightArrow | Next Pane | | Alt/LeftArrow | Previous Pane | | Ctrl/Shift/Q | Quit |

Command line options

Usage: zterm [-h] [-e <COMMAND>] [-t <TITLE>] [-w <DIR>]
Flags:
	-h, --help                   	Display this help and exit.
	-e, --command <COMMAND>      	Command and args to execute.
	-t, --title <TITLE>          	Defines the window title.
	-w, --working-directory <DIR>	Set the terminal's working directory.

Configuration

Zterm uses the nestedtext human readable data format to store it's configuration. The main program options may be edited with the preferences dialog without editing any files. However, at this time the only way to change the default keybindings is by editing the file ~/.config/zterm/keys.nt. The file will be auto-generated if it does not exist. All configuration options set via the preferences dialog will take effect immediately. Any changes to the keys.nt file will require a restart to take effect.

Roadmap

  • Preferences dialog
  • Remove most color handling code and replace with zig-color color library
  • Finish implementing all preferences
    • Background image
    • Background gradient
    • Expose charset settings
  • User editable keybindings
  • Dialog to set keybindings
  • Set tab title based on running program / current directory
  • change from GtkBox widget to more flexible GtkPaned
    • Background gradient