inputrc.xml 3.2 KB

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