[b32e803] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[b06ca36] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[b32e803] | 4 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 5 | %general-entities;
|
---|
| 6 | ]>
|
---|
[d781ffb] | 7 |
|
---|
[afcfd74] | 8 | <sect1 id="ch-config-inputrc">
|
---|
[d781ffb] | 9 | <?dbhtml filename="inputrc.html"?>
|
---|
| 10 |
|
---|
| 11 | <title>Creating the /etc/inputrc File</title>
|
---|
[b32e803] | 12 |
|
---|
[afcfd74] | 13 | <indexterm zone="ch-config-inputrc">
|
---|
[d781ffb] | 14 | <primary sortas="e-/etc/inputrc">/etc/inputrc</primary>
|
---|
| 15 | </indexterm>
|
---|
[81fd230] | 16 |
|
---|
[98a9662e] | 17 | <para>The <filename>inputrc</filename> file is the configuration file for
|
---|
[a3d0817] | 18 | the readline library, which provides editing capabilities while the user is
|
---|
[598cd46] | 19 | entering a line from the terminal. It works by translating keyboard inputs
|
---|
[a3d0817] | 20 | into specific actions. Readline is used by bash and most other shells as
|
---|
[98a9662e] | 21 | well as many other applications.</para>
|
---|
[98a43ee] | 22 |
|
---|
[98a9662e] | 23 | <para>Most people do not need user-specific functionality so the command
|
---|
[d781ffb] | 24 | below creates a global <filename>/etc/inputrc</filename> used by everyone who
|
---|
[a3d0817] | 25 | logs in. If you later decide you need to override the defaults on a per user
|
---|
[d781ffb] | 26 | basis, you can create a <filename>.inputrc</filename> file in the user's home
|
---|
| 27 | directory with the modified mappings.</para>
|
---|
[98a43ee] | 28 |
|
---|
[d781ffb] | 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>
|
---|
[98a43ee] | 33 |
|
---|
[d781ffb] | 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>
|
---|
[f67f5cf] | 37 |
|
---|
| 38 | <screen><userinput>cat > /etc/inputrc << "EOF"
|
---|
[d72e04a] | 39 | <literal># Begin /etc/inputrc
|
---|
| 40 | # Modified by Chris Lynn <roryo@roryo.dynup.net>
|
---|
[b32e803] | 41 |
|
---|
[98a43ee] | 42 | # Allow the command prompt to wrap to the next line
|
---|
[b32e803] | 43 | set horizontal-scroll-mode Off
|
---|
| 44 |
|
---|
| 45 | # Enable 8bit input
|
---|
[c96a0bc] | 46 | set meta-flag On
|
---|
[b32e803] | 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 |
|
---|
[1652151] | 58 | # All of the following map the escape sequence of the value
|
---|
| 59 | # contained in the 1st argument to the readline specific functions
|
---|
[b32e803] | 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 |
|
---|
[d72e04a] | 79 | # End /etc/inputrc</literal>
|
---|
[f67f5cf] | 80 | EOF</userinput></screen>
|
---|
[b32e803] | 81 |
|
---|
| 82 | </sect1>
|
---|