Přemysl Eric Janouch
||11 months ago|
|cmake||2 years ago|
|tests||11 months ago|
|.clang-format||11 months ago|
|.gitignore||11 months ago|
|CMakeLists.txt||2 years ago|
|LICENSE||1 year ago|
|README.adoc||2 years ago|
|config-version.cmake.in||8 years ago|
|config.cmake.in||8 years ago|
|demo-async.c||8 years ago|
|demo-draw.c||8 years ago|
|demo-glib.c||6 years ago|
|demo.c||11 months ago|
|driver-csi.c||2 years ago|
|driver-ti.c||11 months ago|
|termo-config.h.in||2 years ago|
|termo-internal.h||7 years ago|
|termo.c||11 months ago|
|termo.h||2 years ago|
termo is a library providing an alternative to ncurses' handling of terminal input. ncurses does a terrible job at that, mainly wrt. mouse support which was even completely broken for a few years, making it impossible to drag things around in applications. While that one bit has been fixed, it continues to lack support for rxvt-unicode’s 1015 mode and it’s generally incapable of relaying certain key combinations.
Since terminal I/O is really complicated and full of special cases, this project doesn’t aspire to also replace the output part of ncurses, but is rather complementary to it. In the end it makes use of its terminfo library.
The API can be considered stable. This project is in maintenance mode.
Building and Installing
Build dependencies: cmake >= 3.0, pkg-config
Optional dependencies: Unibilium (alternative for curses), GLib (for the demos)
$ git clone https://git.janouch.name/p/termo.git $ mkdir termo/build $ cd termo/build $ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug
To install the library, you can do either the usual:
# make install
Or you can try telling CMake to make a package for you. For Debian it is:
$ cpack -G DEB # dpkg -i termo-*.deb
To see the library in action, you can try running the demos, which are statically linked against the library, and hence they can be run as they are:
$ make demos
What’s Different From the Original termkey?
The main change is throwing out any UTF-8 dependent code, making the library capable of handling all unibyte and multibyte encodings supported by iconv on your system. The characters are still presented as Unicode in the end, however, as the other sensible option is wchar_t and that doesn’t really work well, see http://gnu.org/software/libunistring/manual/libunistring.html#The-wchar_005ft-mess
To make the mouse parsing support actually useful, some API has been added to set the proper modes on request, and unset them appropriately while destroying. You can have a look at demo-draw.c for an example.
Another change worth mentioning is the usage of CMake instead of the problematic libtool-based Makefile. Now you can include this project in your other CMake-based projects and simply import the target. No package maintainer action is needed for you to enjoy the benefits of proper terminal input.
The rest is just me going silly over formatting and various unimportant stuff. Oh, and I’ve deleted the manpages.
Contributing and Support
Use https://git.janouch.name/p/termo to report any bugs, request features,
or submit pull requests.
git send-email is tolerated. If you want to discuss
the project, feel free to join me at ircs://irc.janouch.name, channel #dev.
Bitcoin donations are accepted at: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9
termo is based on the termkey library, originally written by Paul Evans <firstname.lastname@example.org>, with additional changes made by Přemysl Eric Janouch <email@example.com>.
You may use the software under the terms of the MIT license, the text of which is included within the package, see the file LICENSE.