1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
5 | %general-entities;
|
---|
6 | ]>
|
---|
7 |
|
---|
8 | <sect1 id="ch-config-inputrc">
|
---|
9 | <?dbhtml filename="inputrc.html"?>
|
---|
10 |
|
---|
11 | <title>Creating the /etc/inputrc File</title>
|
---|
12 |
|
---|
13 | <indexterm zone="ch-config-inputrc">
|
---|
14 | <primary sortas="e-/etc/inputrc">/etc/inputrc</primary>
|
---|
15 | </indexterm>
|
---|
16 |
|
---|
17 | <para>The <filename>inputrc</filename> file is the configuration file for
|
---|
18 | the readline library, which provides editing capabilities while the user is
|
---|
19 | entering a line from the terminal. It works by translating keyboard inputs
|
---|
20 | into specific actions. Readline is used by bash and most other shells as
|
---|
21 | well as many other applications.</para>
|
---|
22 |
|
---|
23 | <para>Most people do not need user-specific functionality so the command
|
---|
24 | below creates a global <filename>/etc/inputrc</filename> used by everyone who
|
---|
25 | logs in. If you later decide you need to override the defaults on a per user
|
---|
26 | basis, you can create a <filename>.inputrc</filename> file in the user's home
|
---|
27 | directory with the modified mappings.</para>
|
---|
28 |
|
---|
29 | <para>For more information on how to edit the <filename>inputrc</filename>
|
---|
30 | file, see <command>info bash</command> under the <emphasis>Readline Init
|
---|
31 | File</emphasis> section. <command>info readline</command> is also a good
|
---|
32 | source of information.</para>
|
---|
33 |
|
---|
34 | <para>Below is a generic global <filename>inputrc</filename> along with comments
|
---|
35 | to explain what the various options do. Note that comments cannot be on the same
|
---|
36 | line as commands. Create the file using the following command:</para>
|
---|
37 |
|
---|
38 | <screen><userinput>cat > /etc/inputrc << "EOF"
|
---|
39 | <literal># Begin /etc/inputrc
|
---|
40 | # Modified by Chris Lynn <roryo@roryo.dynup.net>
|
---|
41 |
|
---|
42 | # Allow the command prompt to wrap to the next line
|
---|
43 | set horizontal-scroll-mode Off
|
---|
44 |
|
---|
45 | # Enable 8bit input
|
---|
46 | set meta-flag On
|
---|
47 | set input-meta On
|
---|
48 |
|
---|
49 | # Turns off 8th bit stripping
|
---|
50 | set convert-meta Off
|
---|
51 |
|
---|
52 | # Keep the 8th bit for display
|
---|
53 | set output-meta On
|
---|
54 |
|
---|
55 | # none, visible or audible
|
---|
56 | set bell-style none
|
---|
57 |
|
---|
58 | # All of the following map the escape sequence of the value
|
---|
59 | # contained in the 1st argument to the readline specific functions
|
---|
60 | "\eOd": backward-word
|
---|
61 | "\eOc": forward-word
|
---|
62 |
|
---|
63 | # for linux console
|
---|
64 | "\e[1~": beginning-of-line
|
---|
65 | "\e[4~": end-of-line
|
---|
66 | "\e[5~": beginning-of-history
|
---|
67 | "\e[6~": end-of-history
|
---|
68 | "\e[3~": delete-char
|
---|
69 | "\e[2~": quoted-insert
|
---|
70 |
|
---|
71 | # for xterm
|
---|
72 | "\eOH": beginning-of-line
|
---|
73 | "\eOF": end-of-line
|
---|
74 |
|
---|
75 | # for Konsole
|
---|
76 | "\e[H": beginning-of-line
|
---|
77 | "\e[F": end-of-line
|
---|
78 |
|
---|
79 | # End /etc/inputrc</literal>
|
---|
80 | EOF</userinput></screen>
|
---|
81 |
|
---|
82 | </sect1>
|
---|