xaizek / libcursedrl (License: GPLv3+) (since 2019-03-24)
libcursed extension for integration with readline.
File Mode Size
PromptRequest.cpp 100644 7,989B
PromptRequest.hpp 100644 4,487B
README.md 100644 1,752B

/README.md

libcursedrl, 2019

This file last updated on 24 March, 2019

Brief Description

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

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

There is no build system and nothing is getting built for the client. 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.

Prerequisites

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.
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