{
    "content": [
        {
            "type": "text",
            "text": "# Term::ReadLine::Gnu (perldoc)\n\n## NAME\n\nTerm::ReadLine::Gnu - Perl extension for the GNU Readline/History Library\n\n## SYNOPSIS\n\nuse Term::ReadLine;   # Do not \"use Term::ReadLine::Gnu;\"\n$term = new Term::ReadLine 'ProgramName';\nwhile ( defined ($ = $term->readline('prompt>')) ) {\n...\n}\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION** (7 subsections)\n- **FILES**\n- **EXPORTS**\n- **ENVIRONMENT**\n- **SEE ALSO**\n- **AUTHOR**\n- **TODO**\n- **BUGS**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Term::ReadLine::Gnu",
        "section": "",
        "mode": "perldoc",
        "summary": "Term::ReadLine::Gnu - Perl extension for the GNU Readline/History Library",
        "synopsis": "use Term::ReadLine;   # Do not \"use Term::ReadLine::Gnu;\"\n$term = new Term::ReadLine 'ProgramName';\nwhile ( defined ($ = $term->readline('prompt>')) ) {\n...\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Overview",
                        "lines": 20
                    },
                    {
                        "name": "Standard Methods",
                        "lines": 295
                    },
                    {
                        "name": "show_char",
                        "lines": 43
                    },
                    {
                        "name": "stuff_char",
                        "lines": 2
                    },
                    {
                        "name": "execute_next",
                        "lines": 51
                    },
                    {
                        "name": "alphabetic",
                        "lines": 378
                    },
                    {
                        "name": "Custom Completion",
                        "lines": 157
                    }
                ]
            },
            {
                "name": "FILES",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "EXPORTS",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 50,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "TODO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 7,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Term::ReadLine::Gnu - Perl extension for the GNU Readline/History Library\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Term::ReadLine;   # Do not \"use Term::ReadLine::Gnu;\"\n$term = new Term::ReadLine 'ProgramName';\nwhile ( defined ($ = $term->readline('prompt>')) ) {\n...\n}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "",
                "subsections": [
                    {
                        "name": "Overview",
                        "content": "This is an implementation of Term::ReadLine <http://search.cpan.org/dist/Term-ReadLine/> using\nthe GNU Readline/History Library <https://tiswww.cwru.edu/php/chet/readline/rltop.html>.\n\nFor basic functions object oriented interface is provided. These are described in the section\n\"Standard Methods\" and \"\"Term::ReadLine::Gnu\" Functions\".\n\nThis package also has the interface with the almost all functions and variables which are\ndocumented in the GNU Readline/History Library Manual. They are documented in the section\n\"\"Term::ReadLine::Gnu\" Functions\" and \"\"Term::ReadLine::Gnu\" Variables\" briefly. For further\ndetails of the GNU Readline/History Library, see GNU Readline Library Manual\n<https://tiswww.cwru.edu/php/chet/readline/readline.html> and GNU History Library Manual\n<https://tiswww.cwru.edu/php/chet/readline/history.html>.\n\nThere are some \"Term::ReadLine::Gnu\" original features. They are described in the section\n\"\"Term::ReadLine::Gnu\" Specific Features\"\n\nThe sample programs under eg/ directory and test programs under t/ directory in the\n\"Term::ReadLine::Gnu\" distribution <http://search.cpan.org/dist/Term-ReadLine-Gnu/> include many\nexamples of this module.\n"
                    },
                    {
                        "name": "Standard Methods",
                        "content": "These are standard methods defined by Term::ReadLine\n<http://search.cpan.org/dist/Term-ReadLine/>.\n\n\"ReadLine\"\nreturns the actual package that executes the commands. If this package is being used,\n\"Term::ReadLine::Gnu\" is returned.\n\n\"new(NAME,[IN,OUT])\"\nreturns the handle for subsequent calls to following functions. Argument is the name of the\napplication. Optionally can be followed by two arguments for \"IN\" and \"OUT\" file handles.\nThese arguments should be globs.\n\n\"readline(PROMPT[,PREPUT])\"\ngets an input line, with actual \"GNU Readline\" support. Trailing newline is removed. Returns\n\"undef\" on \"EOF\". \"PREPUT\" is an optional argument meaning the initial value of input.\n\nThe optional argument \"PREPUT\" is granted only if the value \"preput\" is in \"Features\".\n\n\"PROMPT\" may include some escape sequences. Use \"RLPROMPTSTARTIGNORE\" to begin a sequence\nof non-printing characters, and \"RLPROMPTENDIGNORE\" to end the sequence.\n\n\"AddHistory(LINE1, LINE2, ...)\"\nadds the lines to the history of input, from where it can be used if the actual \"readline\"\nis present.\n\n\"IN\", \"OUT\"\nreturn the file handles for input and output or \"undef\" if \"readline\" input and output\ncannot be used for Perl.\n\n\"MinLine([MAX])\"\nIf argument \"MAX\" is specified, it is an advice on minimal size of line to be included into\nhistory. \"undef\" means do not include anything into history. Returns the old value.\n\n\"findConsole\"\nreturns an array with two strings that give most appropriate names for files for input and\noutput using conventions \"<$in\", \">$out\".\n\n\"Attribs\"\nreturns a reference to a hash which describes internal configuration (variables) of the\npackage. Names of keys in this hash conform to standard conventions with the leading \"rl\"\nstripped.\n\nSee section \"\"Term::ReadLine::Gnu\" Variables\" for supported variables.\n\n\"Features\"\nReturns a reference to a hash with keys being features present in current implementation.\nSeveral optional features are used in the minimal interface: \"appname\" should be present if\nthe first argument to \"new\" is recognized, and \"minline\" should be present if \"MinLine\"\nmethod is not dummy. \"autohistory\" should be present if lines are put into history\nautomatically (maybe subject to \"MinLine\"), and \"addHistory\" if \"AddHistory\" method is not\ndummy. \"preput\" means the second argument to \"readline\" method is processed. \"getHistory\"\nand \"setHistory\" denote that the corresponding methods are present. \"tkRunning\" denotes that\na Tk application may run while ReadLine is getting input.\n\n\"tkRunning\"\nmakes Tk event loop run when waiting for user input (i.e., during \"readline\" method).\n\n\"eventloop\"\nSee the description of \"eventloop\" on Term::ReadLine\n<http://search.cpan.org/dist/Term-ReadLine/>.\n\n\"ornaments\"\nmakes the command line stand out by using termcap data. The argument to \"ornaments\" should\nbe 0, 1, or a string of a form \"aa,bb,cc,dd\". Four components of this string should be names\nof *terminal capacities*, first two will be issued to make the prompt standout, last two to\nmake the input line standout.\n\n\"newTTY\"\ntakes two arguments which are input filehandle and output filehandle. Switches to use these\nfilehandles.\n\n\"enableUTF8\"\nEnables UTF-8 support.\n\nIf STDIN is in UTF-8 by the \"-C\" command-line switch or \"PERLUNICODE\" environment variable,\nor \"IN\" file handle has \"utf8\" IO layer, then UTF-8 support is also enabled. In other cases\nyou need this \"enableUTF8\" method.\n\nThis is an original method of \"Term::ReadLine:Gnu\".\n\n\"Term::ReadLine::Gnu\" Functions\nAll these GNU Readline/History Library functions supported are callable via method interface and\nhave names which conform to standard conventions with the leading \"rl\" stripped. For example\n\"rlfoo()\" function is called as \"$term->foo()\".\n\nThe titles of the following sections are same as the titles of the corresponding sections in the\n\"Programming with GNU Readline\" section in the GNU Readline Library Manual\n<https://tiswww.cwru.edu/php/chet/readline/readline.html>. Refer them for further details.\n\nAlthough it is preferred to use method interface, most methods have lower level functions in\n\"Term::ReadLine::Gnu::XS\" package. To use them a full qualified name is required.\n\nBasic Behavior\nThe function \"readline()\" prints a prompt and then reads and returns a single line of text from\nthe user.\n\n$ = $term->readline('Enter a line: ');\n\nYou can change key-bindings using \"bindkey(KEY, FUNCTION [,MAP])\" function. The first argument,\n\"KEY\", is the character that you want bind. The second argument, \"FUNCTION\", is the function to\ncall when \"KEY\" is pressed. The \"FUNCTION\" can be a reference to a Perl function (see \"Custom\nFunctions\") or a \"named function\" named by \"adddefun()\" function or commands described in the\n\"Bindable Readline Commands\" section in the GNU Readline Library Manual\n<https://tiswww.cwru.edu/php/chet/readline/readline.html>.\n\n$term->bindkey(ord \"\\ci, 'tab-insert');\n\nThe above example binds Control-I to the 'tab-insert' command.\n\nCustom Functions\nYou can write new functions using Perl. The calling sequence for a command foo looks like\n\nsub foo ($count, $key) { ... }\n\nwhere $count is the numeric argument (or 1 if defaulted) and $key is the key that invoked this\nfunction.\n\nHere is an example;\n\nsub reverseline {              # reverse a whole line\nmy($count, $key) = @;      # ignored in this sample function\n\n$t->modifying(0, $a->{end}); # save undo information\n$a->{linebuffer} = reverse $a->{linebuffer};\n}\n\nSee the \"Writing a New Function\" section in the GNU Readline Library Manual\n<https://tiswww.cwru.edu/php/chet/readline/readline.html> for further details.\n\nReadline Convenience Functions\nNaming a Function\n\"adddefun(NAME, FUNCTION [,KEY=-1])\"\nAdd name to a Perl function \"FUNCTION\". If optional argument \"KEY\" is specified, bind it to\nthe \"FUNCTION\". Returns reference to \"FunctionPtr\".\n\nExample:\n# name `reverse-line' to a function reverseline(),\n# and bind it to \"\\C-t\"\n$term->adddefun('reverse-line', \\&reverseline, ord \"\\ct\");\n\nSelecting a Keymap\n\"makebarekeymap\"\nKeymap  rlmakebarekeymap()\n\n\"copykeymap(MAP)\"\nKeymap  rlcopykeymap(Keymap|str map)\n\n\"makekeymap\"\nKeymap  rlmakekeymap()\n\n\"discardkeymap(MAP)\"\nKeymap  rldiscardkeymap(Keymap|str map)\n\n\"freekeymap(MAP)\"\nvoid    rlfreekeymap(Keymap|str map)\n\n\"emptykeymap(MAP)\"\nint     rlemptykeymap(Keymap|str map)                 # GRL 8.0\n\n\"getkeymap\"\nKeymap  rlgetkeymap()\n\n\"setkeymap(MAP)\"\nKeymap  rlsetkeymap(Keymap|str map)\n\n\"getkeymapbyname(NAME)\"\nKeymap  rlgetkeymapbyname(str name)\n\n\"getkeymapname(MAP)\"\nstr     rlgetkeymapname(Keymap map)\n\n\"setkeymapname(NAME, MAP)\"\nint     rlsetkeymapname(str name, Keymap|str map)    # GRL 8.0\n\nBinding Keys\n\"bindkey(KEY, FUNCTION [,MAP])\"\nint     rlbindkey(int key, FunctionPtr|str function,\nKeymap|str map = rlgetkeymap())\n\nBind \"KEY\" to the \"FUNCTION\". \"FUNCTION\" is the name added by the \"adddefun\" method. If\noptional argument \"MAP\" is specified, binds in \"MAP\". Returns non-zero in case of error.\n\n\"bindkeyifunbound(KEY, FUNCTION [,MAP])\"\nint     rlbindkeyifunbound(int key, FunctionPtr|str function,\nKeymap|str map = rlgetkeymap()) # GRL 5.0\n\n\"unbindkey(KEY [,MAP])\"\nint     rlunbindkey(int key, Keymap|str map = rlgetkeymap())\n\nBind \"KEY\" to the null function. Returns non-zero in case of error.\n\n\"unbindfunction(FUNCTION [,MAP])\"\nint     rlunbindfunction(FunctionPtr|str function,\nKeymap|str map = rlgetkeymap())\n\n\"unbindcommand(COMMAND [,MAP])\"\nint     rlunbindcommand(str command,\nKeymap|str map = rlgetkeymap())\n\n\"bindkeyseq(KEYSEQ, FUNCTION [,MAP])\"\nint     rlbindkeyseq(str keyseq, FunctionPtr|str function,\nKeymap|str map = rlgetkeymap()) # GRL 5.0\n\n\"setkey(KEYSEQ, FUNCTION [,MAP])\"\nint     rlsetkey(str keyseq, FunctionPtr|str function,\nKeymap|str map = rlgetkeymap())    # GRL 4.2\n\n\"bindkeyseqifunbound(KEYSEQ, FUNCTION [,MAP])\"\nint     rlbindkeyseqifunbound(str keyseq, FunctionPtr|str function,\nKeymap|str map = rlgetkeymap()) # GRL 5.0\n\n\"genericbind(TYPE, KEYSEQ, DATA, [,MAP])\"\nint     rlgenericbind(int type, str keyseq,\nFunctionPtr|Keymap|str data,\nKeymap|str map = rlgetkeymap())\n\n\"parseandbind(LINE)\"\nvoid    rlparseandbind(str line)\n\nParse \"LINE\" as if it had been read from the ~/.inputrc file and perform any key bindings\nand variable assignments found. For further detail see GNU Readline Library Manual\n<https://tiswww.cwru.edu/php/chet/readline/readline.html>.\n\n\"readinitfile([FILENAME])\"\nint     rlreadinitfile(str filename = '~/.inputrc')\n\nAssociating Function Names and Bindings\n\"namedfunction(NAME)\"\nFunctionPtr rlnamedfunction(str name)\n\n\"getfunctionname(FUNCTION)\"\nstr     rlgetfunctionname(FunctionPtr function)      # TRG original\n\n\"functionofkeyseq(KEYSEQ [,MAP])\"\n(FunctionPtr|Keymap|str data, int type)\nrlfunctionofkeyseq(str keyseq,\nKeymap|str map = rlgetkeymap())\n\n\"invokingkeyseqs(FUNCTION [,MAP])\"\n(@str)  rlinvokingkeyseqs(FunctionPtr|str function,\nKeymap|str map = rlgetkeymap())\n\n\"functiondumper([READABLE])\"\nvoid    rlfunctiondumper(int readable = 0)\n\n\"listfunmapnames\"\nvoid    rllistfunmapnames()\n\n\"funmapnames\"\n(@str)  rlfunmapnames()\n\n\"addfunmapentry(NAME, FUNCTION)\"\nint     rladdfunmapentry(char *name, FunctionPtr|str function)\n\nAllowing Undoing\n\"beginundogroup\"\nint     rlbeginundogroup()\n\n\"endundogroup\"\nint     rlendundogroup()\n\n\"addundo(WHAT, START, END, TEXT)\"\nint     rladdundo(int what, int start, int end, str text)\n\n\"freeundolist\"\nvoid    rlfreeundolist()\n\n\"doundo\"\nint     rldoundo()\n\n\"modifying([START [,END]])\"\nint     rlmodifying(int start = 0, int end = rlend)\n\nRedisplay\n\"redisplay\"\nvoid    rlredisplay()\n\n\"forcedupdatedisplay\"\nint     rlforcedupdatedisplay()\n\n\"onnewline\"\nint     rlonnewline()\n\n\"onnewlinewithprompt\"\nint     rlonnewlinewithprompt()                    # GRL 4.1\n\n\"clearvisibleline()\"\nint     rlclearvisibleline()                         # GRL 7.0\n\n\"resetlinestate\"\nint     rlresetlinestate()\n\n\"crlf\"\nint     rlcrlf()\n"
                    },
                    {
                        "name": "show_char",
                        "content": "int     rlshowchar(int c)\n\n\"message(FMT[, ...])\"\nint     rlmessage(str fmt, ...)\n\n\"clearmessage\"\nint     rlclearmessage()\n\n\"saveprompt\"\nvoid    rlsaveprompt()\n\n\"restoreprompt\"\nvoid    rlrestoreprompt()\n\n\"expandprompt(PROMPT)\"\nint     rlexpandprompt(str prompt)\n\n\"setprompt(PROMPT)\"\nint     rlsetprompt(const str prompt)                 # GRL 4.2\n\nModifying Text\n\"inserttext(TEXT)\"\nint     rlinserttext(str text)\n\n\"deletetext([START [,END]])\"\nint     rldeletetext(int start = 0, int end = rlend)\n\n\"copytext([START [,END]])\"\nstr     rlcopytext(int start = 0, int end = rlend)\n\n\"killtext([START [,END]])\"\nint     rlkilltext(int start = 0, int end = rlend)\n\n\"pushmacroinput(MACRO)\"\nint     rlpushmacroinput(str macro)\n\nCharacter Input\n\"readkey\"\nint     rlreadkey()\n\n\"getc(STREAM)\"\nint     rlgetc(FILE *STREAM)\n"
                    },
                    {
                        "name": "stuff_char",
                        "content": "int     rlstuffchar(int c)\n"
                    },
                    {
                        "name": "execute_next",
                        "content": "int     rlexecutenext(int c)\n\n\"clearpendinginput()\"\nint     rlclearpendinginput()                        # GRL 4.2\n\n\"setkeyboardinputtimeout(uSEC)\"\nint     rlsetkeyboardinputtimeout(int usec)         # GRL 4.2\n\nTerminal Management\n\"prepterminal(METAFLAG)\"\nvoid    rlprepterminal(int METAFLAG)\n\n\"deprepterminal()\"\nvoid    rldeprepterminal()\n\n\"ttysetdefaultbindings([MAP])\"\nvoid    rlttysetdefaultbindings([Keymap|str map = rlgetkeymap()]) # GRL 4.0\n\n\"ttyunsetdefaultbindings([MAP])\"\nvoid    rlttyunsetdefaultbindings([Keymap|str map = rlgetkeymap()]) # GRL 5.0\n\n\"ttysetechoing(VALUE)\"\nint     rlttysetechoing(int value)                   # GRL 7.0\n\n\"resetterminal([TERMINALNAME])\"\nint     rlresetterminal(str terminalname = getenv($TERM))\n\nUtility Functions\n\"savestate(READLINESTATE)\"\nREADLINESTATE  rlsavestate()                         # GRL 6.0\n\n\"restorestate(READLINESTATE)\"\nint     rlrestorestate(READLINESTATE)                # GRL 6.0\n\n\"free(MEM)\"\nNot implemented since not required for Perl.\nint     rlfree(void *mem)                              # GRL 6.0\n\n\"replaceline(TEXT [,CLEARUNDO])\"\nint     rlreplaceline(str text, int clearundo = 0)   # GRL 4.3\n\n\"extendlinebuffer(LEN)\"\nNot implemented since not required for Perl.\nint     rlextendlinebuffer(int len)\n\n\"initialize\"\nint     rlinitialize()\n\n\"ding\"\nint     rlding()\n"
                    },
                    {
                        "name": "alphabetic",
                        "content": "int     rlalphabetic(int C)                            # GRL 4.2\n\n\"displaymatchlist(MATCHES [,LEN [,MAX]])\"\nvoid    rldisplaymatchlist(\\@matches, len = $#maches, max) # GRL 4.0\n\nSince the first element of an array @matches as treated as a possible completion, it is not\ndisplayed. See the descriptions of \"completionmatches()\". When \"MAX\" is omitted, the max\nlength of an item in @matches is used.\n\nMiscellaneous Functions\n\"macrobind(KEYSEQ, MACRO [,MAP])\"\nint     rlmacrobind(const str keyseq, const str macro, Keymap map)\n\n\"macrodumper(READABLE)\"\nint     rlmacrodumper(int readline)\n\n\"variablebind(VARIABLE, VALUE)\"\nint     rlvariablebind(const str variable, const str value)\n\n\"variablevalue(VARIABLE)\"\nstr     rlvariablevalue(const str variable)           # GRL 5.1\n\n\"variabledumper(READABLE)\"\nint     rlvariabledumper(int readline)\n\n\"setparenblinktimeout(uSEC)\"\nint     rlsetparenblinktimeout(usec)                # GRL 4.2\n\n\"gettermcap(cap)\"\nstr     rlgettermcap(cap)\n\n\"clearhistory\"\nvoid    rlclearhistory()                              # GRL 6.3\n\n\"activatemark\"\nvoid    rlactivatemark()                              # GRL 8.1\n\n\"deactivatemark\"\nvoid    rldeactivatemark()                            # GRL 8.1\n\n\"keepmarkactive\"\nvoid    rlkeepmarkactive()                           # GRL 8.1\n\n\"markactivep\"\nint     rlmarkactivep()                              # GRL 8.1\n\nAlternate Interface\n\"callbackhandlerinstall(PROMPT, LHANDLER)\"\nvoid    rlcallbackhandlerinstall(str prompt, pfunc lhandler)\n\n\"callbackreadchar\"\nvoid    rlcallbackreadchar()\n\n\"callbacksigcleanup\" # GRL 7.0\nvoid    rlcallbacksigcleanup()\n\n\"callbackhandlerremove\"\nvoid    rlcallbackhandlerremove()\n\nReadline Signal Handling\n\"pendingsignal()\"\nint     rlpendingsignal()                             # GRL 7.0\n\n\"cleanupaftersignal\"\nvoid    rlcleanupaftersignal()                       # GRL 4.0\n\n\"freelinestate\"\nvoid    rlfreelinestate()                            # GRL 4.0\n\n\"resetaftersignal\"\nvoid    rlresetaftersignal()                         # GRL 4.0\n\n\"checksignals\"\nvoid    rlchecksignals()                              # GRL 8.0\n\n\"echosignalchar\"\nvoid    rlechosignalchar(int sig)                    # GRL 6.0\n\n\"resizeterminal\"\nvoid    rlresizeterminal()                            # GRL 4.0\n\n\"setscreensize(ROWS, COLS)\"\nvoid    rlsetscreensize(int ROWS, int COLS)          # GRL 4.2\n\n\"getscreensize()\"\n(int rows, int cols)    rlgetscreensize()            # GRL 4.2\n\n\"resetscreensize()\"\nvoid    rlresetscreensize()                          # GRL 5.1\n\n\"setsignals\"\nint     rlsetsignals()                                # GRL 4.0\n\n\"clearsignals\"\nint     rlclearsignals()                              # GRL 4.0\n\nCompletion Functions\n\"completeinternal([WHATTODO])\"\nint     rlcompleteinternal(int whattodo = TAB)\n\n\"completionmode(FUNCTION)\"\nint     rlcompletionmode(FunctionPtr|str function)    # GRL 4.3\n\n\"completionmatches(TEXT [,FUNC])\"\n(@str)  rlcompletionmatches(str text,\npfunc func = filenamecompletionfunction)\n\n\"filenamecompletionfunction(TEXT, STATE)\"\nstr     rlfilenamecompletionfunction(str text, int state)\n\n\"usernamecompletionfunction(TEXT, STATE)\"\nstr     rlusernamecompletionfunction(str text, int state)\n\n\"listcompletionfunction(TEXT, STATE)\"\nstr     listcompletionfunction(str text, int state)   # TRG original\n\nHistory Functions\nInitializing History and State Management\n\"usinghistory\"\nvoid    usinghistory()\n\n\"historygethistorystate\"\nHISTORYSTATE   historygethitorystate()              # GRL 6.3\n\n\"historysethistorystate\"\nvoid    historysethitorystate(HISTORYSTATE)         # GRL 6.3\n\nHistory List Management\n\"addhistory(STRING)\"\nvoid    addhistory(str string)\n\n\"addhistorytime(STRING)\"\nvoid    addhistorytime(str string)                    # GRL 5.0\n\n\"removehistory(WHICH)\"\nstr     removehistory(int which)\n\n\"freehistory(HISTENT)\"\nNot implemented since Term::ReadLine::Gnu does not support the\nmember 'data' of HISTENTRY structure. removehistory() frees\nthe memory.\nhistdatat      freehistoryentry(HISTENTRY *histent) # GRL 5.0\n\n\"replacehistoryentry(WHICH, STRING)\"\nstr     replacehistoryentry(int which, str string)\n\n\"clearhistory\"\nvoid    clearhistory()\n\n\"StifleHistory(MAX)\"\nint     stiflehistory(int max|undef)\n\nstifles the history list, remembering only the last \"MAX\" entries. If \"MAX\" is undef,\nremembers all entries. This is a replacement of \"unstiflehistory()\".\n\n\"unstiflehistory\"\nint     unstiflehistory()\n\nThis is equivalent with \"stiflehistory(undef)\".\n\n\"historyisstifled\"\nint     historyisstifled()\n\n\"SetHistory(LINE1 [, LINE2, ...])\"\nsets the history of input, from where it can be used if the actual \"readline\" is present.\n\nInformation About the History List\n\"historylist\"\nNot implemented since not required for Perl.\nHISTENTRY historylist()\n\n\"wherehistory\"\nint     wherehistory()\n\n\"currenthistory\"\nstr     currenthistory()\n\n\"historyget(OFFSET)\"\nstr     historyget(offset)\n\n\"historygettime(OFFSET)\"\ntimet  historygettime(offset)                        # GRL 5.0\n\n\"historytotalbytes\"\nint     historytotalbytes()\n\n\"GetHistory\"\nreturns the history of input as a list, if actual \"readline\" is present.\n\nMoving Around the History List\n\"historysetpos(POS)\"\nint     historysetpos(int pos)\n\n\"previoushistory\"\nstr     previoushistory()\n\n\"nexthistory\"\nstr     nexthistory()\n\nSearching the History List\n\"historysearch(STRING [,DIRECTION])\"\nint     historysearch(str string, int direction = -1)\n\n\"historysearchprefix(STRING [,DIRECTION])\"\nint     historysearchprefix(str string, int direction = -1)\n\n\"historysearchpos(STRING [,DIRECTION [,POS]])\"\nint     historysearchpos(str string,\nint direction = -1,\nint pos = wherehistory())\n\nManaging the History File\n\"ReadHistory([FILENAME [,FROM [,TO]]])\"\nint     readhistory(str filename = '~/.history',\nint from = 0, int to = -1)\n\nint     readhistoryrange(str filename = '~/.history',\nint from = 0, int to = -1)\n\nadds the contents of \"FILENAME\" to the history list, a line at a time. If \"FILENAME\" is\nfalse, then read from ~/.history. Start reading at line \"FROM\" and end at \"TO\". If \"FROM\" is\nomitted or zero, start at the beginning. If \"TO\" is omitted or less than \"FROM\", then read\nuntil the end of the file. Returns true if successful, or false if not. \"readhistory()\" is\nan alias of \"readhistoryrange()\".\n\n\"WriteHistory([FILENAME])\"\nint     writehistory(str filename = '~/.history')\n\nwrites the current history to \"FILENAME\", overwriting \"FILENAME\" if necessary. If \"FILENAME\"\nis false, then write the history list to ~/.history. Returns true if successful, or false if\nnot.\n\n\"appendhistory(NELEMENTS [,FILENAME])\"\nint     appendhistory(int nelements, str filename = '~/.history')\n\n\"historytruncatefile([FILENAME [,NLINES]])\"\nint     historytruncatefile(str filename = '~/.history',\nint nlines = 0)\n\nHistory Expansion\n\"historyexpand(STRING)\"\n(int result, str expansion) historyexpand(str string)\n\nNote that this function returns \"expansion\" in the scalar context.\n\n\"gethistoryevent(STRING, CINDEX [,QCHAR])\"\n(str text, int cindex) = gethistoryevent(str  string,\nint  cindex,\nchar qchar = '\\0')\n\n\"historytokenize(STRING)\"\n(@str)  historytokenize(str string)\n\n\"historyargextract(STRING, [FIRST [,LAST]])\"\nstr historyargextract(str string, int first = 0, int last = '$')\n\n\"Term::ReadLine::Gnu\" Variables\nFollowing GNU Readline/History Library variables can be accessed by a Perl program. See GNU\nReadline Library Manual <https://tiswww.cwru.edu/php/chet/readline/readline.html> and GNU\nHistory Library Manual <https://tiswww.cwru.edu/php/chet/readline/history.html> for details of\neach variable. You can access them by using \"Attribs\" methods. Names of keys in this hash\nconform to standard conventions with the leading \"rl\" stripped.\n\nExamples:\n\n$attribs = $term->Attribs;\n$v = $attribs->{libraryversion};   # rllibraryversion\n$v = $attribs->{historybase};      # historybase\n\nReadline Variables\nstr rllinebuffer\nint rlpoint\nint rlend\nint rlmark\nint rldone\nint rlnumcharstoread (GRL 4.1)\nint rlpendinginput\nint rldispatching\nint rleraseemptyline (GRL 4.0)\nstr rlprompt (read only)\nstr rldisplayprompt\nint rlalreadyprompted (GRL 4.1)\nstr rllibraryversion (read only)\nint rlreadlineversion (read only)\nint rlgnureadlinep (GRL 4.1, read only)\nstr rlterminalname\nstr rlreadlinename\nfilehandle rlinstream\nfilehandle rloutstream\nint rlpreferenvwinsize (GRL 5.1)\npfunc rllastfunc (GRL 4.2, read only)\npfunc rlstartuphook\npfunc rlpreinputhook (GRL 4.0)\npfunc rleventhook\npfunc rlgetcfunction\npfunc rlsignaleventhook (GRL 6.3)\npfunc rlinputavailablehook (GRL 6.3)\npfunc rlredisplayfunction\npfunc rlpreptermfunction (GRL 2.1)\npfunc rldepreptermfunction (GRL 2.1)\nKeymap rlexecutingkeymap (read only)\nKeymap rlbindingkeymap (read only)\nstr rlexecutingmacro (GRL 4.2, read only)\nint rlexecutingkey (GRL 6.3, read only)\nstr rlexecutingkeyseq (GRL 6.3, read only)\nint rlkeysequencelength (read only)\nint rlreadlinestate (GRL 4.2)\nint rlexplicitarg (read only)\nint rlnumericarg (read only)\nint rleditingmode (read only)\n\nSignal Handling Variables\nint rlcatchsignals (GRL 4.0)\nint rlcatchsigwinch (GRL 4.0)\nint rlpersistentsignalhandlers (GRL 7.0)\nint rlchangeenvironment (GRL 6.3)\n\nCompletion Variables\npfunc rlcompletionentryfunction\npfunc rlattemptedcompletionfunction\npfunc rlfilenamequotingfunction\npfunc rlfilenamedequotingfunction\npfunc rlcharisquotedp\npfunc rlignoresomecompletionsfunction\npfunc rldirectorycompletionhook\npfunc rldirectoryrewritehook (GRL 4.2)\npfunc rlfilenamestathook (GRL 6.3)\npfunc rlfilenamerewritehook (GRL 6.1)\npfunc rlcompletiondisplaymatcheshook (GRL 4.0)\nstr rlbasicwordbreakcharacters\nstr rlbasicquotecharacters\nstr rlcompleterwordbreakcharacters\npfunc rlcompletionwordbreakhook (GRL 5.0)\nstr rlcompleterquotecharacters\nstr rlfilenamequotecharacters\nstr rlspecialprefixes\nint rlcompletionqueryitems\nint rlcompletionappendcharacter\nint rlcompletionsuppressappend (GRL 4.3)\nint rlcompletionquotecharacter (GRL 5.0, read only)\nint rlcompletionsuppressquote (GRL 5.0)\nint rlcompletionfoundquote (GRL 5.0, read only)\nint rlcompletionmarksymlinkdirs (GRL 4.3)\nint rlignorecompletionduplicates\nint rlfilenamecompletiondesired\nint rlfilenamequotingdesired\nint rlattemptedcompletionover\nint rlsortcompletionmatches (GRL 6.0)\nint rlcompletiontype (read only)\nint rlcompletioninvokingkey (GRL 6.0, read only)\nint rlinhibitcompletion\n\nHistory Variables\nint historybase\nint historylength\nint historymaxentries (called `maxinputhistory', read only)\nint historywritetimestamps (GRL 5.0)\nchar historyexpansionchar\nchar historysubstchar\nchar historycommentchar\nstr historyworddelimiters (GRL 4.2)\nstr historysearchdelimiterchars\nstr historynoexpandchars\nint historyquotesinhibitexpansion\nint historyquotingstate\npfunc historyinhibitexpansionfunction\n\nFunction References\nrlgetc\nrlredisplay\nrlcallbackreadchar\nrldisplaymatchlist\nrlfilenamecompletionfunction\nrlusernamecompletionfunction\nlistcompletionfunction\nshadowredisplay\nTkgetc\n"
                    },
                    {
                        "name": "Custom Completion",
                        "content": "In this section variables and functions for custom completion are described along with examples.\n\nMost of descriptions in this section came from GNU Readline Library Manual\n<https://tiswww.cwru.edu/php/chet/readline/readline.html>.\n\n\"completionentryfunction\"\nThis variable holds reference refers to a generator function for \"completionmatches()\".\n\nA generator function is called repeatedly from \"completionmatches()\", returning a string\neach time. The arguments to the generator function are \"TEXT\" and \"STATE\". \"TEXT\" is the\npartial word to be completed. \"STATE\" is zero the first time the function is called,\nallowing the generator to perform any necessary initialization, and a positive non-zero\ninteger for each subsequent call. When the generator function returns \"undef\" this signals\n\"completionmatches()\" that there are no more possibilities left.\n\nIf this variable set to undef, built-in \"filenamecompletionfunction\" is used.\n\nA sample generator function, \"listcompletionfunction\", is defined in Gnu.pm. You can use\nit as follows;\n\nuse Term::ReadLine;\n...\nmy $term = new Term::ReadLine 'sample';\nmy $attribs = $term->Attribs;\n...\n$attribs->{completionentryfunction} =\n$attribs->{listcompletionfunction};\n...\n$attribs->{completionword} =\n[qw(reference to a list of words which you want to use for completion)];\n$term->readline(\"custom completion>\");\n\nSee also \"completionmatches\".\n\n\"attemptedcompletionfunction\"\nA reference to an alternative function to create matches.\n\nThe function is called with \"TEXT\", \"LINEBUFFER\", \"START\", and \"END\". \"LINEBUFFER\" is a\ncurrent input buffer string. \"START\" and \"END\" are indices in \"LINEBUFFER\" saying what the\nboundaries of \"TEXT\" are.\n\nIf this function exists and returns null list or \"undef\", or if this variable is set to\n\"undef\", then an internal function \"rlcomplete()\" will call the value of\n\"completionentryfunction\" to generate matches, otherwise the array of strings returned\nwill be used.\n\nThe default value of this variable is \"undef\". You can use it as follows;\n\nuse Term::ReadLine;\n...\nmy $term = new Term::ReadLine 'sample';\nmy $attribs = $term->Attribs;\n...\nsub samplecompletion {\nmy ($text, $line, $start, $end) = @;\n# If first word then username completion, else filename completion\nif (substr($line, 0, $start) =~ /^\\s*$/) {\nreturn $term->completionmatches($text,\n$attribs->{'usernamecompletionfunction'});\n} else {\nreturn ();\n}\n}\n...\n$attribs->{attemptedcompletionfunction} = \\&samplecompletion;\n\n\"completionmatches(TEXT, ENTRYFUNC)\"\nReturns an array of strings which is a list of completions for \"TEXT\". If there are no\ncompletions, returns \"undef\". The first entry in the returned array is the substitution for\n\"TEXT\". The remaining entries are the possible completions.\n\n\"ENTRYFUNC\" is a generator function which has two arguments, and returns a string. The\nfirst argument is \"TEXT\". The second is a state argument; it is zero on the first call, and\nnon-zero on subsequent calls. \"ENTRYFUNC\" returns \"undef\" to the caller when there are no\nmore matches.\n\nIf the value of \"ENTRYFUNC\" is undef, built-in \"filenamecompletionfunction\" is used.\n\n\"completionmatches\" is a Perl wrapper function of an internal function\n\"completionmatches()\". See also \"completionentryfunction\".\n\n\"completionfunction\"\nA variable whose content is a reference to a function which returns a list of candidates to\ncomplete.\n\nThis variable is compatible with Term::ReadLine::Perl\n<http://search.cpan.org/dist/Term-ReadLine-Perl/> and very easy to use.\n\nuse Term::ReadLine;\n...\nmy $term = new Term::ReadLine 'sample';\nmy $attribs = $term->Attribs;\n...\n$attribs->{completionfunction} = sub {\nmy ($text, $line, $start) = @;\nreturn qw(a list of candidates to complete);\n};\n\n\"listcompletionfunction(TEXT, STATE)\"\nA sample generator function defined by \"Term::ReadLine::Gnu\". Example code at\n\"completionentryfunction\" shows how to use this function.\n\n\"Term::ReadLine::Gnu\" Specific Features\n\"Term::ReadLine::Gnu\" Specific Functions\n\"CallbackHandlerInstall(PROMPT, LHANDLER)\"\nThis method provides the function \"rlcallbackhandlerinstall()\" with the following\nadditional feature compatible with \"readline\" method; ornament feature, Term::ReadLine::Perl\n<http://search.cpan.org/dist/Term-ReadLine-Perl/> compatible completion function, history\nexpansion, and addition to history buffer.\n\n\"callfunction(FUNCTION, [COUNT [,KEY]])\"\nint     rlcallfunction(FunctionPtr|str function, count = 1, key = -1)\n\n\"getallfunctionnames\"\nReturns a list of all function names.\n\n\"shadowredisplay\"\nA redisplay function for password input. You can use it as follows;\n\n$attribs->{redisplayfunction} = $attribs->{shadowredisplay};\n$line = $term->readline(\"password> \");\n\n\"filenamelist\"\nReturns candidates of filenames to complete. This function can be used with\n\"completionfunction\" and is implemented for the compatibility with Term::ReadLine::Perl\n<http://search.cpan.org/dist/Term-ReadLine-Perl/>.\n\n\"listcompletionfunction\"\nSee the description of section \"Custom Completion\".\n\n\"Term::ReadLine::Gnu\" Specific Variables\n\"doexpand\"\nWhen true, the history expansion is enabled. By default false.\n\n\"completionfunction\"\nSee the description of section \"Custom Completion\".\n\n\"completionword\"\nA reference to a list of candidates to complete for \"listcompletionfunction\".\n\n\"Term::ReadLine::Gnu\" Specific Commands\n\"history-expand-line\"\nThe equivalent of the Bash \"history-expand-line\" editing command.\n\n\"operate-and-get-next\"\nThe equivalent of the Korn shell \"operate-and-get-next-history-line\" editing command and the\nBash \"operate-and-get-next\".\n\nThis command is bound to \"\\C-o\" by default for the compatibility with the Bash and\nTerm::ReadLine::Perl <http://search.cpan.org/dist/Term-ReadLine-Perl/>.\n\n\"display-readline-version\"\nShows the version of \"Term::ReadLine::Gnu\" and the one of the GNU Readline Library.\n\n\"change-ornaments\"\nChange ornaments interactively.\n"
                    }
                ]
            },
            "FILES": {
                "content": "~/.inputrc\nReadline init file. Using this file it is possible that you would like to use a different\nset of key bindings. When a program which uses the GNU Readline library starts up, the init\nfile is read, and the key bindings are set.\n\nThe conditional init constructs is supported. The program name which is specified by the\nfirst argument of \"new\" method is used as the application construct.\n\nFor example, when your program calls \"new\" method as follows;\n\n...\n$term = new Term::ReadLine 'PerlSh';\n...\n\nyour ~/.inputrc can define key bindings only for the program as follows;\n\n...\n$if PerlSh\nMeta-Rubout: backward-kill-word\n\"\\C-x\\C-r\": re-read-init-file\n\"\\e[11~\": \"Function Key 1\"\n$endif\n...\n\nFor further details, see the section \"Readline Init File\" in the GNU Readline Library Manual\n<https://tiswww.cwru.edu/php/chet/readline/readline.html>\n",
                "subsections": []
            },
            "EXPORTS": {
                "content": "No symbols are exported by default. The following tags are defined and their symbols can be\nexported.\n\nprompt\nRLPROMPTSTARTIGNORE RLPROMPTENDIGNORE\n\nmatchtype\nNOMATCH SINGLEMATCH MULTMATCH\n\nkeymaptype\nISFUNC ISKMAP ISMACR\n\nundocode\nUNDODELETE UNDOINSERT UNDOBEGIN UNDOEND\n\nrlstate\nRLSTATENONE RLSTATEINITIALIZING RLSTATEINITIALIZED RLSTATETERMPREPPED\nRLSTATEREADCMD RLSTATEMETANEXT RLSTATEDISPATCHING RLSTATEMOREINPUT RLSTATEISEARCH\nRLSTATENSEARCH RLSTATESEARCH RLSTATENUMERICARG RLSTATEMACROINPUT RLSTATEMACRODEF\nRLSTATEOVERWRITE RLSTATECOMPLETING RLSTATESIGHANDLER RLSTATEUNDOING\nRLSTATEINPUTPENDING RLSTATETTYCSAVED RLSTATECALLBACK RLSTATEVIMOTION\nRLSTATEMULTIKEY RLSTATEVICMDONCE RLSTATECHARSEARCH RLSTATEREDISPLAYING RLSTATEDONE\n\nThey can be exported as follows;\n\nuse Term::ReadLine;\nBEGIN {\nimport Term::ReadLine::Gnu qw(:keymaptype RLSTATEINITIALIZED);\n}\n",
                "subsections": []
            },
            "ENVIRONMENT": {
                "content": "The environment variable \"PERLRL\" governs which ReadLine clone is loaded. See the ENVIRONMENT\nsection on Term::ReadLine <http://search.cpan.org/dist/Term-ReadLine/> for further details.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Term::ReadLine::Gnu Project Home Page <https://github.com/hirooih/perl-trg>\nGNU Readline Library Manual <https://tiswww.cwru.edu/php/chet/readline/readline.html>\nGNU History Library Manual <https://tiswww.cwru.edu/php/chet/readline/history.html>\nSample and test programs (eg/* and t/*) in the \"Term::ReadLine::Gnu\" distribution\n<http://search.cpan.org/dist/Term-ReadLine-Gnu/>\nTerm::ReadLine <http://search.cpan.org/dist/Term-ReadLine/>\nWorks which use Term::ReadLine::Gnu\n\nDistributions which depend on Term::ReadLine::Gnu on CPAN <http://www.cpan.org/>\n<https://metacpan.org/requires/distribution/Term-ReadLine-Gnu>\n\nPerl Debugger <http://perldoc.perl.org/perldebug.html>\nperl -d\n\nPerl Shell (psh) <http://gnp.github.io/psh/>\nThe Perl Shell is a shell that combines the interactive nature of a Unix shell with the\npower of Perl.\n\nA programmable completion feature compatible with bash is implemented.\n\nSPP (Synopsys Plus Perl) <http://vlsiweb.stanford.edu/~jsolomon/SPP/>\nSPP (Synopsys Plus Perl) is a Perl module that wraps around Synopsys' shell programs.\nSPP is inspired by the original dcperl written by Steve Golson, but it's an entirely\nnew implementation. Why is it called SPP and not dcperl? Well, SPP was written to wrap\naround any of Synopsys' shells.\n\nPFM (Personal File Manager for Unix/Linux) <http://p-f-m.sourceforge.net/>\nPfm is a terminal-based file manager written in Perl, based on PFM.COM for MS-DOS\n(originally by Paul Culley and Henk de Heer).\n\nThe soundgrab <https://sourceforge.net/projects/soundgrab/>\nsoundgrab is designed to help you slice up a big long raw audio file (by default 44.1\nkHz 2 channel signed sixteen bit little endian) and save your favorite sections to other\nfiles. It does this by providing you with a cassette player like command line interface.\n\nPDL (The Perl Data Language) <http://pdl.perl.org/>\nPDL (``Perl Data Language'') gives standard Perl the ability to compactly store and\nspeedily manipulate the large N-dimensional data arrays which are the bread and butter\nof scientific computing.\n\nPIQT (Perl Interactive DBI Query Tool) <http://piqt.sourceforge.net/>\nPIQT is an interactive query tool using the Perl DBI database interface. It supports\nReadLine, provides a built in scripting language with a Lisp like syntax, an online help\nsystem, and uses wrappers to interface to the DBD modules.\n\nvshnu (the New Visual Shell) <http://www.cs.indiana.edu/~kinzler/vshnu/>\nA visual shell and CLI shell supplement.\n\nIf you know any other works you recommend, please let me know.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Hiroo Hayashi \"<hiroo.hayashi@computer.org>\"\n\n<http://search.cpan.org/~hayashi/>\n",
                "subsections": []
            },
            "TODO": {
                "content": "GTK+ support in addition to Tk.\n",
                "subsections": []
            },
            "BUGS": {
                "content": "Submit a bug report to the bug tracker on GitHub <https://github.com/hirooih/perl-trg/issues>.\n\"adddefun()\" can define up to 16 functions.\nSome functions and variables do not have test code yet. Your contribution is welcome. See\nt/readline.t for details.\nIf the pager command (| or ||) in Perl debugger causes segmentation fault, you need to fix\nperl5db.pl. See <https://rt.perl.org/Public/Bug/Display.html?id=121456> for details.\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyright (c) 1996-2020 Hiroo Hayashi. All rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            }
        }
    }
}