bug-bash
[Top][All Lists]
Advanced

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

backward-line


From: Egmont Koblinger
Subject: backward-line
Date: Tue, 29 Jan 2013 00:07:49 +0100

Hi folks,

Sometimes I work with quite long command lines (4-5 lines on the screen)
and I need to modify something somewhere in the middle.  I know a couple of
ways to move the cursor there a little bit faster than holding the left
arrow (e.g. backward-word, or Alt+number then left arrow), I also know
about some non-interactive ways of editing a command line, but still I find
all these quite frustrating and time consuming.

The feature I've always missed from bash's line editing is to be able to
move the cursor up vertically by a line, using some shortcut key.  I
believe this makes the interactive editing of long command lines faster and
way more convenient.

I've quickly prototyped such a feature.  Please apply the attached patch,
put this in your .inputrc:
  "\e[1;5A": backward-line
  "\e[1;5B": forward-line
and try Ctrl+Up and Ctrl+Down on multi-line command lines to move the
cursor vertically.

Do you guys like this feature, do you think it could make it into official
bash?

If so, let me come up with a proper patch (it's going to be much more
complicated in order to support double wide characters.  The current one is
just a quick demo of the proposed feature which only works correctly with
single-cell characters.)


thx,
egmont

Attachment: bash-4.2.42-backward-line-forward-line-proof-of-concept.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]