[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Yet another suddenly-weird xterm



On Fri, Jan 11, 2002 at 12:17:28AM -0600, Ron Johnson wrote:
> >
> > so a bug report can be made
> 
> That fixed it, even though the values were
>   "^[[1~": beginning-of-line
>   "^[[4~": end-of-line
> and I had to add in the 2nd ", and descriptions.

There what your terminal is sending for those two keys. Mine's sending different. Is yours an xterm? Cause if it is, theres something wierd going on there to begin with.

> Here are the installed packages:
>   # dpkg -l > dpkg.installed
>   # grep bash dpkg.installed
>   ii  bash           2.05a-3        The GNU Bourne Again SHell
>   ii  bash-doc       2.05a-3        Documentation and examples for the
>   # grep readline dpkg.installed
>   ii  libreadline4   4.2a-3         GNU readline and history libraries
> 
> > $if term=xterm
> Why isn't it $TERM?

its readline.

Conditional Init Constructs
---------------------------

   Readline implements a facility similar in spirit to the conditional
compilation features of the C preprocessor which allows key bindings
and variable settings to be performed as the result of tests.  There
are four parser directives used.

`$if'
     The `$if' construct allows bindings to be made based on the
     editing mode, the terminal being used, or the application using
     Readline.  The text of the test extends to the end of the line; no
     characters are required to isolate it.

    `mode'
          The `mode=' form of the `$if' directive is used to test
          whether Readline is in `emacs' or `vi' mode.  This may be
          used in conjunction with the `set keymap' command, for
          instance, to set bindings in the `emacs-standard' and
          `emacs-ctlx' keymaps only if Readline is starting out in
          `emacs' mode.

    `term'
          The `term=' form may be used to include terminal-specific key
          bindings, perhaps to bind the key sequences output by the
          terminal's function keys.  The word on the right side of the
          `=' is tested against both the full name of the terminal and
          the portion of the terminal name before the first `-'.  This
          allows `sun' to match both `sun' and `sun-cmd', for instance.

    `application'
          The APPLICATION construct is used to include
          application-specific settings.  Each program using the
          Readline library sets the APPLICATION NAME, and you can test
          for it.  This could be used to bind key sequences to
          functions useful for a specific program.  For instance, the
          following command adds a key sequence that quotes the current
          or previous word in Bash:
               $if Bash
               # Quote the current or previous word
               "\C-xq": "\eb\"\ef\""
               $endif

`$endif'
     This command, as seen in the previous example, terminates an `$if'
     command.

`$else'
     Commands in this branch of the `$if' directive are executed if the
     test fails.

`$include'
     This directive takes a single filename as an argument and reads
     commands and bindings from that file.
          $include /etc/inputrc



Incidently you can set up other stuff. I set up my page up and page down keys (unshifted) to move word by word. Its easier than esc-f and esc-b.

info readline for more info.

Ill send a report to the bash package maintainers. I think its bash thats not playing nice here. It might even be a bug in bash (and nothing to do with the package maintainers). Even if its a 'feature' and not a bug, it would be nice for the readline package to include a nice /etc/inputrc

Kind Regards,
Crispin



Reply to: