Nimony

The road to Nim 3

terminal

nimony/lib/std/terminal.nim

This module contains a few procedures to control the terminal (also called console). Styles and colors are written as ANSI escape sequences on every platform, so on Windows they need a terminal with virtual terminal processing (Windows Terminal, or Windows 10+ conhost after enableTrueColors). Cursor movement, erasing and the terminal size use the console API on Windows, like Nim's std/terminal.

True color (Color from std/colors) is off until enableTrueColors is called, as in Nim; ansiForegroundColorCode(Color) and ansiBackgroundColorCode(Color) always return the escape sequence.

Not ported: getch, readPasswordFromStdin, getCursorPos, setCursorYPos and writeStyled.