xaizek / libcursedrl (License: GPLv3+) (since 2019-03-24)
libcursed extension for integration with readline.
<root> / README.md (22af12127b12b875f3f00b8dae11424591b2fb31) (1,902B) (mode 100644) [raw]
**libcursedrl**, _2019 -- 2022_

_This file last updated on 1 January, 2022_

### Brief Description ###

This is a C++11 library that integrates [GNU Readline library][readline] into
[*libcursed*][libcursed] (provides classes for using
[*curses* library][curses]).

The library should never pull in any *readline* headers via its headers nor
clients should have to include them in order to use the library.
They uses some very generic names, some of which are macros, all of which can
cause conflicts in completely unrelated code.

#### Implementation state ####

It was created for a couple of projects, has minimally necessary functionality
and can change quite a bit in the future.

#### Throw-in library state ####

To use it clone the repository (possibly as a submodule) and handle the building
with the build system that's used by the main project.  Compile with C++11
enabled and headers of *libcursed* available under `cursed/` prefix.  Obviously
link in *libcursed* and link against `readline`.

Alternatively one can use [xmake][xmake] to consume submodule as a
subproject (example assumes it's stored under `libs/`):
```
add_includedirs("libs")
includes("libs/*/xmake.lua")
```

### Prerequisites ###

* C++11 capable compiler
* [GNU Readline library][readline]
* [*libcursed*][libcursed]

### Structure ###

The library doesn't provide a widget, instead it accepts reference to one
created and placed on the screen by the client.  It automatically updates and
resizes the screen while handling input.

### What's available ###

* Loading/saving history.
* Updating history with input.
* Cancellation on Escape key.
* Completion callback.
* Callback on input change.

[libcursed]: https://code.reversed.top/user/xaizek/libcursed
[curses]: https://en.wikipedia.org/wiki/Curses_(programming_library)
[readline]: https://tiswww.case.edu/php/chet/readline/rltop.html
[xmake]: https://xmake.io/
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/libcursedrl

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/libcursedrl

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master