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