You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # Read Evaluate Print Loop ++
  2. ![demo](https://drive.google.com/uc?export=download&id=0B53g2Y3z7rWNT2dCRGVVNldaRnc)
  3. [![Build Status](https://travis-ci.org/AmokHuginnsson/replxx.svg?branch=master)](https://travis-ci.org/AmokHuginnsson/replxx)
  4. A small, portable GNU readline replacement for Linux, Windows and
  5. MacOS which is capable of handling UTF-8 characters. Unlike GNU
  6. readline, which is GPL, this library uses a BSD license and can be
  7. used in any kind of program.
  8. ## Origin
  9. This replxx implementation is based on the work by
  10. [ArangoDB Team](https://github.com/arangodb/linenoise-ng) and
  11. [Salvatore Sanfilippo](https://github.com/antirez/linenoise) and
  12. 10gen Inc. The goal is to create a zero-config, BSD
  13. licensed, readline replacement usable in Apache2 or BSD licensed
  14. programs.
  15. ## Features
  16. * single-line and multi-line editing mode with the usual key bindings implemented
  17. * history handling
  18. * completion
  19. * syntax highlighting
  20. * hints
  21. * BSD license source code
  22. * Only uses a subset of VT100 escapes (ANSI.SYS compatible)
  23. * UTF8 aware
  24. * support for Linux, MacOS and Windows
  25. It deviates from Salvatore's original goal to have a minimal readline
  26. replacement for the sake of supporting UTF8 and Windows. It deviates
  27. from 10gen Inc.'s goal to create a C++ interface to linenoise. This
  28. library uses C++ internally, but to the user it provides a pure C
  29. interface that is compatible with the original linenoise API.
  30. C interface.
  31. ## Requirements
  32. To build this library, you will need a C++11-enabled compiler and
  33. some recent version of CMake.
  34. ## Build instructions
  35. ### *nix
  36. 1. Create a build directory
  37. ```bash
  38. mkdir -p build && cd build
  39. ```
  40. 2. Build the library
  41. ```bash
  42. cmake -DCMAKE_BUILD_TYPE=Release .. && make
  43. ```
  44. 3. Install the library at the default target location
  45. ```bash
  46. sudo make install
  47. ```
  48. The default installation location can be adjusted by setting the `DESTDIR`
  49. variable when invoking `make install`:
  50. ```bash
  51. make DESTDIR=/tmp install
  52. ```
  53. ### Windows
  54. 1. Create a build directory in MS-DOS command prompt
  55. ```
  56. md build
  57. cd build
  58. ```
  59. 2. Generate Visual Studio solution file with cmake
  60. * 32 bit:
  61. ```bash
  62. cmake -G "Visual Studio 12 2013" -DCMAKE_BUILD_TYPE=Release ..`
  63. ```
  64. * 64 bit:
  65. ```bash
  66. `cmake -G "Visual Studio 12 2013 Win64" -DCMAKE_BUILD_TYPE=Release ..`
  67. ```
  68. 3. Open the generated file `replxx.sln` in the `build` subdirectory with Visual Studio.
  69. ## Tested with...
  70. * Linux text only console ($TERM = linux)
  71. * Linux KDE terminal application ($TERM = xterm)
  72. * Linux xterm ($TERM = xterm)
  73. * Linux Buildroot ($TERM = vt100)
  74. * Mac OS X iTerm ($TERM = xterm)
  75. * Mac OS X default Terminal.app ($TERM = xterm)
  76. * OpenBSD 4.5 through an OSX Terminal.app ($TERM = screen)
  77. * IBM AIX 6.1
  78. * FreeBSD xterm ($TERM = xterm)
  79. * ANSI.SYS
  80. * Emacs comint mode ($TERM = dumb)
  81. * Windows
  82. Please test it everywhere you can and report back!
  83. ## Let's push this forward!
  84. Patches should be provided in the respect of linenoise sensibility for
  85. small and easy to understand code that and the license
  86. restrictions. Extensions must be submitted under a BSD license-style.
  87. A contributor license is required for contributions.