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