[f45b1953] | 1 | <sect1 id="postlfs-config-inputrc">
|
---|
| 2 | <?dbhtml filename="inputrc.html" dir="postlfs"?>
|
---|
| 3 | <title>/etc/inputrc</title>
|
---|
| 4 |
|
---|
| 5 | <para>There are a number of configuration files that are common to all
|
---|
[75d7f3d7] | 6 | Linux systems. Inputrc deals with the mapping of the keybord in ceratin
|
---|
[f45b1953] | 7 | situations. This file is the start-up file used by readline - the input
|
---|
| 8 | related library used by bash and most other shells. By changing this file
|
---|
| 9 | you can change how certain keys act in different situations. The following
|
---|
| 10 | is a simple inputrc along with comments to explain what the various
|
---|
| 11 | options do.</para>
|
---|
| 12 |
|
---|
| 13 | <para>The following file can be used as
|
---|
| 14 | <filename>/etc/inputrc</filename> or <filename>~/.inputrc</filename> as
|
---|
| 15 | appropriate. See below for more details on which to use.</para>
|
---|
| 16 |
|
---|
[0a216f08] | 17 | <para>Please note that comments can <emphasis>not</emphasis> be on the
|
---|
| 18 | same line as commands in <filename>inputrc</filename>.</para>
|
---|
| 19 |
|
---|
[75d7f3d7] | 20 | <para><screen># Make sure we don't output everything on the 1 line
|
---|
[f45b1953] | 21 | set horizontal-scroll-mode Off
|
---|
| 22 |
|
---|
[0a216f08] | 23 | # Enable 8bit input
|
---|
| 24 | set meta-flag On
|
---|
| 25 | set input-meta On
|
---|
| 26 |
|
---|
| 27 | # Turns off 8th bit stripping
|
---|
| 28 | set convert-meta Off
|
---|
| 29 |
|
---|
| 30 | # Keep the 8th bit for display
|
---|
| 31 | set output-meta On
|
---|
| 32 |
|
---|
| 33 | # none, visible or audible
|
---|
| 34 | set bell-style none
|
---|
[f45b1953] | 35 |
|
---|
| 36 | # All of the following map the escape sequence of the
|
---|
| 37 | # value contained inside the 1st argument to the
|
---|
| 38 | # readline specific functions
|
---|
| 39 |
|
---|
| 40 | "\eOd": backward-word
|
---|
| 41 | "\eOc": forward-word
|
---|
| 42 |
|
---|
| 43 | # for linux console
|
---|
| 44 | "\e[1~": beginning-of-line
|
---|
| 45 | "\e[4~": end-of-line
|
---|
| 46 | "\e[5~": beginning-of-history
|
---|
| 47 | "\e[6~": end-of-history
|
---|
| 48 | "\e[3~": delete-char
|
---|
| 49 | "\e[2~": quoted-insert
|
---|
| 50 |
|
---|
| 51 | # for xterm
|
---|
| 52 | "\eOH": beginning-of-line
|
---|
| 53 | "\eOF": end-of-line</screen></para>
|
---|
| 54 |
|
---|
[a97d572] | 55 | <para>Please see the manual pages for more information. For more
|
---|
| 56 | information, look at bash(1) and search for readline, or if you have
|
---|
| 57 | the readline package installed, look at readline(3). There is a lot that
|
---|
[f45b1953] | 58 | can be done with this single rc file.</para>
|
---|
| 59 |
|
---|
| 60 | <para>Note that the readline library checks ~/.inputrc, by default. If
|
---|
| 61 | you want to use <filename>/etc/inputrc</filename> as your global
|
---|
| 62 | inputrc (i.e. for all users), you will need to add the line
|
---|
[f8060f3e] | 63 | <screen><userinput>export INPUTRC=/etc/inputrc</userinput></screen>
|
---|
| 64 | to your .bash_profile, .bashrc or .profile file as appropriate. To make
|
---|
| 65 | the file truly global, you may wish to add it to your
|
---|
| 66 | <filename>/etc/profile</filename> file.</para>
|
---|
[f45b1953] | 67 |
|
---|
[0a216f08] | 68 | <para>If you want to use per-user <userinput>.inputrc</userinput> files,
|
---|
| 69 | you can create one and drop it into <filename>/etc/skel</filename> for use
|
---|
[f45b1953] | 70 | when creating new users.</para>
|
---|
| 71 |
|
---|
| 72 | </sect1>
|
---|