词条 | GNU Readline |
释义 |
| name = GNU Readline | logo = Heckert GNU white.svg | author = Brian Fox | developer = Chet Ramey | released = {{start date and age|1989}} | latest release version = 7.0 | latest release date = {{Start date and age|2016|09|15}} | latest preview version = | latest preview date = | programming language = C | genre = Library | license = GNU General Public License | website = {{URL|https://tiswww.case.edu/php/chet/readline/rltop.html}} }} GNU Readline is a software library that provides line-editing and history capabilities for interactive programs with a command-line interface, such as Bash. It is currently maintained by Chet Ramey as part of the GNU Project. It allows users to move the text cursor, search the command history, control a kill ring (a more flexible version of a copy/paste clipboard) and use tab completion on a text terminal. As a cross-platform library, readline allows applications on various systems to exhibit identical line-editing behavior. Editing modesReadline supports both Emacs and vi editing modes, which determine how keyboard input is interpreted as editor commands. See Editor war#Differences between vi and Emacs. Emacs keyboard shortcutsEmacs editing mode key bindings are taken from the text editor Emacs. On some systems, {{key press|Esc}} must be used instead of {{key press|Alt}}, because the {{key press|Alt}} shortcut conflicts with another shortcut. For example, pressing {{key press|Alt|f}} in Xfce's terminal emulator window does not move the cursor forward one word, but activates "File" in the menu of the terminal window, unless that is disabled in the emulator's settings.
Choice of the GPL as GNU Readline's licenseGNU Readline is notable for being a free software library which is licensed under the GNU General Public License (GPL). Free software libraries are far more often licensed under the GNU Lesser General Public License (LGPL), for example, the GNU C Library, GNU gettext and FLTK. A developer of an application who chooses to link to an LGPL licensed library can use any license for the application.[1] But linking to a GPL licensed library such as Readline requires the entire combined resulting application to be licensed under the GPL when distributed, to comply with section 5 of the GPL.[2][3] This licensing was chosen by the FSF on the hopes that it would encourage software to switch to the GPL.{{cn|date=March 2019}} An important example of an application changing its licensing to comply with the copyleft conditions of GNU Readline is CLISP, an implementation of Common Lisp. Originally released in 1987, it changed to the GPL license in 1992,[4] after an email exchange between one of CLISP's original authors, Bruno Haible, and Richard Stallman, in which Stallman argued[5] that the linking of readline in CLISP meant that Haible was required to re-license CLISP under the GPL if he wished to distribute the implementation of CLISP which used readline.[6] Another response has been to not use this in some projects, making text input use the primitive Unix terminal driver for editing. Alternative libraries have been created with other licenses so they can be used by software projects which want to implement command line editing functionality, but be released with a non-GPL license. Typical among these is the BSD-licensed libedit. Some applications, such as MariaDB[7] or PHP[8], allow for the user to select at build time whether to link with GNU Readline or with libedit. Other command-line editing libraries serve a dual purpose: they have APIs which align those of some main project and have compatible license terms. An example of this is the Haskeline library, which exposes a Haskell-compatible API to both the Glasgow Haskell Compiler[9] and to other Haskell projects which need line-editing services.[10] Sample codeThe following code is in C and must be linked against the readline library by passing a -lreadline flag to the compiler: Notes and references1. ^{{cite web|url=https://www.gnu.org/copyleft/lesser.html|title=GNU Lesser General Public License|year=2007|work=The GNU Lesser General Public License v3.0 - GNU Project|publisher=Free Software Foundation|accessdate=2011-09-03}} 2. ^{{cite web|url=https://www.gnu.org/licenses/gpl-3.0.html|title=GNU General Public License|year=2007|work=The GNU General Public License v3.0 - GNU Project|publisher=Free Software Foundation|accessdate=2011-09-03}} 3. ^{{cite web|url=https://www.gnu.org/licenses/gpl-faq.html#IfLibraryIsGPL|title=Frequently Asked Questions about the GNU licenses|year=2010|work=Frequently Asked Questions about the GNU Licenses - GNU Project|publisher=Free Software Foundation|accessdate=2011-09-03}} 4. ^{{cite web|url=http://clisp.cvs.sourceforge.net/viewvc/clisp/clisp/COPYRIGHT|title=CLISP copyright notice|year=1992|publisher=CLISP repository|accessdate=2011-09-03}} 5. ^{{cite web|url=http://clisp.cvs.sourceforge.net/viewvc/clisp/clisp/doc/Why-CLISP-is-under-GPL|title=Why CLISP is under GPL|year=1992|publisher=CLISP repository|accessdate=2011-09-03}} 6. ^{{cite web|url=http://www.clisp.org/impnotes/faq.html#faq-gpl|title=License - why GNU GPL?|work=Frequently Asked Questions (With Answers) about CLISP|publisher=CLISP team|accessdate=2011-09-03}} 7. ^{{cite web|url=https://github.com/MariaDB/server/blob/10.2/BUILD/SETUP.sh|title=MariaDB/server/blob/10.2/BUILD/SETUP.sh|work=MariaDB repository|publisher=MariaDB Foundation|accessdate=2017-10-24}} 8. ^{{cite web|url=https://github.com/php/php-src/tree/master/ext/readline|title=php/php-src/tree/master/ext/readline|work=PHP repository|publisher=The PHP Group|accessdate=2017-10-24}} 9. ^{{cite web|url=https://wiki.haskell.org/Applications_and_libraries|title=Applications and libraries|work=Haskell wiki|publisher=haskell.org|accessdate=2017-10-24}} 10. ^{{cite web|url=https://github.com/judah/haskeline|title=judah/haskeline: A Haskell library for line input in command-line programs|work=Haskeline repository|author=Judah Jacobson|accessdate=2017-10-24}} External links{{Portal|Free and open-source software}}
3 : Free software programmed in C|GNU Project software|Text user interface libraries |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。