OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.173 / (download) - annotate - [select for diffs], Thu Mar 21 11:47:55 2024 UTC (8 weeks, 2 days ago) by nicm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.172: +8 -18 lines
Diff to previous 1.172 (colored)

Look for feature code 21 for DECSLRM and 28 for DECFRA in the device
attributes and also accept level 1 (there is no hardware with this but
some emulators may use it). Pointed out by James Holderness.

Revision 1.172 / (download) - annotate - [select for diffs], Fri Sep 8 07:05:06 2023 UTC (8 months, 1 week ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4
Changes since 1.171: +11 -2 lines
Diff to previous 1.171 (colored)

On second thoughts, do check DA2 for DECFRA and DECSLRM since that will
catch terminals that say they are VT520 even if we can't use DA1
(because of VTE).

Revision 1.171 / (download) - annotate - [select for diffs], Fri Sep 8 06:52:31 2023 UTC (8 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.170: +14 -14 lines
Diff to previous 1.170 (colored)

Use DECSLRM and DECFRA only at level 4 rather than checking the terminal
id.

Revision 1.170 / (download) - annotate - [select for diffs], Thu Sep 7 10:21:46 2023 UTC (8 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.169: +4 -1 lines
Diff to previous 1.169 (colored)

Use DECSLRM and DECFRA on terminals pretending to be VT520 or VT525 as
well as VT420.

Revision 1.169 / (download) - annotate - [select for diffs], Thu Sep 7 07:19:21 2023 UTC (8 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.168: +7 -2 lines
Diff to previous 1.168 (colored)

Accept 65 for VT525 as well.

Revision 1.168 / (download) - annotate - [select for diffs], Sat Sep 2 20:03:10 2023 UTC (8 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.167: +1 -5 lines
Diff to previous 1.167 (colored)

Request terminal colours again on SIGWINCH but at most once every 30
seconds, GitHub issue 3582.

Revision 1.167 / (download) - annotate - [select for diffs], Fri Jun 30 13:19:32 2023 UTC (10 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.166: +2 -2 lines
Diff to previous 1.166 (colored)

Get rid of some warnings with GCC 10, from Thomas Klausner.

Revision 1.166 / (download) - annotate - [select for diffs], Mon Apr 17 17:57:35 2023 UTC (13 months ago) by nicm
Branch: MAIN
Changes since 1.165: +5 -4 lines
Diff to previous 1.165 (colored)

Discard mouse sequences that have the right form but actually are
invalid (for example have column zero rather than one).

Revision 1.165 / (download) - annotate - [select for diffs], Mon Jan 9 14:12:41 2023 UTC (16 months, 1 week ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.164: +5 -7 lines
Diff to previous 1.164 (colored)

Fix behaviour with \007 (used the wrong tree for last change).

Revision 1.164 / (download) - annotate - [select for diffs], Mon Jan 9 07:57:14 2023 UTC (16 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.163: +11 -4 lines
Diff to previous 1.163 (colored)

Accept \007 as terminator to OSC 10 or 11.

Revision 1.163 / (download) - annotate - [select for diffs], Tue Jan 3 11:43:24 2023 UTC (16 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.162: +81 -4 lines
Diff to previous 1.162 (colored)

Query the client terminal for foreground and background colours and if
OSC 10 or 11 is received but no colour has been set inside tmux, return
the colour from the first attached client (probably most people will
have all light or or all dark terminals).

Revision 1.162 / (download) - annotate - [select for diffs], Fri Nov 11 08:44:11 2022 UTC (18 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.161: +17 -14 lines
Diff to previous 1.161 (colored)

Tweak previous to set and log the feature instead of just setting the
flag.

Revision 1.161 / (download) - annotate - [select for diffs], Fri Nov 11 08:37:55 2022 UTC (18 months, 1 week ago) by nicm
Branch: MAIN
Changes since 1.160: +96 -16 lines
Diff to previous 1.160 (colored)

Parse primary device attributes as well as secondary and add a SIXEL
flag (not used yet), from Anindya Mukherjee.

Revision 1.160 / (download) - annotate - [select for diffs], Wed Nov 2 07:36:07 2022 UTC (18 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.159: +3 -3 lines
Diff to previous 1.159 (colored)

Instead of always setting the extended flag, set it only when searching.
Allows send-keys to work. From Aaron Jensen.

Revision 1.159 / (download) - annotate - [select for diffs], Tue Nov 1 09:54:13 2022 UTC (18 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.158: +5 -2 lines
Diff to previous 1.158 (colored)

Add modified Tab key sequences, from Aaron Jensen, GitHub issue 3368.

Revision 1.158 / (download) - annotate - [select for diffs], Tue Jul 19 06:51:31 2022 UTC (22 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.157: +11 -29 lines
Diff to previous 1.157 (colored)

Process modifiers as bits rather than using a switch, from Koichi Murase.

Revision 1.157 / (download) - annotate - [select for diffs], Tue Jun 14 07:29:00 2022 UTC (23 months ago) by nicm
Branch: MAIN
Changes since 1.156: +28 -35 lines
Diff to previous 1.156 (colored)

kf* terminfo capabilities are poorly defined and rxvt uses them in a
different way from xterm, so add a feature flag for rxvt to make tmux
ignore the capabilities and instead rely on its builtin definitions.

Revision 1.156 / (download) - annotate - [select for diffs], Wed Jun 1 15:43:22 2022 UTC (23 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.155: +3 -1 lines
Diff to previous 1.155 (colored)

If escape-time is 0, force to 1 instead - not waiting at all is asking
for problems on some platforms.

Revision 1.155 / (download) - annotate - [select for diffs], Mon May 30 13:02:55 2022 UTC (23 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.154: +7 -11 lines
Diff to previous 1.154 (colored)

If a mouse position was above the maximum supported by the normal mouse
protocol (223), tmux was allowing it to wrap around. However, since tmux
was not correctly handling this on input, other programs also do not
handle it correctly, and the alternative SGR mouse mode is now
widespread, this seems unnecessary, so remove this feature. Also define
some constants to make it clearer what the numbers mean. Mostly from
Leonid S Usov in GitHub issue 3165.

Revision 1.154 / (download) - annotate - [select for diffs], Tue Mar 8 12:01:19 2022 UTC (2 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.153: +22 -8 lines
Diff to previous 1.153 (colored)

Add argument to refresh-client -l to forward clipboard to a pane. GitHub
issue 3068.

Revision 1.153 / (download) - annotate - [select for diffs], Wed Feb 16 18:55:05 2022 UTC (2 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.152: +3 -3 lines
Diff to previous 1.152 (colored)

Support more mouse buttons when the terminal sends them, GitHub issue
3055.

Revision 1.152 / (download) - annotate - [select for diffs], Tue Feb 15 13:03:02 2022 UTC (2 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.151: +6 -1 lines
Diff to previous 1.151 (colored)

Do not create a buffer from an OSC 52 response if we have not sent a
query.

Revision 1.151 / (download) - annotate - [select for diffs], Thu Oct 21 08:36:51 2021 UTC (2 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.150: +4 -1 lines
Diff to previous 1.150 (colored)

Correctly adjust the end pointer for a two character terminator before
decoding OSC 52 response, from Daniel Ekloef in GitHub issue 2942.

Revision 1.150 / (download) - annotate - [select for diffs], Fri Aug 13 07:37:58 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.149: +12 -1 lines
Diff to previous 1.149 (colored)

Break message type stuff out into its own header.

Revision 1.149 / (download) - annotate - [select for diffs], Fri Aug 13 06:52:51 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.148: +5 -3 lines
Diff to previous 1.148 (colored)

Change focus to be driven by events rather than walking all panes at end
of event loop, this way the ordering of in and out can be enforced.
GitHub issue 2808.

Revision 1.148 / (download) - annotate - [select for diffs], Fri Aug 6 09:19:02 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.147: +6 -3 lines
Diff to previous 1.147 (colored)

Add client focus hooks.

Revision 1.147 / (download) - annotate - [select for diffs], Thu Jun 10 07:21:10 2021 UTC (2 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.146: +10 -3 lines
Diff to previous 1.146 (colored)

Add another couple of keys needed for extended keys, GitHub issue 2658.

Handle modifier 9 as Meta, GitHub issue 2647.

Revision 1.146 / (download) - annotate - [select for diffs], Tue Apr 13 12:26:34 2021 UTC (3 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.145: +14 -18 lines
Diff to previous 1.145 (colored)

Change how extended ctrl keys are processed to fix C-S-Tab and C-;.

Revision 1.145 / (download) - annotate - [select for diffs], Tue Apr 13 05:23:34 2021 UTC (3 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.144: +8 -5 lines
Diff to previous 1.144 (colored)

Handle C-Tab correctly with extended keys, GitHub issue 2642.

Revision 1.144 / (download) - annotate - [select for diffs], Wed Apr 7 15:46:12 2021 UTC (3 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.143: +22 -14 lines
Diff to previous 1.143 (colored)

Restore previous behaviour so that C-X remains the same as C-x. Instead,
translate incoming extended keys so that they are consistent.

Revision 1.143 / (download) - annotate - [select for diffs], Wed Apr 7 07:30:02 2021 UTC (3 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.142: +40 -15 lines
Diff to previous 1.142 (colored)

Fixes for extended keys: 1) allow C-x and C-X to be bound separately
since some terminals report them differently 2) use the "backspace"
option to translate backspace 3) map ctrl which are have the ctrl
implied (such as C-x) properly when the terminal reports both the key
and the modifier.

Note that any key bindings for C-X where C-x is meant must now be
changed.

Revision 1.142 / (download) - annotate - [select for diffs], Wed Sep 23 14:57:33 2020 UTC (3 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.141: +15 -10 lines
Diff to previous 1.141 (colored)

Escape+Up and the other arrow keys should be kept as Escape+Up and not
converted to M-Up. Do not give them the implied meta flag so they don't
match the M-Up entry in the output key tree. Fixes problem with vi
reported by jsing@.

Revision 1.141 / (download) - annotate - [select for diffs], Mon Aug 24 05:23:30 2020 UTC (3 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.140: +10 -3 lines
Diff to previous 1.140 (colored)

Old Terminal.app versions do not respond correctly to secondary DA,
instead responding with the primary DA response. Ignore it. Reported by
Dave Vandervies.

Revision 1.140 / (download) - annotate - [select for diffs], Mon Jul 6 07:27:39 2020 UTC (3 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.139: +17 -1 lines
Diff to previous 1.139 (colored)

Always send xterm-style keys for M-Left and M-Right. GitHub issue 2296.

Revision 1.139 / (download) - annotate - [select for diffs], Tue Jun 2 08:17:27 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.138: +1 -3 lines
Diff to previous 1.138 (colored)

Use CLOCK_MONOTONIC for timer measurement and add a timestamp to control
mode %output blocks.

Revision 1.138 / (download) - annotate - [select for diffs], Mon May 25 18:57:25 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.137: +5 -5 lines
Diff to previous 1.137 (colored)

Use the internal representation for UTF-8 keys instead of wchar_t and
drop some code only needed for that.

Revision 1.137 / (download) - annotate - [select for diffs], Fri May 22 15:43:38 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.136: +3 -6 lines
Diff to previous 1.136 (colored)

FocusIn keys can also update the latest client, like normal keys.

Revision 1.136 / (download) - annotate - [select for diffs], Sat May 16 16:44:54 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.135: +2 -2 lines
Diff to previous 1.135 (colored)

Add a terminal feature for enable/disable extended keys (supported by
xterm and mintty) and add an option to make tmux send it. Only forward
extended keys if the application has requested them, even though we use
the CSI u sequence and xterm uses CSI 27 ~ - this is what mintty does as
well.

Revision 1.135 / (download) - annotate - [select for diffs], Sat May 16 16:35:13 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.134: +133 -133 lines
Diff to previous 1.134 (colored)

Separate key flags and modifiers, log key flags, make the "xterm" flag
more explicit and fix M- keys with a leading escape.

Revision 1.134 / (download) - annotate - [select for diffs], Sat May 16 16:33:16 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.133: +57 -57 lines
Diff to previous 1.133 (colored)

Rename KEYC_ESCAPE to KEYC_META.

Revision 1.133 / (download) - annotate - [select for diffs], Sat May 16 16:32:21 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.132: +104 -1 lines
Diff to previous 1.132 (colored)

Recognise extended key sequences on input (both the forms xterm offers).

Revision 1.132 / (download) - annotate - [select for diffs], Sat May 16 16:30:59 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.131: +96 -43 lines
Diff to previous 1.131 (colored)

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.131 / (download) - annotate - [select for diffs], Sat May 16 15:41:54 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.130: +2 -5 lines
Diff to previous 1.130 (colored)

Only redraw popup on the client it belongs to.

Revision 1.130 / (download) - annotate - [select for diffs], Sat May 16 14:30:17 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.129: +16 -41 lines
Diff to previous 1.129 (colored)

Move terminal features into a single file.

Revision 1.129 / (download) - annotate - [select for diffs], Sat May 16 14:18:39 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.128: +2 -2 lines
Diff to previous 1.128 (colored)

Response is iTerm2 not not ITerm2.

Revision 1.128 / (download) - annotate - [select for diffs], Sat May 16 14:16:25 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.127: +32 -24 lines
Diff to previous 1.127 (colored)

Remove support for iTerm2's DSR 1337 extension and use the CSI > q
extension now supported by a few different terminals.

Revision 1.127 / (download) - annotate - [select for diffs], Mon Apr 20 14:59:31 2020 UTC (4 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.126: +2 -2 lines
Diff to previous 1.126 (colored)

Change how sync works to always send the end sequence after all output
is done when we are returning to the event loop (since we always move
the cursor at that point). Also a man fix from jmc.

Revision 1.126 / (download) - annotate - [select for diffs], Mon Apr 20 13:25:36 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.125: +48 -16 lines
Diff to previous 1.125 (colored)

Tidy up the terminal detection and feature code and add named sets of
terminal features, each of which are defined in one place and map to a
builtin set of terminfo(5) capabilities. Features can be specified based
on TERM with a new terminal-features option or with the -T flag when
running tmux. tmux will also detect a few common terminals from the DA
and DSR responses.

This is intended to make it easier to configure tmux's use of
terminfo(5) even in the presence of outdated ncurses(3) or terminfo(5)
databases or for features which do not yet have a terminfo(5) entry.
Instead of having to grok terminfo(5) capability names and what they
should be set to in the terminal-overrides option, the user can
hopefully just give tmux a feature name and let it do the right thing.

The terminal-overrides option remains both for backwards compatibility
and to allow tweaks of individual capabilities.

tmux already did much of this already, this makes it tidier and simpler
to configure.

Revision 1.125 / (download) - annotate - [select for diffs], Fri Apr 17 09:06:10 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.124: +5 -2 lines
Diff to previous 1.124 (colored)

Support the application escape sequence mintty (means tmux doesn't have
to delay to wait for Escape).

Revision 1.124 / (download) - annotate - [select for diffs], Thu Apr 16 15:14:25 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.123: +21 -13 lines
Diff to previous 1.123 (colored)

Send secondary device attributes instead of primary which gives us a bit
more useful information on some terminals.

Revision 1.123 / (download) - annotate - [select for diffs], Thu Apr 16 13:35:24 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.122: +2 -2 lines
Diff to previous 1.122 (colored)

Add support for the iTerm2 sychronized updates escape sequence which
drastically reduces flickering.

Revision 1.122 / (download) - annotate - [select for diffs], Tue Jan 28 11:39:51 2020 UTC (4 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.121: +4 -2 lines
Diff to previous 1.121 (colored)

If we can identify the terminal as iTerm2 or as tmux, we can be sure
they support 256 and RGB colours, so set those flags too.

Revision 1.121 / (download) - annotate - [select for diffs], Tue Jan 28 10:59:29 2020 UTC (4 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.120: +2 -2 lines
Diff to previous 1.120 (colored)

Add support for the iTerm2 DSR 1337 sequence to get the terminal version.

Revision 1.120 / (download) - annotate - [select for diffs], Mon Jan 13 08:12:53 2020 UTC (4 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.119: +15 -1 lines
Diff to previous 1.119 (colored)

Be more specific in the DSR we are looking for so it doesn't get
confused with mouse sequences. Also set a flag and don't bother checking
for it if we have already seen it (same for DA), and don't check if we
never asked for it.

Revision 1.119 / (download) - annotate - [select for diffs], Sun Jan 12 22:00:20 2020 UTC (4 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.118: +58 -1 lines
Diff to previous 1.118 (colored)

Detect iTerm2 and enable DECSLRM.

Revision 1.118 / (download) - annotate - [select for diffs], Sun Jan 12 21:07:07 2020 UTC (4 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.117: +10 -32 lines
Diff to previous 1.117 (colored)

The terminal type was never as much use as I expected so remove it in
favour of a couple of flags for the features used (DECSLRM and DECFRA).
Also rename the flag for no xenl to be more obvious while here.

Revision 1.117 / (download) - annotate - [select for diffs], Sun Jan 12 20:20:20 2020 UTC (4 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.116: +3 -3 lines
Diff to previous 1.116 (colored)

Loop over all DA features, don't skip the first.

Revision 1.116 / (download) - annotate - [select for diffs], Thu Nov 28 10:17:22 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.115: +14 -14 lines
Diff to previous 1.115 (colored)

Parse out DA features.

Revision 1.115 / (download) - annotate - [select for diffs], Thu Nov 14 15:37:20 2019 UTC (4 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.114: +7 -2 lines
Diff to previous 1.114 (colored)

Fix parsing of DA with only one argument in the response and add 65 for VT520.

Revision 1.114 / (download) - annotate - [select for diffs], Thu May 9 14:09:32 2019 UTC (5 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.113: +3 -2 lines
Diff to previous 1.113 (colored)

Save mouse buttons as well as position.

Revision 1.113 / (download) - annotate - [select for diffs], Tue May 7 11:24:03 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.112: +3 -5 lines
Diff to previous 1.112 (colored)

Treat keys in identify mode (display-panes) specially and handle them
immediately rather than queuing them (the command can block the queue
which means they were not being seen until it finished which was too
late). Reported by denis@ and solene@, ok solene@.

Revision 1.112 / (download) - annotate - [select for diffs], Fri May 3 18:00:19 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.111: +2 -1 lines
Diff to previous 1.111 (colored)

Use the right index for user-keys.

Revision 1.111 / (download) - annotate - [select for diffs], Fri May 3 14:51:31 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.110: +37 -25 lines
Diff to previous 1.110 (colored)

Instead of processing keys all together, put them up on the client
command queue so they are ordered correctly with the commands that they
execute.

Revision 1.110 / (download) - annotate - [select for diffs], Thu Apr 25 19:36:59 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.109: +2 -3 lines
Diff to previous 1.109 (colored)

options_array_item_value cannot return NULL.

Revision 1.109 / (download) - annotate - [select for diffs], Tue Apr 23 20:40:03 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.108: +6 -5 lines
Diff to previous 1.108 (colored)

Somehow missed these bits in last commit.

Revision 1.108 / (download) - annotate - [select for diffs], Tue Apr 2 09:03:39 2019 UTC (5 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.107: +2 -2 lines
Diff to previous 1.107 (colored)

Add an argument to copy commands to set the prefix for the buffer name,
allows buffers for different sessions to be named separately.

Revision 1.107 / (download) - annotate - [select for diffs], Mon Mar 18 11:58:40 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.106: +8 -5 lines
Diff to previous 1.106 (colored)

Make array options a sparse tree instead of an array of char * and
remove the size limit.

Revision 1.106 / (download) - annotate - [select for diffs], Sat Feb 16 19:04:34 2019 UTC (5 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.105: +5 -1 lines
Diff to previous 1.105 (colored)

Do not look at next key byte if the length is 0, originally from Shingo
NISHIOKA in GitHub issue 1601.

Revision 1.105 / (download) - annotate - [select for diffs], Sun Oct 28 15:34:27 2018 UTC (5 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.104: +2 -2 lines
Diff to previous 1.104 (colored)

Do not check for a key again without an escape if only \033 is present.

Revision 1.104 / (download) - annotate - [select for diffs], Thu Oct 18 08:04:14 2018 UTC (5 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.103: +104 -1 lines
Diff to previous 1.103 (colored)

Support OSC 52 ? to read the top buffer inside tmux (when set-clipboard
is changed to on), also add refresh-client -l to ask tmux to use the
same mechanism to get the clipboard from the terminal outside
tmux. GitHub issue 1477.

Revision 1.103 / (download) - annotate - [select for diffs], Thu Aug 16 14:04:03 2018 UTC (5 years, 9 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.102: +63 -61 lines
Diff to previous 1.102 (colored)

Add the KEYC_XTERM flag to all function keys that imply a modifier so
that they are correctly translated into xterm(1)-style keys. GitHub
issue 1437.

Revision 1.102 / (download) - annotate - [select for diffs], Mon Oct 9 11:35:35 2017 UTC (6 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.101: +2 -2 lines
Diff to previous 1.101 (colored)

kind should be S-Down not S-Up.

Revision 1.101 / (download) - annotate - [select for diffs], Tue Aug 29 09:18:48 2017 UTC (6 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.100: +12 -9 lines
Diff to previous 1.100 (colored)

Check for complete keys before escape prefix, allows keys to be defined
with a leading escape. GitHub issue 1048.

Revision 1.100 / (download) - annotate - [select for diffs], Sun Aug 27 08:33:55 2017 UTC (6 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.99: +3 -1 lines
Diff to previous 1.99 (colored)

Use kind and kri for S-Up/Down as well as kUP and kDN.

Revision 1.99 / (download) - annotate - [select for diffs], Fri Jun 23 15:36:52 2017 UTC (6 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.98: +13 -3 lines
Diff to previous 1.98 (colored)

Add user-keys option to allow user-defined keys to be set, from Dan
Aloni.

Revision 1.98 / (download) - annotate - [select for diffs], Mon Jun 12 07:04:24 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.97: +5 -1 lines
Diff to previous 1.97 (colored)

Add explicit keys for the bracketed paste sequences, both to avoid mix
ups with other keys and to make logs clearer.

Revision 1.97 / (download) - annotate - [select for diffs], Sun May 7 21:25:59 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.96: +85 -69 lines
Diff to previous 1.96 (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.96 / (download) - annotate - [select for diffs], Tue Apr 18 21:41:42 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.95: +1 -45 lines
Diff to previous 1.95 (colored)

Revert use of DECSLRM on iTerm2, it doesn't help as much as we throught,
and there are some question marks about it's support.

Revision 1.95 / (download) - annotate - [select for diffs], Tue Apr 18 18:21:37 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.94: +45 -1 lines
Diff to previous 1.94 (colored)

Detect iTerm2 and use DECSLRM for it as well.

Revision 1.94 / (download) - annotate - [select for diffs], Tue Apr 18 13:34:04 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.93: +38 -30 lines
Diff to previous 1.93 (colored)

Include client name in key logging.

Revision 1.93 / (download) - annotate - [select for diffs], Fri Feb 10 12:59:18 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.92: +5 -5 lines
Diff to previous 1.92 (colored)

Don't use a bufferevent for the tty, so we can keep better track of what
is being written and when.

Also a manpage typo fix from jmc@.

Revision 1.92 / (download) - annotate - [select for diffs], Wed Jan 11 16:05:46 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.91: +16 -21 lines
Diff to previous 1.91 (colored)

Use a macro for looking up tty types.

Revision 1.91 / (download) - annotate - [select for diffs], Tue Nov 15 14:02:32 2016 UTC (7 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.90: +95 -1 lines
Diff to previous 1.90 (colored)

Initial attempt to make use of left and right margins if the terminal
supports them (that is, if it advertises itself as a VT420 - probably
just xterm). These are the vertical equivalent of the scroll region and
allow much faster scrolling of panes that do not take up the full width
of the terminal.

Revision 1.90 / (download) - annotate - [select for diffs], Mon Oct 10 21:29:23 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.89: +3 -3 lines
Diff to previous 1.89 (colored)

Loads more static, except for cmd-*.c and window-*.c.

Revision 1.89 / (download) - annotate - [select for diffs], Fri Apr 29 10:42:16 2016 UTC (8 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.88: +24 -34 lines
Diff to previous 1.88 (colored)

Fix keys parsing again to correctly accept Unicode when not prefixed
with Escape.

Revision 1.88 / (download) - annotate - [select for diffs], Wed Apr 27 16:46:21 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.87: +10 -11 lines
Diff to previous 1.87 (colored)

Apply backspace check after working out the actual key, so that M-BSpace
can work.

Revision 1.87 / (download) - annotate - [select for diffs], Wed Apr 27 16:40:12 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.86: +49 -59 lines
Diff to previous 1.86 (colored)

Try again with keys parsing, tidy up further and fix single Escape press.

Revision 1.86 / (download) - annotate - [select for diffs], Tue Apr 26 22:19:22 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.85: +116 -71 lines
Diff to previous 1.85 (colored)

Simplify next key matching and fix problems with meta and Unicode keys.

Revision 1.85 / (download) - annotate - [select for diffs], Wed Mar 2 15:36:03 2016 UTC (8 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.84: +7 -2 lines
Diff to previous 1.84 (colored)

Handle wcwidth() and mbtowc() failures in better style and drop
characters where we can't find the width (wcwidth() fails) on input, the
same as we drop invalid UTF-8. Suggested by schwarze@.

Revision 1.84 / (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_5_9_BASE, OPENBSD_5_9
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

I no longer use my SourceForge address so replace it.

Revision 1.83 / (download) - annotate - [select for diffs], Sat Dec 12 18:19:00 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.82: +5 -5 lines
Diff to previous 1.82 (colored)

Allow prefix and prefix2 to be set to None to disable (useful if you
would rather bind the prefix in the root table).

Revision 1.82 / (download) - annotate - [select for diffs], Mon Nov 23 20:53:09 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.81: +9 -29 lines
Diff to previous 1.81 (colored)

Remove support for the UTF-8 mouse extension. This was a briefly used,
poor idea that was fairly quickly replaced by SGR mouse input (which is
now widespread). It is impossible to tell the difference between UTF-8
and non-UTF-8 mouse input; since the mouse-utf8 option was removed tmux
has not handled it correctly in any case; and it is ridiculous to have
three different forms of mouse input.

Revision 1.81 / (download) - annotate - [select for diffs], Wed Nov 18 14:27:44 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.80: +2 -2 lines
Diff to previous 1.80 (colored)

Use __unused rather than rolling our own.

Revision 1.80 / (download) - annotate - [select for diffs], Sat Nov 14 11:45:43 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.79: +8 -8 lines
Diff to previous 1.79 (colored)

All these return values from utf8_* are confusing, use an enum.

Revision 1.79 / (download) - annotate - [select for diffs], Sat Nov 14 10:57:59 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.78: +2 -1 lines
Diff to previous 1.78 (colored)

Couple of assignments to remove compiler warnings.

Revision 1.78 / (download) - annotate - [select for diffs], Sat Nov 14 10:56:31 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.77: +9 -4 lines
Diff to previous 1.77 (colored)

Be more strict about invalid UTF-8.

Revision 1.77 / (download) - annotate - [select for diffs], Thu Nov 12 22:04:37 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.76: +11 -11 lines
Diff to previous 1.76 (colored)

Rename overly-long utf8data to ud throughout.

Revision 1.76 / (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.75: +41 -23 lines
Diff to previous 1.75 (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.75 / (download) - annotate - [select for diffs], Tue Oct 27 15:58:43 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.74: +2 -2 lines
Diff to previous 1.74 (colored)

Move struct options into options.c.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Sep 2 17:37:54 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.73: +1 -70 lines
Diff to previous 1.73 (colored)

We no longer need the terminal service class, so don't bother asking for it.

Revision 1.73 / (download) - annotate - [select for diffs], Fri Jun 5 15:10:13 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.72: +2 -1 lines
Diff to previous 1.72 (colored)

Do not use the key variable uninitialized (in a debug log statement),
reported by jungleboogie0 at gmail dot com.

Revision 1.72 / (download) - annotate - [select for diffs], Sun Apr 19 21:34:21 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.71: +22 -61 lines
Diff to previous 1.71 (colored)

Rewrite of tmux mouse support which was a mess. Instead of having
options for "mouse-this" and "mouse-that", mouse events may be bound as
keys and there is one option "mouse" that turns on mouse support
entirely (set -g mouse on).

See the new MOUSE SUPPORT section of the man page for description of the
key names and new flags (-t= to specify the pane or window under mouse
as a target, and send-keys -M to pass through a mouse event).

The default builtin bindings for the mouse are:

    bind -n   MouseDown1Pane select-pane -t=; send-keys -M
    bind -n MouseDown1Status select-window -t=
    bind -n   MouseDrag1Pane copy-mode -M
    bind -n MouseDrag1Border resize-pane -M

To get the effect of turning mode-mouse off, do:

    unbind -n MouseDrag1Pane
    unbind -temacs-copy MouseDrag1Pane

The old mouse options are now gone, set-option -q may be used to
suppress warnings if mixing configuration files.

Revision 1.71 / (download) - annotate - [select for diffs], Wed Oct 22 23:18:53 2014 UTC (9 years, 6 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.70: +2 -2 lines
Diff to previous 1.70 (colored)

Fix some spacing nits.

Revision 1.70 / (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_6_BASE, OPENBSD_5_6
Changes since 1.69: +58 -33 lines
Diff to previous 1.69 (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.69 / (download) - annotate - [select for diffs], Mon Jun 23 09:52:56 2014 UTC (9 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.68: +8 -9 lines
Diff to previous 1.68 (colored)

Count mouse clicks correctly, from Balazs Kezes.

Revision 1.68 / (download) - annotate - [select for diffs], Thu Jun 19 07:32:12 2014 UTC (9 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.67: +3 -1 lines
Diff to previous 1.67 (colored)

Reset the buttons when the wheel is used, from Balazs Kezes.

Revision 1.67 / (download) - annotate - [select for diffs], Thu Jun 19 07:26:43 2014 UTC (9 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.66: +20 -1 lines
Diff to previous 1.66 (colored)

Some terminals send spurious releases for mouse wheel in SGR mouse mode,
this causes confusion when tmux uses SGR outside but the application
inside tmux is using conventional xterm mouse reporting. So suppress
obviously bad input. From Timothy Allen, SF bug 128.

Revision 1.66 / (download) - annotate - [select for diffs], Thu May 8 07:54:47 2014 UTC (10 years ago) by nicm
Branch: MAIN
Changes since 1.65: +4 -4 lines
Diff to previous 1.65 (colored)

Instead of forcing mouse scroll to 1 in choose mode, scale it down
instead. Means modifier keys still increase the line count, just not as
much. Based on a diff from Marcel Partap.

Revision 1.65 / (download) - annotate - [select for diffs], Thu Apr 3 08:20:29 2014 UTC (10 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.64: +10 -1 lines
Diff to previous 1.64 (colored)

Work out mouse scroll wheel effect when the mouse is first detected and
store it in struct mouse_event, reduce the scroll size the 3 but allow
shift to reduce it to 1 and meta and ctrl to multiply by 3 if the
terminal supports them, also support wheel in choose mode. From Marcel
Partap.

Revision 1.64 / (download) - annotate - [select for diffs], Thu Apr 3 08:15:17 2014 UTC (10 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.63: +3 -3 lines
Diff to previous 1.63 (colored)

A couple of trivial mouse-related style nits.

Revision 1.63 / (download) - annotate - [select for diffs], Mon Mar 31 21:40:21 2014 UTC (10 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.62: +6 -6 lines
Diff to previous 1.62 (colored)

Add names for mouse button bits rather than using magic numbers, from
Marcel Partap.

Revision 1.62 / (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.61: +10 -10 lines
Diff to previous 1.61 (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.61 / (download) - annotate - [select for diffs], Thu Oct 10 11:57:52 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.60: +3 -3 lines
Diff to previous 1.60 (colored)

Assign mouse x/y coords before checking them. When receiving mouse
inputs, we should set the x/y coordinates earlier than we currently do,
so that we aren't off-by-one in the case when the statusbar is at the
top of the screen. By Thomas Adam.

Revision 1.60 / (download) - annotate - [select for diffs], Thu Oct 10 11:49:42 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.59: +10 -4 lines
Diff to previous 1.59 (colored)

Handle input mouse positions <33 (we already can generate them).

Revision 1.59 / (download) - annotate - [select for diffs], Tue Mar 26 14:14:08 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.58: +6 -4 lines
Diff to previous 1.58 (colored)

Only accept partial keys if the timer has not expired, fixes infinite
loop when Escape is pressed the wrong number of times.

Revision 1.58 / (download) - annotate - [select for diffs], Mon Mar 25 11:44:16 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.57: +2 -2 lines
Diff to previous 1.57 (colored)

Process ^[ as meta when a partial key is found.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Mar 25 11:36:25 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.56: +8 -1 lines
Diff to previous 1.56 (colored)

Add home and end as modified by xterm in keypad mode, from Chris
Johnsen.

Revision 1.56 / (download) - annotate - [select for diffs], Sun Mar 24 09:28:59 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.55: +14 -1 lines
Diff to previous 1.55 (colored)

Handle focus events from the terminal, from Aaron Jensen.

Revision 1.55 / (download) - annotate - [select for diffs], Fri Mar 22 10:33:50 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.54: +101 -43 lines
Diff to previous 1.54 (colored)

Support the latest theory for mouse input, this is enabled/disabled with
SM/RM 1006 and is similar in style to SGR input: \033[<b;x;yM or
\033[b;x;ym. From Egmont Koblinger.

Revision 1.54 / (download) - annotate - [select for diffs], Fri Mar 22 10:31:22 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.53: +1 -2 lines
Diff to previous 1.53 (colored)

No more lint means no more ARGSUSED.

Revision 1.53 / (download) - annotate - [select for diffs], Fri Mar 22 10:30:34 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.52: +1 -3 lines
Diff to previous 1.52 (colored)

Remove stray test code which would convert abc to x.

Revision 1.52 / (download) - annotate - [select for diffs], Thu Mar 21 18:45:38 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.51: +1 -2 lines
Diff to previous 1.51 (colored)

Don't set key KEYC_NONE on xterm_keys_find match()

When calling xterm_keys_find(); if we get a complete match, don't set
the key to unknown before calling the action to complete the binding;
otherwise non-prefixed bindings will not work.

From Thomas Adam

Revision 1.51 / (download) - annotate - [select for diffs], Thu Mar 21 18:44:47 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.50: +64 -83 lines
Diff to previous 1.50 (colored)

Include the \033 in the key tree and adjust key matching for this change.

Revision 1.50 / (download) - annotate - [select for diffs], Thu Mar 21 16:52:02 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.49: +4 -4 lines
Diff to previous 1.49 (colored)

Fix a comment for new key table names.

Revision 1.49 / (download) - annotate - [select for diffs], Thu Mar 21 16:51:11 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.48: +2 -2 lines
Diff to previous 1.48 (colored)

Fix function parameter to tty_keys_free.

Revision 1.48 / (download) - annotate - [select for diffs], Thu Mar 21 16:50:22 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.47: +239 -240 lines
Diff to previous 1.47 (colored)

Tidy by splitting default key tables into two.

Revision 1.47 / (download) - annotate - [select for diffs], Thu Nov 22 14:41:11 2012 UTC (11 years, 5 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.46: +6 -6 lines
Diff to previous 1.46 (colored)

Put helper function back, will be needed in a bit.

Revision 1.46 / (download) - annotate - [select for diffs], Thu Nov 22 14:26:04 2012 UTC (11 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.45: +13 -19 lines
Diff to previous 1.45 (colored)

Instead of worrying about xterm version, send DA and read DEC service
class which is more likely to be useful. Not used for anything yet
anyway.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Oct 26 14:35:42 2012 UTC (11 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.44: +48 -10 lines
Diff to previous 1.44 (colored)

Make mouse event structure clearer by defining events (up, click, drag)
and simplifying how buttons and wheels are represented, from Ailin
Nemui. Should be no functional changes.

Revision 1.44 / (download) - annotate - [select for diffs], Mon Sep 3 06:26:48 2012 UTC (11 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.43: +4 -2 lines
Diff to previous 1.43 (colored)

Can't call evtimer_pending on uninitialized events, call
evtimer_initialized first. Reported by Vladimir Lomov, fix from Thomas
Adam slightly modified by me.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Aug 21 10:08:11 2012 UTC (11 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.42: +3 -2 lines
Diff to previous 1.42 (colored)

xterm won't reach version 500 for a while so set that as the upper limit.

Revision 1.42 / (download) - annotate - [select for diffs], Tue Jul 10 11:53:01 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

xfree is not particularly helpful, remove it. From Thomas Adam.

Revision 1.41 / (download) - annotate - [select for diffs], Tue May 22 14:32:28 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.40: +3 -3 lines
Diff to previous 1.40 (colored)

Store client in tty struct directly instead of using a callback function
pointer.

Revision 1.40 / (download) - annotate - [select for diffs], Tue May 22 14:11:30 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.39: +14 -16 lines
Diff to previous 1.39 (colored)

Store mouse data in tty structure not on the stack.

Revision 1.39 / (download) - annotate - [select for diffs], Sun Apr 22 05:21:40 2012 UTC (12 years ago) by nicm
Branch: MAIN
Changes since 1.38: +9 -5 lines
Diff to previous 1.38 (colored)

Handle partial keys properly by making sure the timer has actually
expired, fixes problems with mintty reported by Michael Simpson.

Revision 1.38 / (download) - annotate - [select for diffs], Wed Mar 21 21:28:03 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.37: +9 -5 lines
Diff to previous 1.37 (colored)

Some terminals respond to secondary DA with primary (they ignore the
intermediate character). So ignore the possible responses to primary DA.

Revision 1.37 / (download) - annotate - [select for diffs], Sat Mar 17 22:56:04 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.36: +2 -3 lines
Diff to previous 1.36 (colored)

On xterm 271 and later, put the terminal into SCL 5 and use DECCRA for
scrolling the region in panes (if the large region check isn't
hit). With help from Ailin Nemui.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Mar 17 18:24:07 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.35: +5 -3 lines
Diff to previous 1.35 (colored)

Check event_initialized before event_del if event may not have been set
up; libevent2 complains about this. Reported by Moriyoshi Koizumi.

Revision 1.35 / (download) - annotate - [select for diffs], Thu Mar 15 10:36:00 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.34: +78 -2 lines
Diff to previous 1.34 (colored)

Send secondary DA to terminals with XT in terminfo when starting up and
parse it to work out the xterm version.

Revision 1.34 / (download) - annotate - [select for diffs], Fri Mar 4 23:26:44 2011 UTC (13 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Two fixes by Micah Cowan: make mouse work properly beyond >127 on signed
char architectures and properly parse $TMUX by stopping the socket path
at the first comma.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Jan 3 23:35:22 2011 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.32: +46 -16 lines
Diff to previous 1.32 (colored)

Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262
and supports larger terminals than the older way.

If the new mouse-utf8 option is on, UTF-8 mouse input is enabled for all
UTF-8 terminals. The option defaults to on if LANG etc are set in the
same manner as the utf8 option.

With help and based on code from hsim at gmx.li.

Revision 1.32 / (download) - annotate - [select for diffs], Sat Jan 1 02:16:25 2011 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.31: +5 -5 lines
Diff to previous 1.31 (colored)

Key table should be const.

Revision 1.31 / (download) - annotate - [select for diffs], Mon May 31 19:51:29 2010 UTC (13 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.30: +3 -2 lines
Diff to previous 1.30 (colored)

When the mode-mouse option is on, support dragging to make a selection
in copy mode.

Also support the scroll wheel, although xterm strangely does not ignore
it in application mouse mode, causing redraw artifacts when scrolling up
(other terminals appear to be better behaved).

Revision 1.30 / (download) - annotate - [select for diffs], Mon Mar 22 19:03:52 2010 UTC (14 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

Accept a full key match (not a partial) even if there is data left in
the buffer.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Dec 17 17:39:56 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.28: +135 -127 lines
Diff to previous 1.28 (colored)

Allow keys to be replaced and reorder the table so that terminfo-defined keys
(or terminal-overrides) take precedence over internally defined.

Revision 1.28 / (download) - annotate - [select for diffs], Mon Dec 14 10:43:41 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.27: +5 -4 lines
Diff to previous 1.27 (colored)

New server option, escape-time, to set the timeout used to detect if escapes
are alone or part of a function key or meta sequence.

Revision 1.27 / (download) - annotate - [select for diffs], Thu Dec 3 22:50:10 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.26: +10 -10 lines
Diff to previous 1.26 (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.26 / (download) - annotate - [select for diffs], Tue Dec 1 07:59:40 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.25: +10 -10 lines
Diff to previous 1.25 (colored)

Look for mice and xterm keys before standard function keys as they are less
likely to be partial versions.

Revision 1.25 / (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.24: +7 -4 lines
Diff to previous 1.24 (colored)

Handle partial xterm function key sequences.

Revision 1.24 / (download) - annotate - [select for diffs], Thu Nov 26 22:26:51 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.23: +2 -3 lines
Diff to previous 1.23 (colored)

Continue rather than returning if not a mouse key, to avoid hanging on any
function key...

Revision 1.23 / (download) - annotate - [select for diffs], Thu Nov 26 21:37:13 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.22: +2 -1 lines
Diff to previous 1.22 (colored)

Remove a couple of unused arguments where possible, and add /* ARGSUSED */ to
the rest to reduce lint output.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Nov 26 15:14:03 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.21: +37 -10 lines
Diff to previous 1.21 (colored)

Handle the possibility of partial mouse reads, and fix a comment while here.

Revision 1.21 / (download) - annotate - [select for diffs], Thu Nov 12 08:01:02 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.20: +97 -13 lines
Diff to previous 1.20 (colored)

Support rxvt-style keys again, but this time: support all the variations, put
them in as raw escape sequences rather than fiddling with the values from
terminfo, put them /after/ the terminfo values so the latter take precedence.

Revision 1.20 / (download) - annotate - [select for diffs], Tue Nov 10 17:59:34 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.19: +35 -44 lines
Diff to previous 1.19 (colored)

Twiddling the last bit is an rxvtism, so do not support it in the table by
default.

Revision 1.19 / (download) - annotate - [select for diffs], Mon Nov 9 14:40:06 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

The input key should be a u_char. Fixes top-bit-set input problem reported by
ajacoutot@.

Revision 1.18 / (download) - annotate - [select for diffs], Mon Nov 9 11:45:10 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.17: +5 -4 lines
Diff to previous 1.17 (colored)

Constify buf.

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

Unused variable. Aargh.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Nov 5 19:29:41 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.15: +159 -83 lines
Diff to previous 1.15 (colored)

Switch the tty key tree over to an (unbalanced) ternary tree which allows
partial matches to be done (they wait for further data or a timer to expire,
like a naked escape).

Mouse and xterm-style keys still expect to be atomic.

Revision 1.15 / (download) - annotate - [select for diffs], Thu Nov 5 10:44:36 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.14: +7 -6 lines
Diff to previous 1.14 (colored)

Key flags are only used for initialisation so they are not needed in the main
tty_key struct.

Revision 1.14 / (download) - annotate - [select for diffs], Thu Nov 5 08:45:08 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.13: +54 -41 lines
Diff to previous 1.13 (colored)

Switch tty key input over to happen on a read event. This is a bit more
complicated because of escape input, but in that case instead of processing a
key immediately, schedule a timer and reprocess the bufer when it expires.

This currently assumes that keys will be atomic (ie that if eg F1 is pressed
the entire sequence is present in the buffer). This is usually but not always
true, a change in the tree format so it can differentiate potential (partial)
key sequences will happens soon and will allow this to be fixed.

Revision 1.13 / (download) - annotate - [select for diffs], Wed Nov 4 21:47:42 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.12: +14 -11 lines
Diff to previous 1.12 (colored)

Switch tty fds over to a bufferevent.

Revision 1.12 / (download) - annotate - [select for diffs], Mon Oct 26 17:59:46 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.11: +12 -15 lines
Diff to previous 1.11 (colored)

Not all terminals swap CSI and SS3 on ctrl, so remove that.

Also mark the rxvt special-cases as such until terminfo is updated to have
kLFT5, kRIT5 etc.

Revision 1.11 / (download) - annotate - [select for diffs], Mon Oct 26 17:46:33 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.10: +8 -1 lines
Diff to previous 1.10 (colored)

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.

Revision 1.10 / (download) - annotate - [select for diffs], Mon Oct 26 16:00:51 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.9: +63 -1 lines
Diff to previous 1.9 (colored)

Support the (mostly new) function key+modifier caps (kIC-kIC7). Most of these
will be caught (soon) by the xterm keys code in xterm itself but some other
descriptions such as rxvt define them as well.

Revision 1.9 / (download) - annotate - [select for diffs], Mon Oct 26 13:58:02 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.8: +15 -6 lines
Diff to previous 1.8 (colored)

As we always put the cursor keys into application mode, assume keys sent
with CSI have ctrl.

Also add a couple of comments.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Oct 26 13:41:46 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.7: +71 -75 lines
Diff to previous 1.7 (colored)

Tidy up table.

Revision 1.7 / (download) - annotate - [select for diffs], Mon Oct 26 13:13:33 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.6: +17 -17 lines
Diff to previous 1.6 (colored)

Rename keypad keys to something more useful.

Revision 1.6 / (download) - annotate - [select for diffs], Mon Oct 26 13:02:53 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.5: +4 -77 lines
Diff to previous 1.5 (colored)

Remove the xterm-keys code which is broken (a replacement is coming but some
more cleanup is needed first).

Revision 1.5 / (download) - annotate - [select for diffs], Sun Oct 11 07:01:10 2009 UTC (14 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.4: +12 -11 lines
Diff to previous 1.4 (colored)

Clean up by introducing a wrapper struct for mouse clicks rather than passing
three u_chars around.

As a side-effect this fixes incorrectly rejecting high cursor positions
(because it was comparing them as signed char), reported by Tom Doherty.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Sep 20 14:58:12 2009 UTC (14 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.3: +3 -3 lines
Diff to previous 1.3 (colored)

Regularise some fatal messages.

Revision 1.3 / (download) - annotate - [select for diffs], Sun Jul 26 21:42:08 2009 UTC (14 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.2: +13 -1 lines
Diff to previous 1.2 (colored)

Detect backspace by looking at termios VERASE and translate it into \177 (which
matches screen's behaviour if not its termcap/terminfo entry). The terminfo kbs
cap is often wrong or missing so it can't be used, and just assuming \177 may
be wrong.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Jul 21 17:57:29 2009 UTC (14 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.1: +19 -24 lines
Diff to previous 1.1 (colored)

Tidy up keys: use an enum for the key codes, and remove the macros which just
wrap flag sets/clears/tests.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Jun 1 22:58:49 2009 UTC (14 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6

Import tmux, a terminal multiplexor allowing (among other things) a single
terminal to be switched between several different windows and programs
displayed on one terminal be detached from one terminal and moved to another.

ok deraadt pirofti

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.