dnl
dnl Some derived from PDKSH 5.1.3 autoconf tests
dnl
-dnl Copyright (C) 1987-2024 Free Software Foundation, Inc.
+dnl Copyright (C) 1987-2025 Free Software Foundation, Inc.
dnl
dnl
/* complete.c -- filename completion for readline. */
-/* Copyright (C) 1987-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2025 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
#undef ssize_t
+#undef mode_t
+
#undef const
#undef volatile
fi
+ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
+if test "x$ac_cv_type_mode_t" = xyes
+then :
+
+else case e in #(
+ e)
+printf "%s\n" "#define mode_t int" >>confdefs.h
+ ;;
+esac
+fi
+
+
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
printf %s "checking whether stat file-mode macros are broken... " >&6; }
if test ${ac_cv_header_stat_broken+y}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
printf "%s\n" "$am_cv_langinfo_codeset" >&6; }
if test $am_cv_langinfo_codeset = yes; then
+ printf "%s\n" "#define HAVE_NL_LANGINFO 1" >>confdefs.h
+
printf "%s\n" "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
AC_TYPE_SIZE_T
AC_CHECK_TYPE(ssize_t, int)
+AC_TYPE_MODE_T
+
AC_HEADER_STAT
AC_HEADER_DIRENT
/* display.c -- readline redisplay facility. */
-/* Copyright (C) 1987-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2025 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
history - GNU History Library
C\bCO\bOP\bPY\bYR\bRI\bIG\bGH\bHT\bT
- The GNU History Library is Copyright (C) 1989-2024 by the Free Software
+ The GNU History Library is Copyright (C) 1989-2025 by the Free Software
Foundation, Inc.
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
Comments and bug reports concerning this manual page should be directed
to _\bc_\bh_\be_\bt_\b._\br_\ba_\bm_\be_\by_\b@_\bc_\ba_\bs_\be_\b._\be_\bd_\bu.
-GNU History 8.3 2024 November 29 _\bH_\bI_\bS_\bT_\bO_\bR_\bY(3)
+GNU History 8.3 2024 December 31 _\bH_\bI_\bS_\bT_\bO_\bR_\bY(3)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This document describes the GNU History library
-(version 8.3, 29 November 2024),
+(version 8.3, 30 December 2024),
a programming tool that provides a consistent user interface for
recalling lines of previously typed input.
-Copyright © 1988-2024 Free Software Foundation, Inc.
+Copyright © 1988-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
‘<samp class="samp">*</samp>’, ‘<samp class="samp">-</samp>’, or ‘<samp class="samp">%</samp>’.
Words are numbered from the beginning of the line,
with the first word being denoted by 0 (zero).
+That first word is usually the command word, and the arguments begin
+with the second word.
Words are inserted into the current line separated by single spaces.
</p>
<p>For example,
</p>
</dd>
<dt><code class="code">!!:$</code></dt>
-<dd><p>designates the last argument of the preceding command.
+<dd><p>designates the last word of the preceding command.
This may be shortened to <code class="code">!$</code>.
</p>
</dd>
This is history.info, produced by makeinfo version 7.1 from
history.texi.
-This document describes the GNU History library (version 8.3, 29
-November 2024), a programming tool that provides a consistent user
+This document describes the GNU History library (version 8.3, 30
+December 2024), a programming tool that provides a consistent user
interface for recalling lines of previously typed input.
- Copyright © 1988-2024 Free Software Foundation, Inc.
+ Copyright © 1988-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
specification from the word designator. It may be omitted if the word
designator begins with a ‘^’, ‘$’, ‘*’, ‘-’, or ‘%’. Words are numbered
from the beginning of the line, with the first word being denoted by 0
-(zero). Words are inserted into the current line separated by single
-spaces.
+(zero). That first word is usually the command word, and the arguments
+begin with the second word. Words are inserted into the current line
+separated by single spaces.
For example,
preceding command is repeated in toto.
‘!!:$’
- designates the last argument of the preceding command. This may be
+ designates the last word of the preceding command. This may be
shortened to ‘!$’.
‘!fi:2’
* Introduction to History:: What is the GNU History library for?
* History Storage:: How information is stored.
* History Functions:: Functions that you can use.
-* History Variables:: Variables that control behaviour.
+* History Variables:: Variables that control behavior.
* History Programming Example:: Example of using the GNU History Library.
\1f
Node: History Interaction\7f2001
Node: Event Designators\7f4715
Node: Word Designators\7f6217
-Node: Modifiers\7f8524
-Node: Programming with GNU History\7f10171
-Node: Introduction to History\7f10915
-Node: History Storage\7f12647
-Node: History Functions\7f13827
-Node: Initializing History and State Management\7f14816
-Node: History List Management\7f15619
-Node: Information About the History List\7f18050
-Node: Moving Around the History List\7f19663
-Node: Searching the History List\7f20743
-Node: Managing the History File\7f22689
-Node: History Expansion\7f25159
-Node: History Variables\7f27132
-Node: History Programming Example\7f31247
-Node: GNU Free Documentation License\7f33901
-Node: Concept Index\7f59076
-Node: Function and Variable Index\7f59781
+Node: Modifiers\7f8612
+Node: Programming with GNU History\7f10259
+Node: Introduction to History\7f11002
+Node: History Storage\7f12734
+Node: History Functions\7f13914
+Node: Initializing History and State Management\7f14903
+Node: History List Management\7f15706
+Node: Information About the History List\7f18137
+Node: Moving Around the History List\7f19750
+Node: Searching the History List\7f20830
+Node: Managing the History File\7f22776
+Node: History Expansion\7f25246
+Node: History Variables\7f27219
+Node: History Programming Example\7f31334
+Node: GNU Free Documentation License\7f33988
+Node: Concept Index\7f59163
+Node: Function and Variable Index\7f59868
\1f
End Tag Table
r\bre\bea\bad\bdl\bli\bin\bne\be (_\bc_\bo_\bn_\bs_\bt _\bc_\bh_\ba_\br _\b*_\bp_\br_\bo_\bm_\bp_\bt);
C\bCO\bOP\bPY\bYR\bRI\bIG\bGH\bHT\bT
- Readline is Copyright (C) 1989-2024 Free Software Foundation, Inc.
+ Readline is Copyright (C) 1989-2025 Free Software Foundation, Inc.
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
r\bre\bea\bad\bdl\bli\bin\bne\be reads a line from the terminal and return it, using p\bpr\bro\bom\bmp\bpt\bt as
at the top of the screen.
c\bcl\ble\bea\bar\br-\b-s\bsc\bcr\bre\bee\ben\bn (\b(C\bC-\b-l\bl)\b)
Clear the screen, then redraw the current line, leaving the cur-
- rent line at the top of the screen. With an argument, refresh
- the current line without clearing the screen.
+ rent line at the top of the screen. With a numeric argument,
+ refresh the current line without clearing the screen.
r\bre\bed\bdr\bra\baw\bw-\b-c\bcu\bur\brr\bre\ben\bnt\bt-\b-l\bli\bin\bne\be
Refresh the current line.
Negative arguments have no effect.
t\btr\bra\ban\bns\bsp\bpo\bos\bse\be-\b-w\bwo\bor\brd\bds\bs (\b(M\bM-\b-t\bt)\b)
Drag the word before point past the word after point, moving
- point over that word as well. If point is at the end of the
+ point past that word as well. If point is at the end of the
line, this transposes the last two words on the line.
u\bup\bpc\bca\bas\bse\be-\b-w\bwo\bor\brd\bd (\b(M\bM-\b-u\bu)\b)
Uppercase the current (or following) word. With a negative ar-
+\bo the number of matches _\bN;
+\bo the word being completed;
- +\bo _\bS:_\bE, where S and E are the start and end offsets of the
+ +\bo _\bS:_\bE, where _\bS and _\bE are the start and end offsets of the
word in the r\bre\bea\bad\bdl\bli\bin\bne\be line buffer; then
+\bo each match, one per line
B\bBU\bUG\bGS\bS
It's too big and too slow.
-GNU Readline 8.3 2024 November 29 _\bR_\bE_\bA_\bD_\bL_\bI_\bN_\bE(3)
+GNU Readline 8.3 2024 December 30 _\bR_\bE_\bA_\bD_\bL_\bI_\bN_\bE(3)
Clear the screen,
then redraw the current line,
leaving the current line at the top of the screen.
-With an argument, refresh the current line without clearing the
+With a numeric argument, refresh the current line without clearing the
screen.
.TP
.B redraw\-current\-line
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual describes the GNU Readline Library
-(version 8.3, 29 November 2024), a library which aids in the
+(version 8.3, 30 December 2024), a library which aids in the
consistency of user interface across discrete programs which provide
a command line interface.
-Copyright © 1988-2024 Free Software Foundation, Inc.
+Copyright © 1988-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
</p>
</dd>
<dt><a id="index-active_002dregion_002dend_002dcolor"></a><span><code class="code">active-region-end-color</code><a class="copiable-link" href="#index-active_002dregion_002dend_002dcolor"> ¶</a></span></dt>
-<dd><p>A string variable that "undoes" the effects of <code class="code">active-region-start-color</code>
-and restores "normal" terminal display appearance after displaying text
-in the active region.
+<dd><p>A string variable that “undoes”
+the effects of <code class="code">active-region-start-color</code>
+and restores “normal”
+terminal display appearance after displaying text in the active region.
This string must not take up any physical character positions on the display,
so it should consist only of terminal escape sequences.
It is output to the terminal after displaying the text in the active region.
<p>When entering the text of a macro, single or double quotes must
be used to indicate a macro definition.
Unquoted text is assumed to be a function name.
-Tthe backslash escapes described above are expanded
+The backslash escapes described above are expanded
in the macro body.
Backslash will quote any other character in the macro text,
including ‘<samp class="samp">"</samp>’ and ‘<samp class="samp">'</samp>’.
binding, variable assignment, and conditional syntax.
</p>
<div class="example">
-<pre class="example-preformatted"># This file controls the behaviour of line input editing for
+<pre class="example-preformatted"># This file controls the behavior of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
position, and <em class="dfn">mark</em> refers to a cursor position saved by the
<code class="code">set-mark</code> command.
The text between the point and mark is referred to as the <em class="dfn">region</em>.
-Readline has the concept of an <em class="emph">active region</em>:
+Readline
+has the concept of an <em class="emph">active region</em>:
when the region is active,
Readline redisplay highlights the region using the
-value of the <code class="code">active-region-start-color</code> variable.
+value of the
+<code class="code">active-region-start-color</code>
+variable.
The <code class="code">enable-active-region</code> variable turns this on and off.
Several commands set the region to active; those are noted below.
</p>
<dd><p>Clear the screen,
then redraw the current line,
leaving the current line at the top of the screen.
+If given a numeric argument, this refreshes the current line
+without clearing the screen.
</p>
</dd>
<dt><a id="index-redraw_002dcurrent_002dline-_0028_0029"></a><span><code class="code">redraw-current-line ()</code><a class="copiable-link" href="#index-redraw_002dcurrent_002dline-_0028_0029"> ¶</a></span></dt>
<li>the number of matches <var class="var">N</var>;
</li><li>the word being completed;
</li><li><var class="var">S</var>:<var class="var">E</var>,
-where S and E are the start and end offsets of the word
+where <var class="var">S</var> and <var class="var">E</var> are the start and end offsets of the word
in the Readline line buffer; then
</li><li>each match, one per line
</li></ul>
<p>Many programs provide a command line interface, such as <code class="code">mail</code>,
<code class="code">ftp</code>, and <code class="code">sh</code>.
-For such programs, the default behaviour of Readline is sufficient.
+For such programs, the default behavior of Readline is sufficient.
This section describes how to use Readline in
the simplest way possible, perhaps to replace calls in your code to
<code class="code">fgets()</code>.
}
</pre></div>
-<p>This function gives the user the default behaviour of <kbd class="key">TAB</kbd>
+<p>This function gives the user the default behavior of <kbd class="key">TAB</kbd>
completion: filename completion.
If you do not want Readline to
complete filenames, you can change the binding of the <kbd class="key">TAB</kbd> key
<dl class="first-deftypefn first-deftypefun-alias-first-deftypefn">
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005ffree_005fkeymap"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_free_keymap</strong> <code class="def-code-arguments">(Keymap keymap)</code><a class="copiable-link" href="#index-rl_005ffree_005fkeymap"> ¶</a></span></dt>
<dd><p>Free all storage associated with <var class="var">keymap</var>.
-This calls <code class="code">rl_discard_keymap</code> to free subordindate
+This calls <code class="code">rl_discard_keymap</code> to free subordinate
keymaps and macros.
</p></dd></dl>
<dt class="deftypefn deftypefun-alias-deftypefn" id="index-rl_005frestore_005fprompt"><span class="category-def">Function: </span><span><code class="def-type">void</code> <strong class="def-name">rl_restore_prompt</strong> <code class="def-code-arguments">(void)</code><a class="copiable-link" href="#index-rl_005frestore_005fprompt"> ¶</a></span></dt>
<dd><p>Restore the local Readline prompt display state saved by the most
recent call to <code class="code">rl_save_prompt</code>.
-if you called <code class="code">rl_save_prompt</code> to save the prompt before a call
+If you called <code class="code">rl_save_prompt</code> to save the prompt before a call
to <code class="code">rl_message</code>, you should call this function before the
corresponding call to <code class="code">rl_clear_message</code>.
</p></dd></dl>
This is readline.info, produced by makeinfo version 7.1 from rlman.texi.
-This manual describes the GNU Readline Library (version 8.3, 29 November
+This manual describes the GNU Readline Library (version 8.3, 30 December
2024), a library which aids in the consistency of user interface across
discrete programs which provide a command line interface.
- Copyright © 1988-2024 Free Software Foundation, Inc.
+ Copyright © 1988-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
When entering the text of a macro, single or double quotes must be
used to indicate a macro definition. Unquoted text is assumed to
- be a function name. Tthe backslash escapes described above are
+ be a function name. The backslash escapes described above are
expanded in the macro body. Backslash will quote any other
character in the macro text, including ‘"’ and ‘'’. For example,
the following binding will make ‘‘C-x’ \’ insert a single ‘\’ into
Here is an example of an INPUTRC file. This illustrates key binding,
variable assignment, and conditional syntax.
- # This file controls the behaviour of line input editing for
+ # This file controls the behavior of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
‘clear-screen (C-l)’
Clear the screen, then redraw the current line, leaving the current
- line at the top of the screen.
+ line at the top of the screen. If given a numeric argument, this
+ refreshes the current line without clearing the screen.
‘redraw-current-line ()’
Refresh the current line. By default, this is unbound.
aiding in the consistency of user interface across discrete programs
that need to provide a command line interface.
- Copyright (C) 1988-2024 Free Software Foundation, Inc.
+ Copyright (C) 1988-2025 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice pare
==================
Many programs provide a command line interface, such as ‘mail’, ‘ftp’,
-and ‘sh’. For such programs, the default behaviour of Readline is
+and ‘sh’. For such programs, the default behavior of Readline is
sufficient. This section describes how to use Readline in the simplest
way possible, perhaps to replace calls in your code to ‘fgets()’.
return (line_read);
}
- This function gives the user the default behaviour of <TAB>
+ This function gives the user the default behavior of <TAB>
completion: filename completion. If you do not want Readline to
complete filenames, you can change the binding of the <TAB> key with
‘rl_bind_key()’.
-- Function: void rl_free_keymap (Keymap keymap)
Free all storage associated with KEYMAP. This calls
- ‘rl_discard_keymap’ to free subordindate keymaps and macros.
+ ‘rl_discard_keymap’ to free subordinate keymaps and macros.
-- Function: int rl_empty_keymap (Keymap keymap)
Return non-zero if there are no keys bound to functions in KEYMAP;
-- Function: void rl_restore_prompt (void)
Restore the local Readline prompt display state saved by the most
- recent call to ‘rl_save_prompt’. if you called ‘rl_save_prompt’ to
+ recent call to ‘rl_save_prompt’. If you called ‘rl_save_prompt’ to
save the prompt before a call to ‘rl_message’, you should call this
function before the corresponding call to ‘rl_clear_message’.
* re-read-init-file (C-x C-r): Miscellaneous Commands.
(line 6)
* readline: Basic Behavior. (line 11)
-* redraw-current-line (): Commands For Moving. (line 53)
+* redraw-current-line (): Commands For Moving. (line 54)
* reverse-search-history (C-r): Commands For History.
(line 28)
* revert-all-at-newline: Readline Init File Syntax.
Node: Searching\7f11689
Node: Readline Init File\7f13902
Node: Readline Init File Syntax\7f15099
-Node: Conditional Init Constructs\7f41574
-Node: Sample Init File\7f45963
-Node: Bindable Readline Commands\7f49088
-Node: Commands For Moving\7f50472
-Node: Commands For History\7f52543
-Node: Commands For Text\7f57885
-Node: Commands For Killing\7f61730
-Node: Numeric Arguments\7f64186
-Node: Commands For Completion\7f65342
-Node: Keyboard Macros\7f68625
-Node: Miscellaneous Commands\7f69330
-Node: Readline vi Mode\7f73661
-Node: Programming with GNU Readline\7f75558
-Node: Basic Behavior\7f76544
-Node: Custom Functions\7f80607
-Node: Readline Typedefs\7f82129
-Node: Function Writing\7f84015
-Node: Readline Variables\7f85321
-Node: Readline Convenience Functions\7f100275
-Node: Function Naming\7f101351
-Node: Keymaps\7f102682
-Node: Binding Keys\7f105844
-Node: Associating Function Names and Bindings\7f110669
-Node: Allowing Undoing\7f114499
-Node: Redisplay\7f117249
-Node: Modifying Text\7f121551
-Node: Character Input\7f123090
-Node: Terminal Management\7f126247
-Node: Utility Functions\7f128134
-Node: Miscellaneous Functions\7f131244
-Node: Alternate Interface\7f135134
-Node: A Readline Example\7f138029
-Node: Alternate Interface Example\7f139947
-Node: Readline Signal Handling\7f143566
-Node: Custom Completers\7f153116
-Node: How Completing Works\7f153836
-Node: Completion Functions\7f157212
-Node: Completion Variables\7f160879
-Node: A Short Completion Example\7f179197
-Node: GNU Free Documentation License\7f191866
-Node: Concept Index\7f217043
-Node: Function and Variable Index\7f218564
+Node: Conditional Init Constructs\7f41573
+Node: Sample Init File\7f45962
+Node: Bindable Readline Commands\7f49086
+Node: Commands For Moving\7f50470
+Node: Commands For History\7f52637
+Node: Commands For Text\7f57979
+Node: Commands For Killing\7f61824
+Node: Numeric Arguments\7f64280
+Node: Commands For Completion\7f65436
+Node: Keyboard Macros\7f68719
+Node: Miscellaneous Commands\7f69424
+Node: Readline vi Mode\7f73755
+Node: Programming with GNU Readline\7f75652
+Node: Basic Behavior\7f76638
+Node: Custom Functions\7f80699
+Node: Readline Typedefs\7f82221
+Node: Function Writing\7f84107
+Node: Readline Variables\7f85413
+Node: Readline Convenience Functions\7f100367
+Node: Function Naming\7f101443
+Node: Keymaps\7f102774
+Node: Binding Keys\7f105935
+Node: Associating Function Names and Bindings\7f110760
+Node: Allowing Undoing\7f114590
+Node: Redisplay\7f117340
+Node: Modifying Text\7f121642
+Node: Character Input\7f123181
+Node: Terminal Management\7f126338
+Node: Utility Functions\7f128225
+Node: Miscellaneous Functions\7f131335
+Node: Alternate Interface\7f135225
+Node: A Readline Example\7f138120
+Node: Alternate Interface Example\7f140038
+Node: Readline Signal Handling\7f143657
+Node: Custom Completers\7f153207
+Node: How Completing Works\7f153927
+Node: Completion Functions\7f157303
+Node: Completion Variables\7f160970
+Node: A Short Completion Example\7f179288
+Node: GNU Free Documentation License\7f191957
+Node: Concept Index\7f217134
+Node: Function and Variable Index\7f218655
\1f
End Tag Table
Clear the screen,
then redraw the current line,
leaving the current line at the top of the screen.
+If given a numeric argument, this refreshes the current line
+without clearing the screen.
@item redraw-current-line ()
Refresh the current line. By default, this is unbound.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- This manual describes the end user interface of the GNU Readline Library
-(version 8.3, 29 November 2024), a library which aids in the
+(version 8.3, 30 December 2024), a library which aids in the
consistency of user interface across discrete programs which provide
a command line interface.
-Copyright © 1988-2024 Free Software Foundation, Inc.
+Copyright © 1988-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
</p>
</dd>
<dt><a id="index-active_002dregion_002dend_002dcolor"></a><span><code class="code">active-region-end-color</code><a class="copiable-link" href="#index-active_002dregion_002dend_002dcolor"> ¶</a></span></dt>
-<dd><p>A string variable that "undoes" the effects of <code class="code">active-region-start-color</code>
-and restores "normal" terminal display appearance after displaying text
-in the active region.
+<dd><p>A string variable that “undoes”
+the effects of <code class="code">active-region-start-color</code>
+and restores “normal”
+terminal display appearance after displaying text in the active region.
This string must not take up any physical character positions on the display,
so it should consist only of terminal escape sequences.
It is output to the terminal after displaying the text in the active region.
<p>When entering the text of a macro, single or double quotes must
be used to indicate a macro definition.
Unquoted text is assumed to be a function name.
-Tthe backslash escapes described above are expanded
+The backslash escapes described above are expanded
in the macro body.
Backslash will quote any other character in the macro text,
including ‘<samp class="samp">"</samp>’ and ‘<samp class="samp">'</samp>’.
binding, variable assignment, and conditional syntax.
</p>
<div class="example">
-<pre class="example-preformatted"># This file controls the behaviour of line input editing for
+<pre class="example-preformatted"># This file controls the behavior of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
position, and <em class="dfn">mark</em> refers to a cursor position saved by the
<code class="code">set-mark</code> command.
The text between the point and mark is referred to as the <em class="dfn">region</em>.
-Readline has the concept of an <em class="emph">active region</em>:
+Readline
+has the concept of an <em class="emph">active region</em>:
when the region is active,
Readline redisplay highlights the region using the
-value of the <code class="code">active-region-start-color</code> variable.
+value of the
+<code class="code">active-region-start-color</code>
+variable.
The <code class="code">enable-active-region</code> variable turns this on and off.
Several commands set the region to active; those are noted below.
</p>
<dd><p>Clear the screen,
then redraw the current line,
leaving the current line at the top of the screen.
+If given a numeric argument, this refreshes the current line
+without clearing the screen.
</p>
</dd>
<dt><a id="index-redraw_002dcurrent_002dline-_0028_0029"></a><span><code class="code">redraw-current-line ()</code><a class="copiable-link" href="#index-redraw_002dcurrent_002dline-_0028_0029"> ¶</a></span></dt>
<li>the number of matches <var class="var">N</var>;
</li><li>the word being completed;
</li><li><var class="var">S</var>:<var class="var">E</var>,
-where S and E are the start and end offsets of the word
+where <var class="var">S</var> and <var class="var">E</var> are the start and end offsets of the word
in the Readline line buffer; then
</li><li>each match, one per line
</li></ul>
rluserman.texi.
This manual describes the end user interface of the GNU Readline Library
-(version 8.3, 29 November 2024), a library which aids in the consistency
+(version 8.3, 30 December 2024), a library which aids in the consistency
of user interface across discrete programs which provide a command line
interface.
- Copyright © 1988-2024 Free Software Foundation, Inc.
+ Copyright © 1988-2025 Free Software Foundation, Inc.
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
When entering the text of a macro, single or double quotes must be
used to indicate a macro definition. Unquoted text is assumed to
- be a function name. Tthe backslash escapes described above are
+ be a function name. The backslash escapes described above are
expanded in the macro body. Backslash will quote any other
character in the macro text, including ‘"’ and ‘'’. For example,
the following binding will make ‘‘C-x’ \’ insert a single ‘\’ into
Here is an example of an INPUTRC file. This illustrates key binding,
variable assignment, and conditional syntax.
- # This file controls the behaviour of line input editing for
+ # This file controls the behavior of line input editing for
# programs that use the GNU Readline library. Existing
# programs include FTP, Bash, and GDB.
#
‘clear-screen (C-l)’
Clear the screen, then redraw the current line, leaving the current
- line at the top of the screen.
+ line at the top of the screen. If given a numeric argument, this
+ refreshes the current line without clearing the screen.
‘redraw-current-line ()’
Refresh the current line. By default, this is unbound.
Node: Searching\7f11537
Node: Readline Init File\7f13751
Node: Readline Init File Syntax\7f14949
-Node: Conditional Init Constructs\7f41425
-Node: Sample Init File\7f45815
-Node: Bindable Readline Commands\7f48941
-Node: Commands For Moving\7f50326
-Node: Commands For History\7f52398
-Node: Commands For Text\7f57741
-Node: Commands For Killing\7f61587
-Node: Numeric Arguments\7f64044
-Node: Commands For Completion\7f65201
-Node: Keyboard Macros\7f68485
-Node: Miscellaneous Commands\7f69191
-Node: Readline vi Mode\7f73523
-Node: GNU Free Documentation License\7f74517
+Node: Conditional Init Constructs\7f41424
+Node: Sample Init File\7f45814
+Node: Bindable Readline Commands\7f48939
+Node: Commands For Moving\7f50324
+Node: Commands For History\7f52492
+Node: Commands For Text\7f57835
+Node: Commands For Killing\7f61681
+Node: Numeric Arguments\7f64138
+Node: Commands For Completion\7f65295
+Node: Keyboard Macros\7f68579
+Node: Miscellaneous Commands\7f69285
+Node: Readline vi Mode\7f73617
+Node: GNU Free Documentation License\7f74611
\1f
End Tag Table
/* Set the default locale values according to environment variables. */
setlocale (LC_ALL, "");
+#if defined (SIGWINCH)
/* Handle window size changes when readline is not active and reading
characters. */
signal (SIGWINCH, sighandler);
+#endif
/* Install the line handler. */
rl_callback_handler_install (prompt, cb_linehandler);
/* Handle window size changes when readline is not active and reading
characters. */
+#ifdef SIGWINCH
signal (SIGWINCH, sigwinch_handler);
+#endif
signal (SIGINT, sigint_handler);
rl_getc_function = my_getc;
if (val == -1)
return -1;
+#ifdef SIGWINCH
signal (SIGWINCH, sigwinch);
+#endif
signal (SIGINT, sigint);
val = init_readline (slavefd, slavefd);
-/* gettimeofday.c - gettimeofday replacement using time() */
+/* Provide gettimeofday for systems that don't have it or for which it's broken.
-/* Copyright (C) 2020, 2022 Free Software Foundation, Inc.
+ Copyright (C) 2001-2003, 2005-2007, 2009-2025 Free Software Foundation, Inc.
- This file is part of GNU Bash, the Bourne Again SHell.
+ This file is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of the
+ License, or (at your option) any later version.
- Bash is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- Bash is distributed in the hope that it will be useful,
+ This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ GNU Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public License
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
- You should have received a copy of the GNU General Public License
- along with Bash. If not, see <http://www.gnu.org/licenses/>.
-*/
+/* written by Jim Meyering */
+
+/* A version of gettimeofday that just sets tv_sec from time(3) on Unix-like
+ systems that don't have it, or a version for Win32 systems. From gnulib */
-#include "config.h"
+#include <config.h>
#if !defined (HAVE_GETTIMEOFDAY)
#include "posixtime.h"
-#if HAVE_STDINT_H
-#include <stdint.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+# include <windows.h>
#endif
-/* A version of gettimeofday that just sets tv_sec from time(3) on Unix-like
- systems that don't have it, or a version for Win32 systems. */
+#ifdef WINDOWS_NATIVE
+
+# if !(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
+
+/* Avoid warnings from gcc -Wcast-function-type. */
+# define GetProcAddress \
+ (void *) GetProcAddress
+
+/* GetSystemTimePreciseAsFileTime was introduced only in Windows 8. */
+typedef void (WINAPI * GetSystemTimePreciseAsFileTimeFuncType) (FILETIME *lpTime);
+static GetSystemTimePreciseAsFileTimeFuncType GetSystemTimePreciseAsFileTimeFunc = NULL;
+static BOOL initialized = FALSE;
+
+static void
+initialize (void)
+{
+ HMODULE kernel32 = LoadLibrary ("kernel32.dll");
+ if (kernel32 != NULL)
+ {
+ GetSystemTimePreciseAsFileTimeFunc =
+ (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime");
+ }
+ initialized = TRUE;
+}
+
+# else /* !(_WIN32_WINNT >= _WIN32_WINNT_WIN8) */
+
+# define GetSystemTimePreciseAsFileTimeFunc GetSystemTimePreciseAsFileTime
+
+# endif /* !(_WIN32_WINNT >= _WIN32_WINNT_WIN8) */
+
+#endif /* WINDOWS_NATIVE */
+
+/* This is a wrapper for gettimeofday. It is used only on systems
+ that lack this function, or whose implementation of this function
+ causes problems.
+ Work around the bug in some systems whereby gettimeofday clobbers
+ the static buffer that localtime uses for its return value. The
+ gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has
+ this problem. */
+
int
gettimeofday (struct timeval *restrict tv, void *restrict tz)
{
-#if !defined (_WIN32)
+#undef gettimeofday
+#ifdef WINDOWS_NATIVE
+
+ /* On native Windows, there are two ways to get the current time:
+ GetSystemTimeAsFileTime
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>
+ or
+ GetSystemTimePreciseAsFileTime
+ <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>.
+ GetSystemTimeAsFileTime produces values that jump by increments of
+ 15.627 milliseconds (!) on average.
+ Whereas GetSystemTimePreciseAsFileTime values usually jump by 1 or 2
+ microseconds.
+ More discussion on this topic:
+ <http://www.windowstimestamp.com/description>. */
+ FILETIME current_time;
+
+# if !(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
+ if (!initialized)
+ initialize ();
+# endif
+ if (GetSystemTimePreciseAsFileTimeFunc != NULL)
+ GetSystemTimePreciseAsFileTimeFunc (¤t_time);
+ else
+ GetSystemTimeAsFileTime (¤t_time);
+
+ /* Convert from FILETIME to 'struct timeval'. */
+ /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+ ULONGLONG since_1601 =
+ ((ULONGLONG) current_time.dwHighDateTime << 32)
+ | (ULONGLONG) current_time.dwLowDateTime;
+ /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89 leap
+ years, in total 134774 days. */
+ ULONGLONG since_1970 =
+ since_1601 - (ULONGLONG) 134774 * (ULONGLONG) 86400 * (ULONGLONG) 10000000;
+ ULONGLONG microseconds_since_1970 = since_1970 / (ULONGLONG) 10;
+ *tv = (struct timeval) {
+ .tv_sec = microseconds_since_1970 / (ULONGLONG) 1000000,
+ .tv_usec = microseconds_since_1970 % (ULONGLONG) 1000000
+ };
+
+ return 0;
+
+#else /* !WINDOWS_NATIVE */
+
tv->tv_sec = (time_t) time ((time_t *)0);
tv->tv_usec = 0;
-#else
- /* EPOCH is the number of 100 nanosecond intervals from
- January 1, 1601 (UTC) to January 1, 1970.
- (the correct value has 9 trailing zeros) */
- static const uint64_t EPOCH = ((uint64_t) 116444736000000000ULL);
-
- SYSTEMTIME system_time;
- FILETIME file_time;
- uint64_t time;
-
- GetSystemTime(&system_time);
- SystemTimeToFileTime(&system_time, &file_time);
- time = ((uint64_t)file_time.dwLowDateTime);
- time += ((uint64_t)file_time.dwHighDateTime) << 32;
-
- tp->tv_sec = (long) ((time - EPOCH) / 10000000L);
- tp->tv_usec = (long) (system_time.wMilliseconds * 1000);
-#endif
return 0;
+
+#endif /* !WINDOWS_NATIVE */
}
-#endif
+
+#endif /* !HAVE_GETTIMEOFDAY */
/* histfile.c - functions to manipulate the history file. */
-/* Copyright (C) 1989-2019,2023-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1989-2019,2023-2025 Free Software Foundation, Inc.
This file contains the GNU History Library (History), a set of
routines for managing the text of previously typed lines.
#endif
goto error_and_exit;
}
-
- file_size = (size_t)finfo.st_size;
-
- /* check for overflow on very large files */
- if (file_size != finfo.st_size || file_size + 1 < file_size)
+ else
{
- errno = overflow_errno;
- goto error_and_exit;
- }
+ /* regular file */
+ file_size = (size_t)finfo.st_size;
- if (file_size == 0)
- {
- xfree (input);
- close (file);
- return 0; /* don't waste time if we don't have to */
+ /* check for overflow on very large files */
+ if (file_size != finfo.st_size || file_size + 1 < file_size)
+ {
+ errno = overflow_errno;
+ goto error_and_exit;
+ }
+
+ if (file_size == 0)
+ {
+ xfree (input);
+ close (file);
+ return 0; /* don't waste time if we don't have to */
+ }
}
#ifdef HISTORY_USE_MMAP
/* input.c -- character input functions for readline. */
-/* Copyright (C) 1994-2022 Free Software Foundation, Inc.
+/* Copyright (C) 1994-2025 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
timerclear (&it.it_value);
setitimer (ITIMER_REAL, &it, NULL);
}
-# else
-# if defined (__MINGW32_MAJOR_VERSION)
+# else /* !HAVE_SETITIMER */
+# if defined (__MINGW32_MAJOR_VERSION)
/* mingw.org's MinGW doesn't have alarm(3). */
unsigned int
alarm (unsigned int seconds)
{
return 0;
}
-# endif
+# endif /* __MINGW32_MAJOR_VERSION */
static int
set_alarm (unsigned int *secs, unsigned int *usecs)
{
alarm (0);
}
-# endif
-#endif
+# endif /* !HAVE_SETITIMER */
+#endif /* RL_TIMEOUT_USE_SIGALRM */
/* Set a timeout which will be used for the next call of `readline
()'. When (0, 0) are specified the timeout is cleared. */
[am_cv_langinfo_codeset=no])
])
if test $am_cv_langinfo_codeset = yes; then
+ AC_DEFINE([HAVE_NL_LANGINFO], [1])
AC_DEFINE([HAVE_LANGINFO_CODESET], [1],
[Define if you have <langinfo.h> and nl_langinfo(CODESET).])
fi
} while (0)
#endif
+#ifndef TIMESPEC_TO_TIMEVAL
+# define TIMESPEC_TO_TIMEVAL(tv, ts) \
+ do { \
+ (tv)->tv_sec = (ts)->tv_sec; \
+ (tv)->tv_usec = (tv)->tv_nsec / 1000; \
+ } while (0)
+#endif
+
#endif /* _POSIXTIME_H_ */
{
switch (wc)
{
- case ' ': case '!': case '"': case '#': case '%':
- case '&': case '\'': case '(': case ')': case '*':
- case '+': case ',': case '-': case '.': case '/':
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- case ':': case ';': case '<': case '=': case '>':
- case '?':
- case 'A': case 'B': case 'C': case 'D': case 'E':
- case 'F': case 'G': case 'H': case 'I': case 'J':
- case 'K': case 'L': case 'M': case 'N': case 'O':
- case 'P': case 'Q': case 'R': case 'S': case 'T':
- case 'U': case 'V': case 'W': case 'X': case 'Y':
- case 'Z':
- case '[': case '\\': case ']': case '^': case '_':
- case 'a': case 'b': case 'c': case 'd': case 'e':
- case 'f': case 'g': case 'h': case 'i': case 'j':
- case 'k': case 'l': case 'm': case 'n': case 'o':
- case 'p': case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x': case 'y':
- case 'z': case '{': case '|': case '}': case '~':
+ case L' ': case L'!': case L'"': case L'#': case L'%':
+ case L'&': case L'\'': case L'(': case L')': case L'*':
+ case L'+': case L',': case L'-': case L'.': case L'/':
+ case L'0': case L'1': case L'2': case L'3': case L'4':
+ case L'5': case L'6': case L'7': case L'8': case L'9':
+ case L':': case L';': case L'<': case L'=': case L'>':
+ case L'?':
+ case L'A': case L'B': case L'C': case L'D': case L'E':
+ case L'F': case L'G': case L'H': case L'I': case L'J':
+ case L'K': case L'L': case L'M': case L'N': case L'O':
+ case L'P': case L'Q': case L'R': case L'S': case L'T':
+ case L'U': case L'V': case L'W': case L'X': case L'Y':
+ case L'Z':
+ case L'[': case L'\\': case L']': case L'^': case L'_':
+ case L'a': case L'b': case L'c': case L'd': case L'e':
+ case L'f': case L'g': case L'h': case L'i': case L'j':
+ case L'k': case L'l': case L'm': case L'n': case L'o':
+ case L'p': case L'q': case L'r': case L's': case L't':
+ case L'u': case L'v': case L'w': case L'x': case L'y':
+ case L'z': case L'{': case L'|': case L'}': case L'~':
return 1;
default:
return wcwidth (wc);
/* rlprivate.h -- functions and variables global to the readline library,
but not intended for use by applications. */
-/* Copyright (C) 1999-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1999-2025 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
/* signals.c -- signal handling support for readline. */
-/* Copyright (C) 1987-2024 Free Software Foundation, Inc.
+/* Copyright (C) 1987-2025 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.