All Projects → xyproto → vt100

xyproto / vt100

Licence: BSD-3-Clause license
💻 VT100 Terminal Package

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to vt100

gomphotherium
Gomphotherium (/ˌɡɒmfəˈθɪəriəm/; "welded beast"), a command line Mastodon client.
Stars: ✭ 22 (+15.79%)
Mutual labels:  commandline, tui
Pxltrm
🖌️ pxltrm - [WIP] A pixel art editor inside the terminal
Stars: ✭ 459 (+2315.79%)
Mutual labels:  commandline, tui
Cordless
The Discord terminal client you never knew you wanted.
Stars: ✭ 1,391 (+7221.05%)
Mutual labels:  commandline, tui
DfmExtractor
Small command line utility which allows you to extract DFM, LFM and FRM forms from executable files compiled by Delphi, Lazarus and CodeTyphon.
Stars: ✭ 22 (+15.79%)
Mutual labels:  commandline
Commandline-Games-hacktoberfest
A repository to share command line games. An opportunity to start and learn about open source code contributions flow.
Stars: ✭ 16 (-15.79%)
Mutual labels:  commandline
sfm
simple file manager
Stars: ✭ 163 (+757.89%)
Mutual labels:  tui
tut
TUI for Mastodon with vim inspired keys
Stars: ✭ 165 (+768.42%)
Mutual labels:  tui
csol
A small collection of solitaire/patience games (Klondike, FreeCell, Spider, Yukon, etc.) to play in the terminal
Stars: ✭ 25 (+31.58%)
Mutual labels:  tui
cylon-deb
TUI menu driven bash shell script to update and maintain a Debian based Linux distro.
Stars: ✭ 23 (+21.05%)
Mutual labels:  tui
note-keeper
📓 A tiny bash tool for taking and organizing notes.
Stars: ✭ 58 (+205.26%)
Mutual labels:  commandline
import-cli-simple
This the meta package for Pacemaker Community, a Symfony based CLI application that provides import functionality for products, categories, attributes, and attribute-sets. The default format is CSV, adapters for XML are also available. The application can be declaratively extended by additional operations, which can be used to reassemble and exe…
Stars: ✭ 69 (+263.16%)
Mutual labels:  commandline
cs
command line codespelunker or code search
Stars: ✭ 34 (+78.95%)
Mutual labels:  tui
ncgrep
NCGREP, which is based on ncurses library to provide user interface, is a grep tool for searching text on target directory.
Stars: ✭ 23 (+21.05%)
Mutual labels:  tui
fast-ssh
⌨️ FastSSH is a TUI that allows you to quickly connect to your services by navigating through your SSH config.
Stars: ✭ 77 (+305.26%)
Mutual labels:  tui
dblab
Interactive client for PostgreSQL and MySQL
Stars: ✭ 199 (+947.37%)
Mutual labels:  tui
console-logging
Better, prettier commandline logging for Python--with colors! 👻
Stars: ✭ 111 (+484.21%)
Mutual labels:  commandline
select-run
A CLI tool to interactively search & select one or many package.json npm scripts to run
Stars: ✭ 29 (+52.63%)
Mutual labels:  commandline
wiki-tui
A simple and easy to use Wikipedia Text User Interface
Stars: ✭ 74 (+289.47%)
Mutual labels:  tui
termshark
A terminal UI for tshark, inspired by Wireshark
Stars: ✭ 7,368 (+38678.95%)
Mutual labels:  tui
libgen-downloader
A simple tool to search and download ebooks from libgen via terminal user interface.
Stars: ✭ 98 (+415.79%)
Mutual labels:  tui

VT100

Build Status GoDoc License Go Report Card

  • Supports colors and attributes.
  • Supports platforms with VT100 support and a /dev/tty device.
  • Can detect the terminal size.
  • Can get key-presses, including arrow keys (252, 253, 254, 255).
  • Has a Canvas struct, for drawing only the updated lines to the terminal.
  • Uses the spec directly, but memoizes the commands sent to the terminal, for speed.
  • Could be used for building a better dialog or whiptail utility.

Editor

For an editor that uses this module, take a look at o.

Images

shooter example

Screen recording of the shooter example, where you can control a small character with the arrow keys and shoot with space.


menu example

Screen recording of the menu example, which uses VT100 terminal codes and demonstrates a working menu.


VT100 terminal

A physical VT100 terminal. Photo by Jason Scott, CC BY 2.0

The vt100 Go Module

Requires Go 1.10 or later.

Features and limitations

  • Can detect letters, arrow keys and space. F12 and similar keys are not supported (they are supported by vt220 but not vt100).
  • Resizing the terminal when using the Canvas struct may cause artifacts, for a brief moment.
  • Holding down a key may trigger key repetition which may speed up the main loop.

Simple use

Output "hi" in blue:

vt100.Blue.Output("hi")

Erase the current line:

vt100.Do("Erase Line")

Move the cursor 3 steps up (it's a bit verbose, but it's generated directly from spec, memoized for speed and is easy to wrap in a custom function):

vt100.Set("Cursor Up", map[string]string{"{COUNT}": "3"})

The full overview of possible commands are at the top of vt100.go.

Another example

See cmd/move for a more advanced example, where a character can be moved around with the arrow keys.

A small editor using vt100

The o editor that uses vt100 can be used for editing Go, Bash or for example C++ code.

Quick installation:

go install github.com/xyproto/o@latest

General info

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].