GithubHelp home page GithubHelp logo

linecode / replxx Goto Github PK

View Code? Open in Web Editor NEW

This project forked from amokhuginnsson/replxx

0.0 1.0 0.0 699 KB

A readline and libedit replacement that supports UTF-8, syntax highlighting, hints and Windows and is BSD licensed.

License: Other

CMake 1.85% Shell 0.22% C 5.57% C++ 72.08% Python 20.28%

replxx's Introduction

Read Evaluate Print Loop ++

demo

Build Status

A small, portable GNU readline replacement for Linux, Windows and MacOS which is capable of handling UTF-8 characters. Unlike GNU readline, which is GPL, this library uses a BSD license and can be used in any kind of program.

Origin

This replxx implementation is based on the work by ArangoDB Team and Salvatore Sanfilippo and 10gen Inc. The goal is to create a zero-config, BSD licensed, readline replacement usable in Apache2 or BSD licensed programs.

Features

  • single-line and multi-line editing mode with the usual key bindings implemented
  • history handling
  • completion
  • syntax highlighting
  • hints
  • BSD license source code
  • Only uses a subset of VT100 escapes (ANSI.SYS compatible)
  • UTF8 aware
  • support for Linux, MacOS and Windows

It deviates from Salvatore's original goal to have a minimal readline replacement for the sake of supporting UTF8 and Windows. It deviates from 10gen Inc.'s goal to create a C++ interface to linenoise. This library uses C++ internally, but to the user it provides a pure C interface that is compatible with the original linenoise API. C interface.

Requirements

To build this library, you will need a C++11-enabled compiler and some recent version of CMake.

Build instructions

*nix

  1. Create a build directory
mkdir -p build && cd build
  1. Build the library
cmake -DCMAKE_BUILD_TYPE=Release .. && make
  1. Install the library at the default target location
sudo make install

The default installation location can be adjusted by setting the DESTDIR variable when invoking make install:

make DESTDIR=/tmp install

Windows

  1. Create a build directory in MS-DOS command prompt
md build
cd build
  1. Generate Visual Studio solution file with cmake
  • 32 bit:
cmake -G "Visual Studio 12 2013" -DCMAKE_BUILD_TYPE=Release ..`
  • 64 bit:
`cmake -G "Visual Studio 12 2013 Win64" -DCMAKE_BUILD_TYPE=Release ..`
  1. Open the generated file replxx.sln in the build subdirectory with Visual Studio.

Tested with...

  • Linux text only console ($TERM = linux)
  • Linux KDE terminal application ($TERM = xterm)
  • Linux xterm ($TERM = xterm)
  • Linux Buildroot ($TERM = vt100)
  • Mac OS X iTerm ($TERM = xterm)
  • Mac OS X default Terminal.app ($TERM = xterm)
  • OpenBSD 4.5 through an OSX Terminal.app ($TERM = screen)
  • IBM AIX 6.1
  • FreeBSD xterm ($TERM = xterm)
  • ANSI.SYS
  • Emacs comint mode ($TERM = dumb)
  • Windows

Please test it everywhere you can and report back!

Let's push this forward!

Patches should be provided in the respect of linenoise sensibility for small and easy to understand code that and the license restrictions. Extensions must be submitted under a BSD license-style. A contributor license is required for contributions.

replxx's People

Contributors

ajg avatar amokhuginnsson avatar antirez avatar blattersturm avatar bsutherland avatar fceller avatar firodj avatar fperrad avatar gainspeed avatar gdimitrov-vmware avatar gilzoide avatar gsserge avatar jhanssen avatar johncoconut avatar jsteemann avatar ksherlock avatar martinnowak avatar octobanana avatar octplane avatar olegator77 avatar pietern avatar polch avatar shengwen-tw avatar shvechikov avatar spullara avatar yury avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.