inputrc.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. <indexterm zone="ch-scripts-inputrc"><primary sortas="e-/etc/inputrc">/etc/inputrc</primary></indexterm>
  10. <para><filename>/etc/inputrc</filename> deals with the mapping of the keyboard for
  11. certain situations. This file is the start-up file used by
  12. <application>readline</application> - the input related library used by
  13. <application>Bash</application> and most other shells.</para>
  14. <para>For more information see <command>info bash</command> -- <emphasis
  15. role="strong">Node: Readline Init</emphasis> file as well as
  16. <command>info readline</command>. There is a lot that can be done with this
  17. one rc file.</para>
  18. <para>Global values are set in <filename>/etc/inputrc</filename>.
  19. Personal user values are set in <filename>~/.inputrc</filename>. The
  20. <filename>~/.inputrc</filename> file will override the global settings
  21. file. A later page sets up <application>Bash</application> to use
  22. <filename>/etc/inputrc</filename> if there is no
  23. <filename>.inputrc</filename> for a user when
  24. <filename>/etc/profile</filename> is read (usually at login). If you
  25. want your system to use both, or don't want <emphasis>global</emphasis>
  26. keyboard handling, it is a good idea to place a default
  27. <filename>.inputrc</filename> into the <filename class="directory">/etc/skel</filename>
  28. directory for use with new users.</para>
  29. <para>
  30. Below is a base <filename>/etc/inputrc</filename> along with
  31. comments to explain what the various options do. Note that comments
  32. can <emphasis>not</emphasis> be on the same line as commands.
  33. </para>
  34. <para>If you will create an <filename>.inputrc</filename> in
  35. <filename class="directory">/etc/skel</filename> using the command below, change the
  36. command's output to <filename>/etc/skel/.inputrc</filename> and be
  37. sure to check/set permissions afterward. Then you can just copy that
  38. file to <filename>/etc/inputrc</filename> and the home directory
  39. of any user already existing in the system, including root, that needs
  40. a private version of the file. Be sure to use the <parameter>-p</parameter> parameter
  41. of <command>cp</command> to maintain permissions and be sure to change owner and group
  42. appropriately.
  43. </para>
  44. <screen><userinput>cat &gt; /etc/inputrc &lt;&lt; "EOF"
  45. # Begin /etc/inputrc
  46. # Make sure we don't output everything on the 1 line
  47. set horizontal-scroll-mode Off
  48. # Enable 8bit input
  49. set meta-flag On
  50. set input-meta On
  51. # Turns off 8th bit stripping
  52. set convert-meta Off
  53. # Keep the 8th bit for display
  54. set output-meta On
  55. # none, visible or audible
  56. set bell-style none
  57. # All of the following map the escape sequence of the
  58. # value contained inside the 1st argument to the
  59. # readline specific functions
  60. "\eOd": backward-word
  61. "\eOc": forward-word
  62. # for linux console
  63. "\e[1~": beginning-of-line
  64. "\e[4~": end-of-line
  65. "\e[5~": beginning-of-history
  66. "\e[6~": end-of-history
  67. "\e[3~": delete-char
  68. "\e[2~": quoted-insert
  69. # for xterm
  70. "\eOH": beginning-of-line
  71. "\eOF": end-of-line
  72. # for Konsole
  73. "\e[H": beginning-of-line
  74. "\e[F": end-of-line
  75. # End /etc/inputrc
  76. EOF</userinput></screen>
  77. </sect1>