On Sat, May 24, 2014 at 12:06:18PM +0100, Balazs Kezes wrote:
> On 2014-05-23 12:48 +0100, Nicholas Marriott wrote:
> > I think this can be made neater by making xterm_keys_modifiers do all
> > the work directly rather than searching for the _ all over again,
> > please look at this:
> 
> Yes, this approach looks much nicer, thanks! Two nits:
> 
> > +   if (buf[*pos] < '0' || buf[*pos] > '9')
> > +           return (-1);
> > +   flags = buf[(*pos)++] - '0';
> > +   if (buf[*pos] >= '0' && buf[*pos] <= '9')
> > +           flags = (flags * 10) + (buf[(*pos)++] - '0');
> 
> You will need a "flags -= 1" after this because for some weird reason
> this bitmask has an offset of 1. Without this tmux generates different
> escape sequences than what you get in xterm.

Yes, you're right.

> > +   if (flags & 16)
> > +           *modifiers != KEYC_ESCAPE;
> 
> s/!/|/ otherwise this has no effect. But why is checking the fifth bit
> needed at all when we only have 4 modifiers?

Whoops, I thought we were adding one but we already handle both meta and
alt, just couldn't parse them.

------------------------------------------------------------------------------
The best possible search technologies are now affordable for all companies.
Download your FREE open source Enterprise Search Engine today!
Our experts will assist you in its installation for $59/mo, no commitment.
Test it for FREE on our Cloud platform anytime!
http://pubads.g.doubleclick.net/gampad/clk?id=145328191&iu=/4140/ostg.clktrk
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to