inputrc.xml 3.3 KB

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