[f8d632ac] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[f8d632ac] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
| 7 |
|
---|
[0290a023] | 8 | <sect1 id="postlfs-config-inputrc" xreflabel="Introduction to /etc/inputrc">
|
---|
[c594bf3] | 9 | <?dbhtml filename="inputrc.html"?>
|
---|
| 10 |
|
---|
| 11 | <sect1info>
|
---|
| 12 | <othername>$LastChangedBy$</othername>
|
---|
| 13 | <date>$Date$</date>
|
---|
| 14 | </sect1info>
|
---|
| 15 |
|
---|
| 16 | <title>Introduction to /etc/inputrc</title>
|
---|
| 17 |
|
---|
| 18 | <indexterm zone="postlfs-config-inputrc">
|
---|
| 19 | <primary sortas="e-etc-inputrc">/etc/inputrc</primary>
|
---|
| 20 | </indexterm>
|
---|
| 21 |
|
---|
| 22 | <indexterm zone="postlfs-config-inputrc">
|
---|
| 23 | <primary sortas="e-AA.inputrc">~/.inputrc</primary>
|
---|
| 24 | </indexterm>
|
---|
| 25 |
|
---|
[e0d33ef] | 26 | <para><filename>/etc/inputrc</filename> deals with the mapping of the
|
---|
[c594bf3] | 27 | keyboard for certain situations. This file is the start-up file used by
|
---|
[e0d33ef] | 28 | <application>readline</application>, the input related library used by
|
---|
[c594bf3] | 29 | <application>bash</application> and most other shells.</para>
|
---|
| 30 |
|
---|
| 31 | <para>For more information see <command>info bash</command>—<emphasis
|
---|
| 32 | role="strong">Node: Readline Init</emphasis> file as well as
|
---|
[e0d33ef] | 33 | <command>info readline</command>. There is a lot that can be done with this
|
---|
[c594bf3] | 34 | one rc file.</para>
|
---|
| 35 |
|
---|
| 36 | <para>Global values are set in <filename>/etc/inputrc</filename>.
|
---|
| 37 | Personal user values are set in <filename>~/.inputrc</filename>. The
|
---|
| 38 | <filename>~/.inputrc</filename> file will override the global settings
|
---|
| 39 | file. A later page sets up <application>Bash</application> to use
|
---|
[d612b9f] | 40 | <filename>/etc/inputrc</filename> if there is no <filename>.inputrc</filename>
|
---|
[bbdb0ff4] | 41 | for a user when <filename>/etc/profile</filename> is read (usually at login).
|
---|
[c594bf3] | 42 | If you want your system to use both, or don't want <emphasis>global</emphasis>
|
---|
| 43 | keyboard handling, it is a good idea to place a default
|
---|
[e0d33ef] | 44 | <filename>.inputrc</filename> into the <filename
|
---|
[c594bf3] | 45 | class="directory">/etc/skel</filename> directory for use with new users.</para>
|
---|
| 46 |
|
---|
| 47 | <para>Below is a base <filename>/etc/inputrc</filename> along with
|
---|
| 48 | comments to explain what the various options do. Note that comments
|
---|
| 49 | can <emphasis>not</emphasis> be on the same line as commands.</para>
|
---|
| 50 |
|
---|
| 51 | <para>If you will create an <filename>.inputrc</filename> in
|
---|
[e0d33ef] | 52 | <filename class="directory">/etc/skel</filename> using the command below,
|
---|
| 53 | change the command's output to <filename>/etc/skel/.inputrc</filename> and
|
---|
[c594bf3] | 54 | be sure to check/set permissions afterward. Then you can just copy that
|
---|
| 55 | file to <filename>/etc/inputrc</filename> and the home directory
|
---|
[e0d33ef] | 56 | of any user already existing in the system, including <systemitem
|
---|
[c594bf3] | 57 | class="username">root</systemitem>, that needs
|
---|
[d612b9f] | 58 | a private version of the file. Be sure to use the <option>-p</option>
|
---|
[e0d33ef] | 59 | parameter of <command>cp</command> to maintain permissions and be sure to
|
---|
[c594bf3] | 60 | change owner and group appropriately.</para>
|
---|
| 61 |
|
---|
| 62 | <screen role="root"><userinput>cat > /etc/inputrc << "EOF"
|
---|
| 63 | <literal># Begin /etc/inputrc
|
---|
[9a67723] | 64 |
|
---|
| 65 | # Make sure we don't output everything on the 1 line
|
---|
[f45b1953] | 66 | set horizontal-scroll-mode Off
|
---|
| 67 |
|
---|
[0a216f08] | 68 | # Enable 8bit input
|
---|
[e0d33ef] | 69 | set meta-flag On
|
---|
[0a216f08] | 70 | set input-meta On
|
---|
| 71 |
|
---|
| 72 | # Turns off 8th bit stripping
|
---|
| 73 | set convert-meta Off
|
---|
| 74 |
|
---|
| 75 | # Keep the 8th bit for display
|
---|
| 76 | set output-meta On
|
---|
| 77 |
|
---|
| 78 | # none, visible or audible
|
---|
| 79 | set bell-style none
|
---|
[f45b1953] | 80 |
|
---|
[e0d33ef] | 81 | # All of the following map the escape sequence of the
|
---|
| 82 | # value contained inside the 1st argument to the
|
---|
[f45b1953] | 83 | # readline specific functions
|
---|
| 84 |
|
---|
| 85 | "\eOd": backward-word
|
---|
| 86 | "\eOc": forward-word
|
---|
| 87 |
|
---|
| 88 | # for linux console
|
---|
| 89 | "\e[1~": beginning-of-line
|
---|
| 90 | "\e[4~": end-of-line
|
---|
| 91 | "\e[5~": beginning-of-history
|
---|
| 92 | "\e[6~": end-of-history
|
---|
| 93 | "\e[3~": delete-char
|
---|
| 94 | "\e[2~": quoted-insert
|
---|
| 95 |
|
---|
| 96 | # for xterm
|
---|
| 97 | "\eOH": beginning-of-line
|
---|
[9a67723] | 98 | "\eOF": end-of-line
|
---|
| 99 |
|
---|
[c594bf3] | 100 | # End /etc/inputrc</literal>
|
---|
| 101 | EOF</userinput></screen>
|
---|
[9a67723] | 102 |
|
---|
[f45b1953] | 103 | </sect1>
|
---|