On Tue, 18 Oct 2016 09:28:29 -0400 (EDT)
Josef Ridky <jri...@redhat.com> wrote:

> Hi, 
> I would like to ask for one thing about keybinding in screen.
> Following problem is the reason, why am I asking:
> -----------------------------------
> Description of problem:
> The home and end keys no longer work in screen when using tcsh as
> shell.
> Steps to Reproduce:
> 1. start screen:
> $ screen
> 2. start tcsh
> $ tcsh
> 3. make sure home and end are bound:
> $ bindkey | egrep '^(home|end)'
> home           -> beginning-of-line
> end            -> end-of-line
> 4. press home or end
> Actual results:
> pressing "home" and "end" prints a "~".
> Expected results:
> cursor jumps to the beginning or end of the line.
> -----------------------------------
> I think, that this behavior is caused by using 'term=xterm' in config
> file. Problem is, that this line has to be in the config file,
> because it solves other, much worse problem.
> Does anyone know, how to solve this without removing term=xterm?
> Thanks for your ideas.
> Regards
> Josef Ridky
> Associate Software Engineer
> Core Services Team
> Red Hat Czech, s.r.o.


yes, this may behave the way you describe, because terminfo entries for
those terms are different

On my system:
% infocmp xterm| grep 'khome\|kend'
 kdch1=\E[3~, kend=\EOF, kent=\EOM, kf1=\EOP, kf10=\E[21~,
kf8=\E[19~, kf9=\E[20~, khome=\EOH, kich1=\E[2~,
% infocmp screen| grep 'khome\|kend'
 kend=\E[4~, kf1=\EOP, kf10=\E[21~, kf11=\E[23~,
 khome=\E[1~, kich1=\E[2~, knp=\E[6~, kpp=\E[5~, nel=\EE,

Notice that khome and kend are different.

You may also compare escapes generated by those keys between outside
and inside of screen by typing 'Ctrl+v, home' and 'Ctrl+v, End'.

To fix this you can try adding something like this to your screenrc
termcapinfo xterm @7=\E[4~:kh=\E[1~

(magic letters are from 'man terminfo')

Btw, what worse problem does it solve?


Reply via email to