2014-10-14 00:08:15 +02:00
|
|
|
termo
|
|
|
|
=====
|
2014-10-09 23:47:24 +02:00
|
|
|
|
2016-03-14 21:05:43 +01:00
|
|
|
'termo' is a library providing an alternative to ncurses' handling of terminal
|
2020-10-26 14:09:53 +01:00
|
|
|
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.
|
2014-10-09 23:47:24 +02:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2020-10-26 14:09:53 +01:00
|
|
|
The API can be considered stable. This project is in maintenance mode.
|
2014-10-09 23:47:24 +02:00
|
|
|
|
|
|
|
Building and Installing
|
|
|
|
-----------------------
|
2020-10-26 13:52:55 +01:00
|
|
|
Build dependencies: cmake >= 3.0, pkg-config +
|
2014-10-09 23:47:24 +02:00
|
|
|
Optional dependencies: Unibilium (alternative for curses), GLib (for the demos)
|
|
|
|
|
2018-06-24 01:05:45 +02:00
|
|
|
$ git clone https://git.janouch.name/p/termo.git
|
2015-09-27 01:20:11 +02:00
|
|
|
$ mkdir termo/build
|
|
|
|
$ cd termo/build
|
2015-02-26 22:59:41 +01:00
|
|
|
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug
|
2014-10-09 23:47:24 +02:00
|
|
|
|
|
|
|
To install the library, you can do either the usual:
|
2015-09-27 01:26:24 +02:00
|
|
|
|
2015-02-26 22:59:41 +01:00
|
|
|
# make install
|
2014-10-09 23:47:24 +02:00
|
|
|
|
|
|
|
Or you can try telling CMake to make a package for you. For Debian it is:
|
2015-09-27 01:26:24 +02:00
|
|
|
|
2014-10-09 23:47:24 +02:00
|
|
|
$ cpack -G DEB
|
2014-10-14 00:08:15 +02:00
|
|
|
# dpkg -i termo-*.deb
|
2014-10-09 23:47:24 +02:00
|
|
|
|
|
|
|
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?
|
|
|
|
-------------------------------------------
|
2016-12-30 08:30:59 +01:00
|
|
|
The main change is throwing out any UTF-8 dependent code, making the library
|
2014-10-09 23:47:24 +02:00
|
|
|
capable of handling all unibyte and multibyte encodings supported by iconv on
|
2014-10-14 00:08:15 +02:00
|
|
|
your system. The characters are still presented as Unicode in the end, however,
|
2014-10-09 23:47:24 +02:00
|
|
|
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
|
|
|
|
|
2014-11-19 02:47:28 +01:00
|
|
|
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.
|
2015-09-27 01:26:24 +02:00
|
|
|
You can have a look at 'demo-draw.c' for an example.
|
2014-11-19 02:47:28 +01:00
|
|
|
|
2014-10-09 23:47:24 +02:00
|
|
|
Another change worth mentioning is the usage of CMake instead of the problematic
|
2015-09-27 01:26:24 +02:00
|
|
|
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.
|
2014-10-09 23:47:24 +02:00
|
|
|
|
|
|
|
The rest is just me going silly over formatting and various unimportant stuff.
|
2020-10-26 14:09:53 +01:00
|
|
|
Oh, and I've deleted the manpages.
|
2014-10-09 23:47:24 +02:00
|
|
|
|
2015-09-27 01:20:11 +02:00
|
|
|
Contributing and Support
|
|
|
|
------------------------
|
2018-06-24 01:05:45 +02:00
|
|
|
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.
|
2015-09-27 01:20:11 +02:00
|
|
|
|
2018-06-24 01:05:45 +02:00
|
|
|
Bitcoin donations are accepted at: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9
|
2017-06-20 06:36:07 +02:00
|
|
|
|
2014-10-09 23:47:24 +02:00
|
|
|
License
|
|
|
|
-------
|
2015-09-27 01:26:24 +02:00
|
|
|
'termo' is based on the 'termkey' library, originally written by Paul Evans
|
2020-09-14 15:20:50 +02:00
|
|
|
<leonerd@leonerd.org.uk>, with additional changes made by Přemysl Eric Janouch
|
2018-06-24 01:05:34 +02:00
|
|
|
<p@janouch.name>.
|
2014-10-09 23:47:24 +02:00
|
|
|
|
|
|
|
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.
|