[vox-tech] readline questions (in bash)

Mike Simons vox-tech@lists.lugod.org
Fri, 13 Jun 2003 12:49:27 -0400


--eNMatiwYGLtwo1cJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Jun 13, 2003 at 08:28:07AM -0500, Jay Strauss wrote:
> 1. I know ctr-a, ctr-e move me from front to back, how do I make my home =
and
> end keys do that?

  home/end should work as you expect.  If they don't there is a local
config problem.

> 2. Isn't cut and paste (kill/yank) supposed to keep a list of commands, t=
hat
> I can scroll through?  When I use it, it only saves the last command I
> killed

from "man readline"
=3D=3D=3D
       yank (C-y)
              Yank the top of the kill ring into  the  buffer  at
              point.
       yank-pop (M-y)
              Rotate  the  kill ring, and yank the new top.  Only
              works following yank or yank-pop.
=3D=3D=3D

  So after typing ^Y, type alt-y to rotate through kill history.

> 3. If I up/down arrow I scroll thru my commands.  But when I try to use C=
-r
> or C-s I don't see all the commands in my history.  Is there another way =
to
> search thru and execute a command in the history (ideally it would
> autocomplete and scroll (like vim does when you want to read in a file))

  The ^R and ^S options start their search from the location in the
history you are at, and go in the correct direction.  Like most other
utilities (less, vi, etc) they stop when they hit the end of your history.
  So if you are going to do a history search just type ^R.  If you have
scrolled around in the history you can use the following M-> to get to=20
the end before ^R
=3D=3D=3D
       beginning-of-history (M-<)
              Move to the first line in the history.
       end-of-history (M->)
              Move  to  the  end  of the input history, i.e., the
              line currently being entered.
=3D=3D=3D

  If you have typed in a few characters into the ^R search and do not
find the entry you want, type ^R again to move to the previous entries.

  Be warned that ^S does not work for searching because it is bound to the
tty "stop" function by default.  see "stty -a" for a list of bindings.
If you run:
  stty stop undef
first you can use ^S to move to the next (instead of previous) incremental
search item.  You also could use M-<, then ^S to search down from the oldest
history.  Unless you do the stty, then readline will not get the character
presses and it will appear that nothing is happening.

    TTFN,
      Mike

ps:
  I suggest reading the readline man page.

--=20
GPG key: http://simons-clan.com/~msimons/gpg/msimons.asc
Fingerprint: 524D A726 77CB 62C9 4D56  8109 E10C 249F B7FA ACBE

--eNMatiwYGLtwo1cJ
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE+6gCW4Qwkn7f6rL4RAhiYAJ9IbzCcxmwLIbCvyeeSxHPJNuOZQwCeJjYi
t6zQOYCtr9tC1L15yvieTVU=
=aFSE
-----END PGP SIGNATURE-----

--eNMatiwYGLtwo1cJ--