OpenBSD CVS

CVS log for src/usr.bin/tmux/Attic/xterm-keys.c


[BACK] Up to [local] / src / usr.bin / tmux

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.23, Sat May 16 16:30:59 2020 UTC (4 years ago) by nicm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.22: +1 -1 lines
FILE REMOVED

xterm-keys has been on by default for five years and all other modern
terminals use these key sequences by default. Merge the code into the
main tty and input tree processing (converting the latter to use a tree
rather than a table at the same time) and make the option a no-op.

Revision 1.22 / (download) - annotate - [select for diffs], Sun May 7 21:25:59 2017 UTC (7 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.21: +11 -3 lines
Diff to previous 1.21 (colored)

Up to now, tmux sees \033\033[OA as M-Up and since we turned on
xterm-keys by default, generates \033[1;3A instead of
\033\033[OA. Unfortunately this confuses vi, which doesn't understand
xterm keys and now sees Escape+Up pressed within escape-time as Escape
followed by A.

The issue doesn't happen in xterm itself because it gets the keys from X
and can distinguish between a genuine M-Up and Escape+Up.

Because xterm can, tmux can too: xterm will give us \033[1;3A (that is,
kUP3) for a real M-Up and \033\033OA for Escape+Up - in fact, we can be
sure any \033 preceding an xterm key is a real Escape key press because
Meta would be part of the xterm key instead of a separate \033.

So change tmux to recognise both sequences as M-Up for its own purposes,
but generate the xterm version of M-Up only if it originally received
the xterm version from the terminal.

This means we will return to sending \033\033OA instead of the xterm key
for terminals that do not support xterm keys themselves, but there is no
practical way around this because they do not allow us to distinguish
between Escape+Up and M-Up. xterm style escape sequences are now the de
facto standard for these keys in any case.

Problem reported by jsing@ and subsequently by Cecile Tonglet in GitHub
issue 907.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Jan 25 14:36:08 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.20: +12 -33 lines
Diff to previous 1.20 (colored)

Revert previous for now, it will break TERM=screen.

Revision 1.20 / (download) - annotate - [select for diffs], Wed Jan 25 14:24:54 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.19: +34 -13 lines
Diff to previous 1.19 (colored)

If xterm-keys is on, use xterm(1) style keys for Home and End as well as
modified keys.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Oct 3 22:52:11 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.18: +8 -7 lines
Diff to previous 1.18 (colored)

Remove some dead code in cmd-move-window.c and make a load of local
functions static.

Revision 1.18 / (download) - annotate - [select for diffs], Tue Jan 19 15:59:12 2016 UTC (8 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

I no longer use my SourceForge address so replace it.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Nov 12 11:05:34 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.16: +13 -10 lines
Diff to previous 1.16 (colored)

Support UTF-8 key bindings by expanding the key type from int to
uint64_t and converting UTF-8 to Unicode on input and the reverse on
output. (This allows key bindings, there are still omissions - the
largest being that the various prompts do not accept UTF-8.)

Revision 1.16 / (download) - annotate - [select for diffs], Sun Aug 30 15:43:40 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.15: +3 -1 lines
Diff to previous 1.15 (colored)

Some style nits and dead assignments.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jul 21 10:25:48 2014 UTC (9 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.14: +1 -9 lines
Diff to previous 1.14 (colored)

Drop explicit support for F13-F20 and change to match the xterm terminfo
entry:

        F13-F24 are S-F1 to S-F12
        F25-F36 are C-F1 to C-F12
        F37-F48 are C-S-F1 to C-S-F12
        F49-F60 are M-F1 to M-F12
and     F61-F63 are M-S-F1 to M-S-F3

This should be no difference for applications inside tmux, but means
that any key binding for F13 will need to be replaced by S-F1 and so on.

Revision 1.14 / (download) - annotate - [select for diffs], Tue May 27 13:04:42 2014 UTC (9 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.13: +47 -34 lines
Diff to previous 1.13 (colored)

Handle the top bit of xterm(1)-style modifier keys, based on a diff from
Balazs Kezes.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Feb 10 11:20:41 2014 UTC (10 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.12: +4 -2 lines
Diff to previous 1.12 (colored)

The last fix to xterm keys meant that some keys such as \033OA were
being wrongly treated as partial matches. So both check xterm keys after
standard keys and only wildcard the minimum required ('1' to
'8'). Problems reported by Ralf Horstmann and Tim van der Molen.

Revision 1.12 / (download) - annotate - [select for diffs], Fri Jan 31 11:20:28 2014 UTC (10 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored)

Fix partial matches with xterm-keys on, from m0viefreak dot cm at
googlemail dot com.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Mar 22 10:30:04 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.10: +29 -1 lines
Diff to previous 1.10 (colored)

In terminals with XT, turn on modifyOtherKeys=1 with the escape sequence
and handle the most common set. Pass them through if xterm-keys is on.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Jun 23 10:02:49 2011 UTC (12 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.9: +7 -3 lines
Diff to previous 1.9 (colored)

Add a couple of extra xterm-style keys that gnome terminal provides,
from Dustin Kirkland.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Mar 27 20:31:25 2011 UTC (13 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.8: +1 -3 lines
Diff to previous 1.8 (colored)

Don't include meta twice when working out the flags to output for
xterm-style keys - bit 3 is accepted on input but not on output. Also a
style nit in the header.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Jan 1 03:43:20 2011 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.7: +8 -8 lines
Diff to previous 1.7 (colored)

Last few tables that should be const.

Revision 1.7 / (download) - annotate - [select for diffs], Thu Oct 14 00:37:51 2010 UTC (13 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.6: +5 -1 lines
Diff to previous 1.6 (colored)

Treat the meta bit in the xterm extended modifier key set as the same as
escape (tmux's meta). From Emanuele Giaquinta.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Sep 1 21:11:14 2010 UTC (13 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.5: +20 -37 lines
Diff to previous 1.5 (colored)

Simplify xterm modifier detection by treating as a bitmask + 1. Spotted
by and diff from Emanuele Giaquinta.

Revision 1.5 / (download) - annotate - [select for diffs], Thu Dec 3 22:50:10 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.4: +9 -9 lines
Diff to previous 1.4 (colored)

Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying
colours...

Revision 1.4 / (download) - annotate - [select for diffs], Mon Nov 30 16:44:03 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.3: +26 -13 lines
Diff to previous 1.3 (colored)

Handle partial xterm function key sequences.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Nov 5 19:35:16 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.2: +5 -5 lines
Diff to previous 1.2 (colored)

Old xterm F1-F4 are \033O_P not \033[O_P.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Oct 26 18:16:32 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.1: +1 -2 lines
Diff to previous 1.1 (colored)

Nuke accidentally-committed debugging statement.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Oct 26 17:46:33 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN

Rewrite xterm-keys code (both input and output) so that works (doesn't always
output the same modifiers, accepts all the possible input keys) and is more
understandable.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.