You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PDCursesMod/vt
Bill-Gray 21b415468b
VT flavor : have to use basic I/O functions with Digital Mars compiler
5 months ago
..
CMakeLists.txt correct memory model setup for Open Watcom 5 years ago
Makefile The 'miscellaneous tests' from the 'tests' directory can now be made, for at least some platforms, with 'make tests'. 8 months ago
Makefile.bcc Removed the ability to make BBS-ready packages. 'Upstream' PDCurses did this 3.5 years ago; time we caught up. 3 years ago
Makefile.dmc Makefile adjustment (win32/dos/so2) 2 years ago
Makefile.vc MSVC makefile for VT platform now can build the test programs 6 months ago
Makefile.wcc OpenWATCOM makefile for VT flavor drastically simplified by use of 'common' bits 4 years ago
README.md Deprecated use of the VT platform on Windows 3 years ago
pdcclip.c Put Windows clipboard file into the 'common' directory, to be shared by WinCon, WinGUI, and Windows builds of VT. Maybe Windows SDL1 builds, too, eventually (should be straightforward to do). 2 years ago
pdcdisp.c VT flavor : have to use basic I/O functions with Digital Mars compiler 5 months ago
pdcgetsc.c Modified to resemble similar code in other flavors, including debugging statements 6 years ago
pdckbd.c Hitting Alt-/ in the framebuffer and DRM ports now rotates the screen 90 degrees clockwise. This is in preparation for use of the library on phones, where the orientation may change. (It also helps if you have a monitor set up in portrait mode.) 8 months ago
pdcscrn.c supersedes #276, #278 where the discussion is (#303) 1 year ago
pdcsetsc.c Follow-up to commit 666bf7ab0e to make further VT100 escape sequences more human-readable 1 year ago
pdcutil.c Framebuffer version can now be built for Linux framebuffer (what we've had all along) or for DRM = Direct Rendering Manager (works on Linux and *BSD). 2 years ago
pdcvt.h Modified the way the CSI and OSC (VT100) commands were expressed to make them a little clearer 1 year ago

README.md

PDCurses for VT

This directory contains source code to support PDCurses using a mix of xterm, VT-100, VT-200, and ANSI escape sequences to set colors, position the cursor, etc. Note that the name is misleading; it uses an olio of control sequences from

https://www.gnu.org/software/screen/manual/html_node/Control-Sequences.html

which may, or may not, work on your terminal. I've tested it in urxvt, xterm, and QTerminal on Linux and FreeBSD, and in cmd on Win10 and (with NANSI.COM or NANSI.SYS) on Windows ME. MS-DOS (again with NANSI) and Linux console modes 'sort of' work (no mouse and the colors need work).

It assumes that 256 colors are available (16 in NANSI mode), but it can use full RGB on terminals that support it.

Building

In GNU/Linux, run make or make WIDE=Y or make UTF8=Y. You can add -w64 or -w32 to cross-compile 64-bit or 32-bit Windows executables, using MinGW64. (But see warnings below about Windows.) Add DLL=Y to get a DLL for Windows builds, or a shared library (.so) on *nix builds. Run make install (you'll probably need to be root for this) to install the shared library.

In *BSD, use gmake or gmake WIDE=Y. Cross-compiling to Windows should be possible there as well.

For DOS/Windows, makefiles for Borland, Digital Mars, MSVC, and OpenWATCOM are provided, but are at the 'it works on my machine' stage, and haven't really been thoroughly vetted by others yet.

Caveats

VT-style sequences are partially supported in Windows 10 and 11. However, you get 16 colors (no RGB), the mouse does not necessarily work, and the console size cannot be determined or set. Use of the VT platform in Windows is therefore strongly discouraged; use WinGUI or WinCon instead.

This code will usually figure out the capabilities of the underlying terminal. It errs on the conservative side and may not recognize what your terminal can actually do. If it doesn't think full RGB coloring is supported, then RGB colors will be remapped to the 6x6x6 color cube. If that happens (resulting in slightly ugly coloring), you can tell PDCurses you really do have true color by setting

PDC_VT=RGB

export PDC_VT

Note that you can explain to PDCurses more capabilities of the terminal, e.g.,

PDC_VT=RGB UNDERLINE BLINK DIM STANDOUT

to say that the underlying terminal supports true-color, underlined, blinking, dimmed, and 'standout' text. (The Right Thing to Do here would be to dig around in the terminfo database, as ncurses does, both to know the control sequences to use and the actual capabilities of the terminal.)

Arrow keys and some function keys are recognized (see the tbl array in pdckey.c). Some mouse input is recognized. Shift, Ctrl, and Alt function keys and arrows are (mostly) not correctly identified; I've not figured out how those keys are supposed to be detected yet. Or if they can be. None of the 'extended' keys found on some keyboards, such as Browser Back/Forward, Search, Refresh, Stop, etc., are detected, on any platform.

Clipboard functions are currently completely absent on this platform. I expect to be able to add clipboard functions for Windows by recycling code from the Windows GUI and console flavors, and have clipboard access code for X11 that is not yet included here.

Distribution Status

The files in this directory are released to the Public Domain.