delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/08/27/22:04:01

X-Spam-Check-By: sourceware.org
Message-ID: <46D382E8.1070603@cwilson.fastmail.fm>
Date: Mon, 27 Aug 2007 22:05:28 -0400
From: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: small problems with rxvt-20050409-6
References: <fav74s$rl$1 AT sea DOT gmane DOT org>
In-Reply-To: <fav74s$rl$1@sea.gmane.org>
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

Lapo Luchini wrote:
> Just a quick comment of the new package...
> 
> a) I guess the font system has changed, as it now both looks nicer and
> kindly ignore my previously working .Xsession line

Yeesh. you beat me to the announcement...

Short version: there is now an /etc/X11/app-defaults/Rxvt file.  You can 
edit in-place for persistent global defaults, create a ~/.Xdefaults file 
for per-user overrides -- and command line options always take 
precedence.  I'm not sure why .Xsession ever worked: rxvt, even in X11 
mode, never asks the Xserver for resources; it parses the ~/.X* files 
itself.

> b) alt-backspace deletes TWO words instead of one in both bash and zsh

Confirmed -- and windows-only (in X11 mode, I don't see this behavior). 
This is probably related to Corinna's patch that added some additional 
Alt- related keyevents to the main handling loop in the "W11" library:

   case WM_SYSKEYDOWN: /* some alt-keys go here */

maybe this causes the Alt-BS to get sent to the application twice? 
However, it doesn't happen on ALL alt-key combos.  Adding the following


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


to my .inputrc, and I was able to get word skip behavior with 
alt-left/alt-right.  So I'm reluctant to entirely remove Corinna's 
patch, because this wasn't possible before.

However, I think I found the problem.  Most of the time, W11 passes 
virtualkey events to the w32api TranslateMessate() -- which in turn 
inserts the translated char BACK into the message queue.

However, certain key events need to bypass this:
   shift-KP-plus and shift-KP-minus: are supposed to be intercepted
     by rxvt and used to increase/decrease the font size.  This
     doesn't really work.
   backspace -- regardless of shift/alt/ctrl -- is handled by rxvt
     itself, and (possible) translated to ^? or ^H depending on
     rxvt's settings.

This bypassing is handled here:

static void
doTranslateMessage(MSG *m)
{
    if ((m->message == WM_KEYDOWN) &&
        ((m->wParam == VK_BACK) ||
         (((m->wParam == VK_ADD) || (m->wParam == VK_SUBTRACT)) &&
          (GetKeyState(VK_SHIFT) & 0x8000))))
       return;

    TranslateMessage(m);
}

With Corinna's patch, we now hit this function with WM_SYSKEYDOWN and 
not just WM_KEYDOWN.  The following change seems to fix it:

static void
doTranslateMessage(MSG *m)
{
     if (((m->message == WM_KEYDOWN) || (m->message == WM_SYSKEYDOWN)) &&
         ((m->wParam == VK_BACK) ||
          (((m->wParam == VK_ADD) || (m->wParam == VK_SUBTRACT)) &&
           (GetKeyState(VK_SHIFT) & 0x8000))))
        return;

     TranslateMessage(m);
}

Look for rxvt-20050409-7 soon, and thanks for the report.

--
Chuck

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019