Ben Giddings
3/9/2005 10:44:00 PM
Cs. Henk wrote:
> * zsh style: after entering a multiline command, the up arrow (or
> ctrl-p) brings back the whole multiline command in one. Then it behaves
> as an array of lines, up/down arrow moves between the lines, and
> left/right arrow moves within a line. As I know, there is no way to go
> back in one step from one multiline block to the other, you have to
> climb up linewise. While in general it's better than bash style, this
> latter behaviour could be quite painful after a ten line class
> definition. Maybe not an issue for a shell, but is an issue for irb.
>
> * pyrepl style: after entering a multiline command, ctrl-p
> brings back the whole multiline command in one, Then it behaves as an
> array of lines, up/down arrow moves between the lines, and left/right
> arrow moves within a line. Hitting ctrl-p/ctrl-n always moves between
> multiline blocks.
In zsh up-arrow and ctrl-p are both bound (by default) to
'up-line-or-history'. If you're on any given line of a command and hit
"meta-x up-history" you'll go to the previous entry, not up lines.
Getting the pyrepl behaviour should be as simple as binding Ctrl-P to
up-history.
> My idea is that pyrepl should be ported to ruby eventually. Not only it
> has the mentioned features, but then we would have a totally accessible
> and controllable access to readline functionality in pure ruby, and one
> wouldn't need to meditate which other parts of readline should have a ruby
> binding for being able to implement this idea or that.
Wasn't someone looking at rewriting readline so that we could have a non
GPLed readline implemenation for Ruby? In addition to the licensing
issue, this would sure make lives easier for OS X users.
Ben