xaizek / libcursedrl (License: GPLv3+) (since 2019-03-24)
libcursed extension for integration with readline.
File Mode Size
PromptRequest.cpp 100644 8,604B
PromptRequest.hpp 100644 4,447B
README.md 100644 1,902B
xmake.lua 100644 491B

/README.md

libcursedrl, 2019 -- 2022

This file last updated on 1 January, 2022

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

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 to consume submodule as a subproject (example assumes it's stored under libs/):

add_includedirs("libs")
includes("libs/*/xmake.lua")

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