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