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