Skip to content
  • jim warner's avatar
    top: attempt to provide missing xterm vim keys support · e7aa90a8
    jim warner authored
    A recent issue (and merge request) reminded me of gaps
    in top's alternate 'vim' navigation keys support. Some
    xterm emulators do not pass the customary strings when
    keys were used with the <Ctrl> and/or <Alt> modifiers.
    
    While it was a known problem, this issue/merge request
    prompted research into the root cause. As it turns out
    the problem is traceable to an X resource known by the
    name 'eightBitInput'. When 'true' (the default), a key
    pressed in combination with <Alt> will not be preceded
    by the <Esc> character. Rather, a single character was
    presented (modified via an 'eightBitMeta' X resource).
    
    The following approaches would eliminate this problem:
    
    . start xterm thus: xterm -xrm '*eightBitInput: false'
    
    . use: ~/.Xresources with 'Xterm*eightBitInput: false'
    
    . build xterm with 'configure --enable-meta-sends-esc'
    ( apparently used for CentOS, Fedora, openSUSE, etc. )
    
    . enable xterm's menu via 'configure --enable-toolbar'
    ( so the user can set the 'Meta Sends Escape' option )
    
    Of course, none of the above steps is desirable from a
    user's perspective. So, this patch will add additional
    entries to the iokey function's tinfo_tab to represent
    strings passed when the <Alt> key does not send <Esc>.
    
    [ hopefully they'll be the same across all platforms ]
    
    Lastly, this patch will also eliminate those redundant
    <Atl> + '\', '/', '<' & '>' provisions, which now seem
    like overkill and suffer from that same 'eightBitMeta'
    xterm problem. And we might as well say goodbye to the
    4 '<Alt> + arrow key' table entries (which do not seem
    to currently work with any emulator which I can find).
    
    [ what in the world was I thinking way back in 2011? ]
    
    Reference(s):
    . issue
    procps-ng/procps#135
    . merge request
    procps-ng/procps!84
    
    
    
    Signed-off-by: default avatarJim Warner <james.warner@comcast.net>
    e7aa90a8
To find the state of this project's repository at the time of any of these versions, check out the tags.