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