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

Re: Page-up/Page-down keys and shell history



Quoting Joost van der Lugt (jvdl@sirius.com):
> * David Wright <d.wright@open.ac.uk> [May 08. 2001 18:41]:
> > I'm not sure what hints to give, when I have no idea what you
> > mean by "messy".
> 
> Well finally had some time, and as said it seems all to be in the inputrc:
> 
> "\e[5~":history-search-backward
> "\e[6~":history-search-forward
> 
> this made Page up/down do the desired, but suddenly also the arrows keys
> displayed similar behaviour:-) (then you don't have it and then you have it
> double)
> 
> However since the left/right arrows in my aterm have been screwed for a
> while I 've decided to just put suse's complete inputrc in my
> home directory, which is kind of funny, but it works.

Well I guess that's what I'd expect. Perhaps they do no more than
add some other lines as I do (though I do use the arrows where you
use pagekeys). For others:

# Combine uparrow with ^R function:

"\e[A": history-search-backward
"\e[B": history-search-forward

# BUT we have to redefine these keys:

"\e[C": forward-char
"\e[D": backward-char

# AND downarrow will clear the line if the cursor has been moved left or right,
# AND recall leaves the cursor at the start of the line, which is better.

# Use these keys for something useful:

"\e[5~": backward-word
"\e[6~": forward-word
"\e\e[3~": kill-word
"\e[2~": end-of-history

Cheers,

-- 
Email:  d.wright@open.ac.uk   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.



Reply to: