OpenBSD CVS

CVS log for src/usr.bin/tmux/server-client.c


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.405 / (download) - annotate - [select for diffs], Wed Apr 10 07:29:15 2024 UTC (5 weeks, 4 days ago) by nicm
Branch: MAIN
CVS Tags: HEAD
Changes since 1.404: +7 -2 lines
Diff to previous 1.404 (colored)

Correct handling of mouse up events (don't ignore all but the last
released button), and always process down event for double click. From
Rudy Dellomas III in GitHub issue 3919.

Revision 1.404 / (download) - annotate - [select for diffs], Tue Jan 16 13:09:11 2024 UTC (4 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5
Changes since 1.403: +5 -5 lines
Diff to previous 1.403 (colored)

Use imsg_get_fd() instead of direct access to imsg.fd

The change in proc.c can be further simplified once imsg_free() takes
care of unclaimed file descriptors.

OK nicm@

Revision 1.403 / (download) - annotate - [select for diffs], Wed Dec 27 20:23:59 2023 UTC (4 months, 3 weeks ago) by nicm
Branch: MAIN
Changes since 1.402: +6 -4 lines
Diff to previous 1.402 (colored)

Remove flags from the prefix before comparing with the received key so
that modifier keys with flags work correctly, GitHub issue 3764.

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

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

Revision 1.401 / (download) - annotate - [select for diffs], Thu Aug 17 14:10:28 2023 UTC (9 months ago) by nicm
Branch: MAIN
Changes since 1.400: +32 -7 lines
Diff to previous 1.400 (colored)

Add a session, pane and user mouse range types for the status line and
add format variables for mouse_status_line and mouse_status_range so
they can be associated with different commands in the key bindings.
GitHub issue 3652.

Revision 1.400 / (download) - annotate - [select for diffs], Sun Feb 5 21:15:32 2023 UTC (15 months, 1 week ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3
Changes since 1.399: +68 -1 lines
Diff to previous 1.399 (colored)

Extend display-message to work for control clients. GitHub issue 3449.

Revision 1.399 / (download) - annotate - [select for diffs], Mon Jan 16 11:26:14 2023 UTC (16 months ago) by nicm
Branch: MAIN
Changes since 1.398: +4 -2 lines
Diff to previous 1.398 (colored)

Mark keys sent by command and skip paste handling for them.

Revision 1.398 / (download) - annotate - [select for diffs], Thu Jan 12 18:49:11 2023 UTC (16 months ago) by nicm
Branch: MAIN
Changes since 1.397: +25 -1 lines
Diff to previous 1.397 (colored)

Have tmux recognise pasted texts wrapped in bracket paste sequences,
rather than only forwarding them to the program inside. From Andrew
Onyshchuk in GitHub issue 3431.

Revision 1.397 / (download) - annotate - [select for diffs], Tue Jul 19 07:10:13 2022 UTC (22 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2
Changes since 1.396: +3 -2 lines
Diff to previous 1.396 (colored)

Do not ignore the "off" flag when checking if a pane should be stopped,
GitHub issue 3250.

Revision 1.396 / (download) - annotate - [select for diffs], Wed Jul 6 08:31:59 2022 UTC (22 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.395: +5 -2 lines
Diff to previous 1.395 (colored)

Defer reading from control client until the command line command has
completed.

Revision 1.395 / (download) - annotate - [select for diffs], Mon May 30 12:55:25 2022 UTC (23 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.394: +2 -2 lines
Diff to previous 1.394 (colored)

Spacing/style nits.

Revision 1.394 / (download) - annotate - [select for diffs], Mon May 30 12:48:57 2022 UTC (23 months, 2 weeks ago) by nicm
Branch: MAIN
Changes since 1.393: +20 -4 lines
Diff to previous 1.393 (colored)

Add an ACL list for users connecting to the tmux socket. Users may be
forbidden from attaching, forced to attach read-only, or allowed to
attach read-write. A new command, server-access, configures the list.
tmux gets the user using getpeereid(3) of the client socket. Users must
still configure file system permissions manually. From Dallas Lyons and
others.

Revision 1.393 / (download) - annotate - [select for diffs], Thu Mar 24 09:05:57 2022 UTC (2 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.392: +25 -2 lines
Diff to previous 1.392 (colored)

Add a capability for OSC 7 and use it similarly to how the title is set
(and controlled by the same set-titles option). GitHub issue 3127.

Revision 1.392 / (download) - annotate - [select for diffs], Tue Mar 8 12:01:19 2022 UTC (2 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.391: +2 -1 lines
Diff to previous 1.391 (colored)

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

Revision 1.391 / (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.390: +615 -27 lines
Diff to previous 1.390 (colored)

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

Revision 1.390 / (download) - annotate - [select for diffs], Mon Nov 15 10:58:13 2021 UTC (2 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.389: +16 -3 lines
Diff to previous 1.389 (colored)

Leave the hardware cursor at the position of the selected line in choose
modes and current editing position and at the command prompt. It is
invisible but this is helpful for people using screen readers. GitHub
issue 2970.

Revision 1.389 / (download) - annotate - [select for diffs], Thu Oct 28 18:54:33 2021 UTC (2 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.388: +2 -2 lines
Diff to previous 1.388 (colored)

Allow detach even if suspend flag set, GitHub issue 2932.

Revision 1.388 / (download) - annotate - [select for diffs], Mon Oct 11 13:27:50 2021 UTC (2 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.387: +49 -1 lines
Diff to previous 1.387 (colored)

Make positions hidden by overlays range-based rather than character-based,
from Anindya Mukherjee.

Revision 1.387 / (download) - annotate - [select for diffs], Mon Sep 27 19:12:00 2021 UTC (2 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.386: +3 -2 lines
Diff to previous 1.386 (colored)

Do not call recalculate_sizes while clearing a client session because it
needs to loop over the clients, instead do it after all clients are
cleared. Fixes a crash reported by martijn@ when a session with multiple
clients attached is destroyed, but there are other sessions so tmux does
not entirely exit. ok deraadt

Revision 1.386 / (download) - annotate - [select for diffs], Fri Aug 27 17:25:55 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.385: +6 -2 lines
Diff to previous 1.385 (colored)

Replace %% in command lists (by copying them) for template arguments ,
this means they can be used with {} as well. Also make argument
processing from an existing vector preserve commands. GitHub issue 2858.

Revision 1.385 / (download) - annotate - [select for diffs], Fri Aug 27 17:15:57 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.384: +18 -8 lines
Diff to previous 1.384 (colored)

Allow control mode clients to set a hard limit on the window width and
height, GitHub issue 2594.

Revision 1.384 / (download) - annotate - [select for diffs], Sun Aug 22 13:48:29 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.383: +2 -2 lines
Diff to previous 1.383 (colored)

Do not double free expanded path in source-file, also remove some
unnecessary assignments.

Revision 1.383 / (download) - annotate - [select for diffs], Sat Aug 21 17:25:32 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.382: +1 -4 lines
Diff to previous 1.382 (colored)

Stop caring about empty commands, just treat as a null command.

Revision 1.382 / (download) - annotate - [select for diffs], Fri Aug 20 19:08:36 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.381: +1 -3 lines
Diff to previous 1.381 (colored)

Remove some unnecessary blank lines.

Revision 1.381 / (download) - annotate - [select for diffs], Fri Aug 20 17:50:42 2021 UTC (2 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.380: +2 -2 lines
Diff to previous 1.380 (colored)

Remove stray spaces after function names.

Revision 1.380 / (download) - annotate - [select for diffs], Fri Aug 13 18:54:54 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.379: +5 -5 lines
Diff to previous 1.379 (colored)

Add a menu when a popup is present (mouse only for now).

Revision 1.379 / (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.378: +39 -59 lines
Diff to previous 1.378 (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.378 / (download) - annotate - [select for diffs], Thu Aug 5 09:43:51 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.377: +3 -2 lines
Diff to previous 1.377 (colored)

Do not freeze output in panes when a popup is open, let them continue to
redraw. From Anindya Mukherjee .

Revision 1.377 / (download) - annotate - [select for diffs], Wed Aug 4 08:07:19 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.376: +3 -1 lines
Diff to previous 1.376 (colored)

Add a client-active hook, from ncfavier in GitHub issue 2803.

Revision 1.376 / (download) - annotate - [select for diffs], Wed Jul 21 08:06:36 2021 UTC (2 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.375: +7 -3 lines
Diff to previous 1.375 (colored)

Do not close popups on resize, instead adjust them to fit, from Anindya
Mukherjee.

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

Improve logging of screen mode changes.

Revision 1.374 / (download) - annotate - [select for diffs], Thu Jun 10 07:33:41 2021 UTC (2 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.373: +57 -62 lines
Diff to previous 1.373 (colored)

Change resize timers and flags into one timer and a queue which is
simpler and fixes problems with vim when resized multiple times. GitHub
issue 2677.

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

Adjust latest client when a client detaches, GitHub issue 2657.

Revision 1.372 / (download) - annotate - [select for diffs], Mon Apr 12 09:36:12 2021 UTC (3 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.371: +6 -2 lines
Diff to previous 1.371 (colored)

Add a flag to disable keys to close a message, GitHub issue 2625.

Revision 1.371 / (download) - annotate - [select for diffs], Mon Apr 5 14:11:05 2021 UTC (3 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.370: +4 -4 lines
Diff to previous 1.370 (colored)

Move client-detached into server_client_lost so it is fired even if a
client is closed unexpectedly.

Revision 1.370 / (download) - annotate - [select for diffs], Wed Feb 17 07:18:36 2021 UTC (3 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.369: +16 -6 lines
Diff to previous 1.369 (colored)

Move the call to setupterm() into the client and have it pass the
results to the server over imsg, means the server does not need to enter
ncurses or read terminfo db. Old clients will not work with a new
server.

Revision 1.369 / (download) - annotate - [select for diffs], Thu Feb 11 08:28:45 2021 UTC (3 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.368: +4 -75 lines
Diff to previous 1.368 (colored)

Move file handling protocol stuff all into file.c so it can be reused
more easily.

Revision 1.368 / (download) - annotate - [select for diffs], Mon Feb 8 08:33:54 2021 UTC (3 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.367: +3 -1 lines
Diff to previous 1.367 (colored)

Include "focused" in client flags, from Dan Aloni in GitHub issue 2558.

Revision 1.367 / (download) - annotate - [select for diffs], Mon Jan 18 11:14:23 2021 UTC (3 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.366: +5 -5 lines
Diff to previous 1.366 (colored)

Hide some warnings on newer GCC versions, GitHUb issue 2525.

Revision 1.366 / (download) - annotate - [select for diffs], Thu Dec 3 07:12:11 2020 UTC (3 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.365: +25 -1 lines
Diff to previous 1.365 (colored)

Redraw any visible modes when status line changes so that formats like
the pane title are updated. GitHub issue 2487. Also a man page fix from
jmc.

Revision 1.365 / (download) - annotate - [select for diffs], Fri Oct 30 18:54:23 2020 UTC (3 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.364: +2 -2 lines
Diff to previous 1.364 (colored)

With csh, a tmux client gets SIGTERM before SIGCONT when killed with
"kill %%", so when the client tells the server it got SIGCONT, don't use
bits that may already have been freed when it got SIGTERM. Also don't
print anything on exit if we get SIGTERM while suspended. Reported by
Theo.

Revision 1.364 / (download) - annotate - [select for diffs], Fri Oct 30 09:00:07 2020 UTC (3 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.363: +1 -5 lines
Diff to previous 1.363 (colored)

There is no reason not to fire focus events when a pane is in a mode,
GitHub issue 2372.

Revision 1.363 / (download) - annotate - [select for diffs], Fri Oct 30 08:55:56 2020 UTC (3 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.362: +2 -2 lines
Diff to previous 1.362 (colored)

Add a -O flag to display-menu to change the mouse behaviour and not
close the menu when the mouse is released, from teo_paul1 at yahoo dot
com.

Revision 1.362 / (download) - annotate - [select for diffs], Wed Oct 28 10:09:10 2020 UTC (3 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.361: +7 -7 lines
Diff to previous 1.361 (colored)

Do not require that there be no other clients before loading the config,
being the first client is enough. GitHub issue 2438.

Revision 1.361 / (download) - annotate - [select for diffs], Tue Sep 22 05:23:34 2020 UTC (3 years, 7 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.360: +11 -1 lines
Diff to previous 1.360 (colored)

Fix warnings on some platforms with %llx and add a new message to handle
64-bit client flags.

Revision 1.360 / (download) - annotate - [select for diffs], Wed Aug 5 09:11:09 2020 UTC (3 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.359: +1 -3 lines
Diff to previous 1.359 (colored)

Change searching to behave more like emacs and so that regex searching
doesn't overlap when searching forwards.

Revision 1.359 / (download) - annotate - [select for diffs], Mon Jul 6 09:14:20 2020 UTC (3 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.358: +5 -3 lines
Diff to previous 1.358 (colored)

Add a way for control mode clients to subscribe to a format and be
notified of changes rather than having to poll. GitHub issue 2242.

Revision 1.358 / (download) - annotate - [select for diffs], Thu Jun 18 08:34:22 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.357: +6 -1 lines
Diff to previous 1.357 (colored)

Add a flag to make a client wait for an empty line before exiting in
control mode to avoid stray commands ending up in the shell.

Revision 1.357 / (download) - annotate - [select for diffs], Wed Jun 10 07:27:10 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.356: +15 -9 lines
Diff to previous 1.356 (colored)

Instead of a buffer size limit on each pane, set a limit of 300 seconds
of data for each client in control mode.

Revision 1.356 / (download) - annotate - [select for diffs], Fri Jun 5 11:20:51 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.355: +56 -68 lines
Diff to previous 1.355 (colored)

Change how panes are resized so that the code is clearer and if the pane
is resized multiple times during one event loop, it is forced to resize
at the end. Also don't zoom/unzoom in switch-client if the pane hasn't
changed. GitHub issue 2260.

Revision 1.355 / (download) - annotate - [select for diffs], Fri Jun 5 07:33:57 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.354: +32 -10 lines
Diff to previous 1.354 (colored)

Add support for pausing a pane when the output buffered for a control
mode client gets too far behind. The pause-after flag with a time is set
on the pane with refresh-client -f and a paused pane may be resumed with
refresh-client -A. GitHub issue 2217.

Revision 1.354 / (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.353: +4 -2 lines
Diff to previous 1.353 (colored)

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

Revision 1.353 / (download) - annotate - [select for diffs], Mon Jun 1 20:58:42 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.352: +9 -5 lines
Diff to previous 1.352 (colored)

Check the right thing for maximum client buffer size.

Revision 1.352 / (download) - annotate - [select for diffs], Mon Jun 1 09:43:01 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.351: +51 -33 lines
Diff to previous 1.351 (colored)

Instead of sending all data to control mode clients as fast as possible,
add a limit of how much data will be sent to the client and try to use
it for panes with some degree of fairness. GitHub issue 2217, with
George Nachman.

Revision 1.351 / (download) - annotate - [select for diffs], Tue May 26 08:41:47 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.350: +20 -11 lines
Diff to previous 1.350 (colored)

Pass the stdout file descriptor from the client as well as stdin and use
them for control clients directly instead of passing everything via the
client.

Revision 1.350 / (download) - annotate - [select for diffs], Sun May 24 14:45:00 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.349: +8 -6 lines
Diff to previous 1.349 (colored)

Remove leftover call to control_free_offsets and do not use for
non-control clients.

Revision 1.349 / (download) - annotate - [select for diffs], Sun May 24 09:40:17 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.348: +3 -1 lines
Diff to previous 1.348 (colored)

Give control code its own state struct.

Revision 1.348 / (download) - annotate - [select for diffs], Sun May 24 09:13:06 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.347: +7 -10 lines
Diff to previous 1.347 (colored)

Now the tty has a pointer back to the client there is no point (and a
bit confusing) in it keeping a copy of the fd as well. Remove it.

Revision 1.347 / (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.346: +2 -2 lines
Diff to previous 1.346 (colored)

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

Revision 1.346 / (download) - annotate - [select for diffs], Fri May 22 11:07:04 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.345: +27 -59 lines
Diff to previous 1.345 (colored)

Move client offset stuff into control.c since only control clients will
need it.

Revision 1.345 / (download) - annotate - [select for diffs], Thu May 21 07:24:13 2020 UTC (3 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.344: +129 -4 lines
Diff to previous 1.344 (colored)

Support code for control mode flow control: allow clients to have
separate offsets (used and acknowleged) into the pane buffers; turn off
reading from panes when no clients can accept the data; and add a -A
flag to refresh-client to let clients turn receiving a pane on and off.

Revision 1.344 / (download) - annotate - [select for diffs], Sat May 16 16:50:55 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.343: +34 -30 lines
Diff to previous 1.343 (colored)

Move lazy resize from the pane to the window, there is no point in
resizing the window unless it is the current window, and if we do and
don't resize the pane until later there are problems if the size changes
from A to B then back to A.

Revision 1.343 / (download) - annotate - [select for diffs], Sat May 16 16:35:13 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.342: +3 -3 lines
Diff to previous 1.342 (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.342 / (download) - annotate - [select for diffs], Sat May 16 16:33:16 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.341: +2 -2 lines
Diff to previous 1.341 (colored)

Rename KEYC_ESCAPE to KEYC_META.

Revision 1.341 / (download) - annotate - [select for diffs], Sat May 16 16:20:59 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.340: +90 -3 lines
Diff to previous 1.340 (colored)

Add a client flag 'active-pane' which stores the active pane in the
client and allows it to be changed independently from the real active
pane stored in the window. This is can be used with session groups which
allow an independent current window (although it would be nice to have a
flag for this too and remove session groups). The client active pane is
only really useful interactively, many things (hooks, window-style,
zooming) still use the window active pane.

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

Expand target from client and use it to expand the prompt.

Revision 1.339 / (download) - annotate - [select for diffs], Sat May 16 16:07:55 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.338: +14 -3 lines
Diff to previous 1.338 (colored)

Add a -D flag to ask tmux not to daemonize, useful both for running a
debugger (lldb does not have follow-fork-mode) and for running with a
managed supervisor init system. GitHub issue 2190.

Revision 1.338 / (download) - annotate - [select for diffs], Sat May 16 15:47:22 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.337: +2 -49 lines
Diff to previous 1.337 (colored)

Change message log to be per server rather than per client and include
every command that is run.

Revision 1.337 / (download) - annotate - [select for diffs], Sat May 16 15:45:29 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.336: +59 -1 lines
Diff to previous 1.336 (colored)

Change the existing client flags for control mode to apply for any
client, use the same mechanism for the read-only flag and add an
ignore-size flag.

refresh-client -F has become -f (-F stays for backwards compatibility)
and attach-session and switch-client now have -f flags also. A new
format "client_flags" lists the flags and is shown by list-clients by
default.

This separates the read-only flag from "ignore size" behaviour (new
ignore-size) flag - both behaviours are useful in different
circumstances.

attach -r and switchc -r remain and set or toggle both flags together.

Revision 1.336 / (download) - annotate - [select for diffs], Sat May 16 15:34:08 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.335: +9 -12 lines
Diff to previous 1.335 (colored)

Do not hoke into struct window_pane from the tty code and instead set
everything up in tty_ctx. Provide a way to initialize the tty_ctx from a
callback and use it to let popups draw directly through input_parse in
the same way as panes do, rather than forcing a full redraw on every
change.

Revision 1.335 / (download) - annotate - [select for diffs], Sat May 16 15:06:03 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.334: +7 -5 lines
Diff to previous 1.334 (colored)

Improve command prompt completion:

- Show a menu with completions if there are multiple.

- Don't complete argument stuff (options, layouts) at start of text.

- For -t and -s, if there is no : then complete sessions but if there is
  a :, show a menu of all windows in the session rather than trying to
  complete the window name which is a bit useless if there are
  duplicates.

Revision 1.334 / (download) - annotate - [select for diffs], Sat May 16 14:42:06 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.333: +1 -3 lines
Diff to previous 1.333 (colored)

Do not redraw or update mode if nothing has changed.

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

Move terminal features into a single file.

Revision 1.332 / (download) - annotate - [select for diffs], Tue Apr 21 06:34:13 2020 UTC (4 years ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.331: +16 -16 lines
Diff to previous 1.331 (colored)

Turn off the block flag to reset the state or the cursor will not be
moved back to the right place.

Revision 1.331 / (download) - annotate - [select for diffs], Tue Apr 21 06:32:40 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.330: +2 -2 lines
Diff to previous 1.330 (colored)

Do not clear client pane redraw flags until the redraw actually happens.

Revision 1.330 / (download) - annotate - [select for diffs], Mon Apr 20 14:59:31 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.329: +12 -2 lines
Diff to previous 1.329 (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.329 / (download) - annotate - [select for diffs], Mon Apr 20 13:25:36 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.328: +17 -9 lines
Diff to previous 1.328 (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.328 / (download) - annotate - [select for diffs], Mon Apr 20 09:07:55 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.327: +2 -1 lines
Diff to previous 1.327 (colored)

Also redraw panes which aren't pane 0. Problem reported by tb@.

Revision 1.327 / (download) - annotate - [select for diffs], Mon Apr 20 06:07:39 2020 UTC (4 years ago) by nicm
Branch: MAIN
Changes since 1.326: +9 -3 lines
Diff to previous 1.326 (colored)

Need to check for pane redrawing even if just the window flag is set
(the pane flag may not have been previously set to avoid looping the
windows).

Revision 1.326 / (download) - annotate - [select for diffs], Sat Apr 18 21:35:32 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.325: +36 -11 lines
Diff to previous 1.325 (colored)

The PANE_REDRAW flag bit might be needed by other panes so we can't
clear it on the first redraw, and it can't be set when we are finished
or they would be redrawn again, so if the redraw is deferred for a
client, copy the redraw flag into a separate set of bits just for that
client.

Revision 1.325 / (download) - annotate - [select for diffs], Sat Apr 18 07:32:53 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.324: +9 -11 lines
Diff to previous 1.324 (colored)

Bring back previons fix to only redraw panes that need it after a redraw
is deferred, but clear the pane flags when they are actually redrawn
rather than every time.

Revision 1.324 / (download) - annotate - [select for diffs], Sat Apr 18 06:52:36 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.323: +3 -3 lines
Diff to previous 1.323 (colored)

Only update mode when actually going to redraw something.

Revision 1.323 / (download) - annotate - [select for diffs], Sat Apr 18 06:20:50 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.322: +2 -1 lines
Diff to previous 1.322 (colored)

Add a flag to protect against nested syncs and add some extra logging to
redrawing.

Revision 1.322 / (download) - annotate - [select for diffs], Sat Apr 18 06:15:07 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.321: +10 -10 lines
Diff to previous 1.321 (colored)

Revert previous, there is still a problem.

Revision 1.321 / (download) - annotate - [select for diffs], Sat Apr 18 06:10:15 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.320: +10 -10 lines
Diff to previous 1.320 (colored)

When a redraw is deferred because the terminal hasn't finished reading
the data from the last one, other panes could update while waiting, so
we set the flag to redraw them all when the new redraw actually
happened. But this means a lot of redrawing panes unnecessarily if they
haven't changed - so instead set a flag to say "at least one pane needs
to be redrawed" then look at the invidual pane flags to see which ones
need it.

Revision 1.320 / (download) - annotate - [select for diffs], Fri Apr 17 22:16:28 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.319: +6 -4 lines
Diff to previous 1.319 (colored)

Set mode properly before and after redrawing, and don't bother
calculating cursor position if it won't be used.

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

Move the UTF-8 flag to terminal flags.

Revision 1.318 / (download) - annotate - [select for diffs], Mon Apr 13 15:55:51 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.317: +2 -2 lines
Diff to previous 1.317 (colored)

When adding a list of commands to the queue, instead of automatically
creating a new state for each group of commands, require the caller to
create one and use it for all the commands in the list. This means the
current target works even with list with multiple groups (which can
happen if they are defined with newlines).

Revision 1.317 / (download) - annotate - [select for diffs], Mon Apr 13 14:46:04 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.316: +2 -2 lines
Diff to previous 1.316 (colored)

Move cmdq_state into cmd-queue.c.

Revision 1.316 / (download) - annotate - [select for diffs], Mon Apr 13 10:59:59 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.315: +5 -6 lines
Diff to previous 1.315 (colored)

Also move cmdq_item and cmdq_list into cmd-queue.c (this is to make its
use more clearly defined and preparation for some future work).

Revision 1.315 / (download) - annotate - [select for diffs], Thu Apr 9 13:52:31 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.314: +4 -5 lines
Diff to previous 1.314 (colored)

Some unnecessary assignments and unused variables.

Revision 1.314 / (download) - annotate - [select for diffs], Thu Apr 9 12:16:16 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.313: +3 -1 lines
Diff to previous 1.313 (colored)

Wait until the initial command sequence is done before sending a device
attributes request and other bits that prompt a reply from the terminal.
This means that stray relies are not left on the terminal if the command
has attached and then immediately detached and tmux will not be around
to receive them. Prompted by a problem report from espie@.

Revision 1.313 / (download) - annotate - [select for diffs], Wed Apr 1 11:47:44 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.312: +1 -2 lines
Diff to previous 1.312 (colored)

Do not ignore triple-click and send to pane.

Revision 1.312 / (download) - annotate - [select for diffs], Tue Mar 31 17:14:40 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.311: +3 -2 lines
Diff to previous 1.311 (colored)

Add a way to mark environment variables as "hidden" so they can be used
by tmux but are not passed into the environment of new panes.

Revision 1.311 / (download) - annotate - [select for diffs], Tue Mar 31 11:38:35 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.310: +56 -9 lines
Diff to previous 1.310 (colored)

Add a "second click" key type which is fired for the second click of a
double click, even if the timer hasn't expired to confirm it isn't
actually a triple click. Provides a way for people who don't care about
triple clicks or can make their commands have no side effects to avoid
the double click timer delay.

Revision 1.310 / (download) - annotate - [select for diffs], Tue Mar 31 07:00:34 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.309: +2 -2 lines
Diff to previous 1.309 (colored)

Move alternate screen into the screen rather than the pane.

Revision 1.309 / (download) - annotate - [select for diffs], Tue Mar 24 08:09:44 2020 UTC (4 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.308: +49 -25 lines
Diff to previous 1.308 (colored)

Add support for overlay popup boxes to show text or output temporarily
above the normal layout. These work similarly to menus and are created
with the display-popup command.

Revision 1.308 / (download) - annotate - [select for diffs], Tue Mar 17 11:10:12 2020 UTC (4 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.307: +4 -2 lines
Diff to previous 1.307 (colored)

Ignore default-shell (and use /bin/sh) if it invalid not just if it is
tmux itself, also refuse to set the option to something invalid in the
first place. GitHub issue 2120.

Revision 1.307 / (download) - annotate - [select for diffs], Mon Mar 16 06:12:42 2020 UTC (4 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.306: +8 -4 lines
Diff to previous 1.306 (colored)

Send mouse down event immediately rather than waiting for double click
to finish which would now mean it was out of order. Reported by Mark
Kelly.

Revision 1.306 / (download) - annotate - [select for diffs], Thu Mar 12 13:16:16 2020 UTC (4 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.305: +26 -11 lines
Diff to previous 1.305 (colored)

Change how double and triple clicks works so that one or the other is
fired - a double click is no longer triggered on the way to a triple
click.

Revision 1.305 / (download) - annotate - [select for diffs], Wed Feb 19 14:25:00 2020 UTC (4 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.304: +6 -4 lines
Diff to previous 1.304 (colored)

A few fixes to make modifier keys and dragging work - need to remove the
modifiers before checking for the dragging marker key, and apply them
before looking up the end key. Also fix key-to-string with modifiers for
special keys.

Revision 1.304 / (download) - annotate - [select for diffs], Tue Feb 11 07:01:08 2020 UTC (4 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.303: +1 -3 lines
Diff to previous 1.303 (colored)

Remove unused variables from Ben Boeckel, and a Pp from jmc.

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

Add a define for flags meaning a client is not attached, and fix
unattached counter, reported by Thomas Sattler.

Revision 1.302 / (download) - annotate - [select for diffs], Mon Dec 16 16:39:03 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.301: +1 -17 lines
Diff to previous 1.301 (colored)

If /dev/fd/X is a symlink and realpath() expands symlinks, /dev/fd/X
ends up pointing to the wrong place before it is passed to the client.
The path is only used internally so there is no real need for
realpath(), remove it and move the get_path function to file.c where all
the callers are.

Revision 1.301 / (download) - annotate - [select for diffs], Mon Dec 16 15:48:50 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.300: +4 -4 lines
Diff to previous 1.300 (colored)

Instead of using large buffers in imsgs, add the data or path onto the end.

Revision 1.300 / (download) - annotate - [select for diffs], Thu Dec 12 11:39:56 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.299: +85 -126 lines
Diff to previous 1.299 (colored)

Rewrite the code for reading and writing files. Now, if the client is
not attached, the server process asks it to open the file, similar to
how works for stdin, stdout, stderr. This makes special files like
/dev/fd/X work (used by some shells). stdin, stdout and stderr and
control mode are now just special cases of the same mechanism. This will
also make it easier to use for other commands that read files such as
source-file.

Revision 1.299 / (download) - annotate - [select for diffs], Tue Dec 3 10:47:22 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.298: +2 -2 lines
Diff to previous 1.298 (colored)

Style nits in function arguments.

Revision 1.298 / (download) - annotate - [select for diffs], Thu Nov 28 09:56:25 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.297: +3 -2 lines
Diff to previous 1.297 (colored)

Long lines and spacing fixes.

Revision 1.297 / (download) - annotate - [select for diffs], Thu Nov 28 09:45:16 2019 UTC (4 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.296: +3 -14 lines
Diff to previous 1.296 (colored)

Make a best effort to set xpixel and ypixel for each pane and add
formats for them.

Revision 1.296 / (download) - annotate - [select for diffs], Fri Nov 1 20:26:21 2019 UTC (4 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.295: +18 -4 lines
Diff to previous 1.295 (colored)

Limit lazy resize to panes in attached sessions only - those in
unattached are likely to have been resized by something like
split-window where the user probably wants the resize to happen
immediately. GitHub issue 1963.

Revision 1.295 / (download) - annotate - [select for diffs], Thu Sep 19 09:02:30 2019 UTC (4 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.294: +22 -1 lines
Diff to previous 1.294 (colored)

Add a "latest" window-size option which tries to size windows based on
the most recently used client. From Tommie Gannert in GitHub issue 1869
based on earlier changes from me.

Revision 1.294 / (download) - annotate - [select for diffs], Wed Aug 28 07:34:32 2019 UTC (4 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.293: +45 -32 lines
Diff to previous 1.293 (colored)

The resize event was never deciding to actually resize the pane if there
was output in the pane faster than the timer would fire, so change how
it works to only defer the timer again if the pane was actually resized
within the last timer period. Reported by James Tai in GitHub issue
1880.

Revision 1.293 / (download) - annotate - [select for diffs], Wed Jul 17 17:46:51 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.292: +2 -1 lines
Diff to previous 1.292 (colored)

Clear overlay on normal key press.

Revision 1.292 / (download) - annotate - [select for diffs], Sat Jul 6 20:56:34 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.291: +5 -4 lines
Diff to previous 1.291 (colored)

Correctly adjust mouse position if the status line is at the top and
more than one line. GitHub issue 1822.

Revision 1.291 / (download) - annotate - [select for diffs], Tue Jul 2 20:09:19 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.290: +18 -20 lines
Diff to previous 1.290 (colored)

Command prompt key presses need to avoid the command queue, GitHub issue
1817. Also a tmux.1 fix from jmc.

Revision 1.290 / (download) - annotate - [select for diffs], Wed Jun 26 18:28:31 2019 UTC (4 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.289: +7 -3 lines
Diff to previous 1.289 (colored)

Pass keys that aren't 0-9 on to normal key processing when display-panes
is active (restores previous behaviour).

Revision 1.289 / (download) - annotate - [select for diffs], Thu Jun 20 19:29:38 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.288: +4 -3 lines
Diff to previous 1.288 (colored)

Need to always check focus even if not current window.

Revision 1.288 / (download) - annotate - [select for diffs], Thu Jun 20 06:51:36 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.287: +22 -19 lines
Diff to previous 1.287 (colored)

Expand command formats in %if and move the config file loading later (to
when the first client has identified) so all the client formats are
available, fixes problems reported by Thomas Sattler.

Revision 1.287 / (download) - annotate - [select for diffs], Tue Jun 11 13:09:00 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.286: +9 -2 lines
Diff to previous 1.286 (colored)

Do not resize panes unless they are in an attached, active window. From
Morten M Neergaard in GitHub issue 1782.

Revision 1.286 / (download) - annotate - [select for diffs], Fri Jun 7 20:09:17 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.285: +5 -3 lines
Diff to previous 1.285 (colored)

Do not load the config file if the server is exiting because it failed
to start, otherwise commands like lsk which start the server again can
end up looping infinitely. Also make the first client exit
correctly. Problem reported by Wael M Nasreddine.

Revision 1.285 / (download) - annotate - [select for diffs], Sat May 25 07:18:20 2019 UTC (4 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.284: +16 -9 lines
Diff to previous 1.284 (colored)

Merge cmd_list_parse into cmd-parse.y so it can use the new alias
processing code.

Revision 1.284 / (download) - annotate - [select for diffs], Mon May 20 11:46:06 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.283: +3 -14 lines
Diff to previous 1.283 (colored)

Replace the various identical error callbacks with a single one in cmd-queue.c.

Revision 1.283 / (download) - annotate - [select for diffs], Sun May 12 18:16:33 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.282: +10 -8 lines
Diff to previous 1.282 (colored)

Fix some indentation and dead assignments.

Revision 1.282 / (download) - annotate - [select for diffs], Wed May 8 18:07:12 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.281: +10 -3 lines
Diff to previous 1.281 (colored)

Add a flag to redraw only the overlay, and remove the overlay on resize.

Revision 1.281 / (download) - annotate - [select for diffs], Tue May 7 20:01:41 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.280: +34 -49 lines
Diff to previous 1.280 (colored)

Move around the display-panes identify code to make it a bit more
generic and hide the display-panes specific bits into
cmd-display-panes.c.

Revision 1.280 / (download) - annotate - [select for diffs], Tue May 7 11:24:03 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.279: +40 -2 lines
Diff to previous 1.279 (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.279 / (download) - annotate - [select for diffs], Fri May 3 20:44:24 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.278: +2 -3 lines
Diff to previous 1.278 (colored)

Allow panes to be empty (no command), output can be piped to them with
split-window or display-message -I.

Revision 1.278 / (download) - annotate - [select for diffs], Fri May 3 18:42:40 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.277: +3 -3 lines
Diff to previous 1.277 (colored)

Do not store the mouse position we calculate as the start of a drag back
into the mouse event that later code uses, it has been adjusted and they
should use the original position. GitHub issue 1710.

Revision 1.277 / (download) - annotate - [select for diffs], Fri May 3 16:51:29 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.276: +2 -2 lines
Diff to previous 1.276 (colored)

Fix mouse positioning when the pane is not entirely visible.

Revision 1.276 / (download) - annotate - [select for diffs], Fri May 3 14:51:30 2019 UTC (5 years ago) by nicm
Branch: MAIN
Changes since 1.275: +40 -25 lines
Diff to previous 1.275 (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.275 / (download) - annotate - [select for diffs], Thu Apr 18 10:11:52 2019 UTC (5 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.274: +2 -1 lines
Diff to previous 1.274 (colored)

Update session activity on focus event, from tafryn at gmail dot com.

Revision 1.274 / (download) - annotate - [select for diffs], Mon Mar 25 18:59:55 2019 UTC (5 years, 1 month ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.273: +71 -19 lines
Diff to previous 1.273 (colored)

Add StatusDefault binding for the mouse on any otherwise unassigned
parts of the status line, from Avi Halachmi.

Revision 1.273 / (download) - annotate - [select for diffs], Mon Mar 25 09:22:09 2019 UTC (5 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.272: +10 -10 lines
Diff to previous 1.272 (colored)

Ignore mouse on status line which are not part of a range, GitHub issue 1649.

Revision 1.272 / (download) - annotate - [select for diffs], Mon Mar 18 20:53:33 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.271: +24 -11 lines
Diff to previous 1.271 (colored)

Extend the #[] style syntax and use that together with previous format
changes to allow the status line to be entirely configured with a single
option.

Now that it is possible to configure their content, enable the existing
code that lets the status line be multiple lines in height. The status
option can now take a value of 2, 3, 4 or 5 (as well as the previous on
or off) to configure more than one line. The new status-format array
option configures the format of each line, the default just references
the existing status-* options, although some of the more obscure status
options may be eliminated in time.

Additions to the #[] syntax are: "align" to specify alignment (left,
centre, right), "list" for the window list and "range" to configure
ranges of text for the mouse bindings.

The "align" keyword can also be used to specify alignment of entries in
tree mode and the pane status lines.

Revision 1.271 / (download) - annotate - [select for diffs], Sat Mar 16 17:14:07 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.270: +2 -2 lines
Diff to previous 1.270 (colored)

Tidy and rename some bits of status line code.

Revision 1.270 / (download) - annotate - [select for diffs], Fri Mar 15 14:46:58 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.269: +2 -8 lines
Diff to previous 1.269 (colored)

Move status line free into its own function.

Revision 1.269 / (download) - annotate - [select for diffs], Thu Mar 14 23:14:27 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.268: +2 -2 lines
Diff to previous 1.268 (colored)

Store the time in the format tree rather than passing it around.

Revision 1.268 / (download) - annotate - [select for diffs], Thu Mar 14 21:27:26 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.267: +2 -2 lines
Diff to previous 1.267 (colored)

Accept 0 time as a shorthand for now to format_expand_time.

Revision 1.267 / (download) - annotate - [select for diffs], Tue Mar 12 11:16:50 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.266: +16 -18 lines
Diff to previous 1.266 (colored)

Allow multiple modes to be open in a pane. A stack of open modes is kept
and the previous restored when the top is exited. If a mode that is
already on the stack is entered, the existing instance is moved to the
top as the active mode rather than being opened new.

Revision 1.266 / (download) - annotate - [select for diffs], Thu Mar 7 20:24:21 2019 UTC (5 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.265: +6 -3 lines
Diff to previous 1.265 (colored)

Add a separate mode struct for the active window mode if any.

Revision 1.265 / (download) - annotate - [select for diffs], Sat Feb 16 11:42:08 2019 UTC (5 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.264: +3 -1 lines
Diff to previous 1.264 (colored)

Use starting client cwd in config file, GitHub issue 1606.

Revision 1.264 / (download) - annotate - [select for diffs], Tue Dec 18 13:20:44 2018 UTC (5 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.263: +5 -3 lines
Diff to previous 1.263 (colored)

Pass window into mode functions.

Revision 1.263 / (download) - annotate - [select for diffs], Mon Nov 19 13:35:41 2018 UTC (5 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.262: +7 -1 lines
Diff to previous 1.262 (colored)

evbuffer_new and bufferevent_new can both fail (when malloc fails) and
return NULL. GitHub issue 1547.

Revision 1.262 / (download) - annotate - [select for diffs], Wed Nov 7 08:06:28 2018 UTC (5 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.261: +9 -4 lines
Diff to previous 1.261 (colored)

If a non-repeating key is used when repeating, it should be treated as
an entirely new key press, not checked in root table and ignored if not
found. GitHub issue 1513.

Revision 1.261 / (download) - annotate - [select for diffs], Thu Oct 18 08:38:01 2018 UTC (5 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.260: +47 -26 lines
Diff to previous 1.260 (colored)

Support for windows larger than visible on the attached client. This has
been a limitation for a long time.

There are two new options, window-size and default-size, and a new
command, resize-window. The force-width and force-height options and the
session_width and session_height formats have been removed.

The new window-size option tells tmux how to work out the size of
windows: largest means it picks the size of the largest session,
smallest the smallest session (similar to the old behaviour) and manual
means that it does not automatically resize windows. The default is
currently largest but this may change. aggressive-resize modifies the
choice of session for largest and smallest as it did before.

If a window is in a session attached to a client that is too small, only
part of the window is shown. tmux attempts to keep the cursor visible,
so the part of the window displayed is changed as the cursor moves (with
a small delay, to try and avoid excess redrawing when applications
redraw status lines or similar that are not currently visible). The
offset of the visible portion of the window is shown in status-right.

Drawing windows which are larger than the client is not as efficient as
those which fit, particularly when the cursor moves, so it is
recommended to avoid using this on slow machines or networks (set
window-size to smallest or manual).

The resize-window command can be used to resize a window manually. If it
is used, the window-size option is automatically set to manual for the
window (undo this with "setw -u window-size"). resize-window works in a
similar way to resize-pane (-U -D -L -R -x -y flags) but also has -a and
-A flags. -a sets the window to the size of the smallest client (what it
would be if window-size was smallest) and -A the largest.

For the same behaviour as force-width or force-height, use resize-window
-x or -y, and "setw -u window-size" to revert to automatic sizing..

If the global window-size option is set to manual, the default-size
option is used for new windows. If -x or -y is used with new-session,
that sets the default-size option for the new session.

The maximum size of a window is 10000x10000. But expect applications to
complain and much higher memory use if making a window excessively
big. The minimum size is the size required for the current layout
including borders.

The refresh-client command can be used to pan around a window, -U -D -L
-R moves up, down, left or right and -c returns to automatic cursor
tracking. The position is reset when the current window is changed.

Revision 1.260 / (download) - annotate - [select for diffs], Tue Sep 11 06:37:54 2018 UTC (5 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4
Changes since 1.259: +23 -16 lines
Diff to previous 1.259 (colored)

Do not check for mouse events on pane borders when zoomed, based on a
fix from Avi Halachmi.

Revision 1.259 / (download) - annotate - [select for diffs], Wed Aug 29 09:50:32 2018 UTC (5 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.258: +2 -1 lines
Diff to previous 1.258 (colored)

Keep any text killed in the command prompt with C-w and yank it with
C-y, only use the top buffer if no text has previously been killed. This
and previous change promped by discussion with kn@.

Revision 1.258 / (download) - annotate - [select for diffs], Wed Aug 22 20:06:14 2018 UTC (5 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.257: +92 -10 lines
Diff to previous 1.257 (colored)

Add StatusLeft and StatusRight mouse key modifiers for the left and
right parts of the status line.

Revision 1.257 / (download) - annotate - [select for diffs], Sun Aug 19 20:13:07 2018 UTC (5 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.256: +7 -1 lines
Diff to previous 1.256 (colored)

Add a flag to force redrawing of the status line even if the content
hasn't changed, needed for resizing.

Revision 1.256 / (download) - annotate - [select for diffs], Sun Aug 19 16:45:03 2018 UTC (5 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.255: +15 -26 lines
Diff to previous 1.255 (colored)

Add a client redraw-window flag instead of the redraw-all flag and for
all just use the three flags together (window, borders, status).

Revision 1.255 / (download) - annotate - [select for diffs], Sat Aug 18 20:08:52 2018 UTC (5 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.254: +2 -2 lines
Diff to previous 1.254 (colored)

SESSION_UNATTACHED flag is no longer necessary now we have an attached
count instead.

Revision 1.254 / (download) - annotate - [select for diffs], Thu Aug 2 11:44:07 2018 UTC (5 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.253: +6 -5 lines
Diff to previous 1.253 (colored)

Make key trees and some other bits static.

Revision 1.253 / (download) - annotate - [select for diffs], Tue Jul 17 18:02:40 2018 UTC (5 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.252: +16 -11 lines
Diff to previous 1.252 (colored)

When a key isn't in the first table, we need to try the same key again
not the any key. Also rename some labels. Fixes GitHub issue 1406
reeported by Mark Kelly.

Revision 1.252 / (download) - annotate - [select for diffs], Mon Jul 16 08:48:22 2018 UTC (5 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.251: +6 -2 lines
Diff to previous 1.251 (colored)

Add an "Any" key to run a command if a key is pressed that is not bound
in the current key table. GitHub issue 1404.

Revision 1.251 / (download) - annotate - [select for diffs], Wed Jul 4 12:25:26 2018 UTC (5 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.250: +11 -9 lines
Diff to previous 1.250 (colored)

Add pane focus hooks.

Revision 1.250 / (download) - annotate - [select for diffs], Thu May 24 09:42:49 2018 UTC (5 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.249: +9 -5 lines
Diff to previous 1.249 (colored)

Make server_client_get_cwd used (almost) everywhere we need to work out
the cwd, and do not fall back to "." as it is pretty useless. GitHub
issue 1331.

Revision 1.249 / (download) - annotate - [select for diffs], Thu Mar 8 08:09:10 2018 UTC (6 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.248: +3 -1 lines
Diff to previous 1.248 (colored)

Add a missing client-detached hook when the server shuts down, and do
not exit until jobs started from run-shell/if-shell have finished (add a
job flags member and a flag to indicate other jobs). GitHub issue 1245.

Revision 1.248 / (download) - annotate - [select for diffs], Thu Feb 22 10:58:12 2018 UTC (6 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.247: +2 -2 lines
Diff to previous 1.247 (colored)

Check prefix when retrying so it is checked while repeat flag is
set. GitHub issue 1239.

Revision 1.247 / (download) - annotate - [select for diffs], Mon Feb 5 08:21:54 2018 UTC (6 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.246: +8 -8 lines
Diff to previous 1.246 (colored)

Add struct status_line to hold status line members of struct client, not
used yet but will be soon. From Thomas Adam.

Revision 1.246 / (download) - annotate - [select for diffs], Tue Dec 19 15:00:39 2017 UTC (6 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.245: +6 -2 lines
Diff to previous 1.245 (colored)

Report better error from server when socket create fails, GitHub issue
1201.

Revision 1.245 / (download) - annotate - [select for diffs], Mon Oct 16 19:30:53 2017 UTC (6 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.244: +9 -8 lines
Diff to previous 1.244 (colored)

Infrastructure for drawing status lines of more than one line in height,
still only one is allowed but this lets tmux draw bigger ones.

Revision 1.244 / (download) - annotate - [select for diffs], Wed Sep 6 07:12:41 2017 UTC (6 years, 8 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.243: +3 -3 lines
Diff to previous 1.243 (colored)

Do not attempt to use TIOCSWINSZ on a -1 file descriptor (possible if
the pane has already died).

Revision 1.243 / (download) - annotate - [select for diffs], Wed Aug 30 10:33:57 2017 UTC (6 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.242: +3 -3 lines
Diff to previous 1.242 (colored)

Pass flags into cmd_find_from_* to fix prefer-unattached, reported by
Thomas Sattler.

Revision 1.242 / (download) - annotate - [select for diffs], Wed Aug 16 12:12:54 2017 UTC (6 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.241: +4 -5 lines
Diff to previous 1.241 (colored)

Add -d flag to display-panes to specify timeout, and make 0 mean no
timeout. From Laurens Post.

Revision 1.241 / (download) - annotate - [select for diffs], Fri Jul 14 08:04:23 2017 UTC (6 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.240: +14 -19 lines
Diff to previous 1.240 (colored)

Fix redraw defer code in the presence of multiple clients - the timer
may be needed for all of them, so don't delete it on the first; and
don't skip setting the redraw flag if the timer is already running.

Reported by Pol Van Aubel in GitHub issue 1003.

Revision 1.240 / (download) - annotate - [select for diffs], Wed Jul 12 09:07:52 2017 UTC (6 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.239: +3 -3 lines
Diff to previous 1.239 (colored)

proc_send_s now seems unnecessary.

Revision 1.239 / (download) - annotate - [select for diffs], Tue Jun 13 07:12:33 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.238: +6 -4 lines
Diff to previous 1.238 (colored)

Remove xterm flag from key before checking prefix, reported by Peter
Fern in GitHub issue 974.

Revision 1.238 / (download) - annotate - [select for diffs], Tue Jun 6 15:49:35 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.237: +4 -3 lines
Diff to previous 1.237 (colored)

Continue and pass keys through if they are repeated keys, so that the
first key after a repeated key doesn't get lost.

Revision 1.237 / (download) - annotate - [select for diffs], Wed May 31 11:00:00 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.236: +41 -20 lines
Diff to previous 1.236 (colored)

Some applications like vi(1) and tmux until 10 minutes or so ago, do not
redraw on SIGWINCH if the size returns to the original size between the
original SIGWINCH and when they get around to calling TIOCGWINSZ. So use
the existing resize timer to introduce a small delay between the two
resizes.

Revision 1.236 / (download) - annotate - [select for diffs], Wed May 31 10:29:15 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.235: +4 -5 lines
Diff to previous 1.235 (colored)

It is not OK to ignore SIGWINCH if SIOCGWINSZ reports the size has
unchanged, because it may have changed and changed back in the time
between us getting the signal and calling ioctl(). Always redraw when we
see SIGWINCH.

Revision 1.235 / (download) - annotate - [select for diffs], Wed May 31 10:15:51 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.234: +25 -2 lines
Diff to previous 1.234 (colored)

Because we defer actually resizing applications (calling TIOCSWINSZ)
until the end of the server loop, tmux may have gone through several
internal resizes in between. This can be a problem if the final size is
the same as the initial size (what the application things it currently
is), because the application may choose not to redraw, assuming the
screen state is unchanged, when in fact tmux has thrown away parts of
the screen, assuming the application will redraw them.

To avoid this, do an extra resize if the new size is the same size as
the initial size. This should force the application to redraw when tmux
needs it to, while retaining the benefits of deferring (so we now resize
at most two times instead of at most one - and only two very rarely).

Fixes a problem with break-pane and zoomed panes reported by Michal
Mazurek.

Revision 1.234 / (download) - annotate - [select for diffs], Mon May 29 20:41:29 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.233: +5 -1 lines
Diff to previous 1.233 (colored)

Store a copy of the old status line, will be needed soon for new choose mode.

Revision 1.233 / (download) - annotate - [select for diffs], Mon May 29 20:37:30 2017 UTC (6 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.232: +16 -1 lines
Diff to previous 1.232 (colored)

Function to count clients.

Revision 1.232 / (download) - annotate - [select for diffs], Tue May 16 12:57:26 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.231: +9 -8 lines
Diff to previous 1.231 (colored)

Line length and spaces to tabs.

Revision 1.231 / (download) - annotate - [select for diffs], Wed May 10 10:46:59 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.230: +2 -2 lines
Diff to previous 1.230 (colored)

Insert copy mode bindings at the right place in the command queue.

Revision 1.230 / (download) - annotate - [select for diffs], Tue May 9 13:04:36 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.229: +11 -1 lines
Diff to previous 1.229 (colored)

If the current screen was complex enough, it was possible to make redraw
itself hit the "terminal can't keep up" check. To avoid this, record how
much data we send during redraw (we know we will be starting with 0) and
skip the check until it has been flushed. GitHub issue 912.

Revision 1.229 / (download) - annotate - [select for diffs], Sun May 7 21:25:59 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.228: +2 -2 lines
Diff to previous 1.228 (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.228 / (download) - annotate - [select for diffs], Mon May 1 12:20:55 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.227: +3 -2 lines
Diff to previous 1.227 (colored)

In order that people can use formats like #D in #() in the status line
and not have to wait for an update when they change pane, we allow
commands to run more than once a second if the expanded form
changes. Unfortunately this can mean them being run far too often
(pretty much continually) when multiple clients exist, because some
formats (including #D) will always differ between clients.

To avoid this, give each client its own tree of jobs which means that
the same command will be different instances for each client - similar
to how we have the tag to separate commands for different panes.

GitHub issue 889; test case reported by Paul Johnson.

Revision 1.227 / (download) - annotate - [select for diffs], Sat Apr 22 08:56:24 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.226: +6 -12 lines
Diff to previous 1.226 (colored)

Mouse bindings and hooks set up an initial current state when running a
command. This is used for the session, window and pane for all commands
in the command sequence if there is no -t or -s.

However, using it for all commands in the command sequence means that if
the active pane or current session is changed, subsequent commands still
use the previous state. So make commands which explicitly change the
current state (such as neww and selectp) update it themselves for later
commands. Commands which may invalidate the state (like killp) are
already OK because an invalid state will be ignored.

Also fill in the current state for all key bindings rather than just the
mouse, so that any omissions are easier to spot.

Revision 1.226 / (download) - annotate - [select for diffs], Fri Apr 21 22:23:24 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.225: +1 -4 lines
Diff to previous 1.225 (colored)

Log error properly when no current state, and some other minor tweaks.

Revision 1.225 / (download) - annotate - [select for diffs], Fri Apr 21 19:33:07 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.224: +3 -1 lines
Diff to previous 1.224 (colored)

Key needs to be initialized to zero now it has flags in it.

Revision 1.224 / (download) - annotate - [select for diffs], Fri Apr 21 17:22:20 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.223: +2 -6 lines
Diff to previous 1.223 (colored)

Add cmd_find_from_winlink_pane and use it in a couple of places, and
make functions that can't fail void.

Revision 1.223 / (download) - annotate - [select for diffs], Fri Apr 21 16:04:18 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.222: +33 -24 lines
Diff to previous 1.222 (colored)

It is annoying that the copy mode key table (or any other key table)
will suppress root key table bindings. So change to always check the
root table if no binding is found in the current table (whether it be
the prefix table from pressing the prefix or the copy mode table from a
pane).

A root key binding can be blocked by binding the key to a command that
does nothing (like send-keys with no arguments).

Problem reported by Thomas Sattler.

Revision 1.222 / (download) - annotate - [select for diffs], Fri Apr 21 14:01:19 2017 UTC (7 years ago) by nicm
Branch: MAIN
Changes since 1.221: +4 -3 lines
Diff to previous 1.221 (colored)

Store state shared between multiple commands in the queue in a shared
structure.

Revision 1.221 / (download) - annotate - [select for diffs], Thu Apr 20 15:16:20 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.220: +6 -7 lines
Diff to previous 1.220 (colored)

Only set up a current target for mouse key bindings. Fixes:

	bind q select-pane -U \; resize-pane -Z

(There is still some possible weirdness with the way we do current
targets, it should probably be done in a different way at some point.)

Revision 1.220 / (download) - annotate - [select for diffs], Wed Apr 19 14:00:28 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.219: +19 -4 lines
Diff to previous 1.219 (colored)

Add a suspend helper function, and do not allow detaching or suspending
while already doing so.

Revision 1.219 / (download) - annotate - [select for diffs], Wed Apr 19 06:52:27 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.218: +3 -3 lines
Diff to previous 1.218 (colored)

When the data we have buffered to write to a terminal grows beyond a
reasonable amount (currently width * height * 8 bytes), discard all
output to the terminal and start trying to redraw periodically
instead. Continue with this until the amount of data we are trying to
write falls to a low level again.

This helps to prevent tmux sitting on a huge buffer of data when there
are processes with fast output running inside tmux but the outside
terminal is slow.

A new client_discarded format holds the amount of data that has been
discarded due to this mechanism.

The three variables (when to start this, when to stop, and how often to
redraw) are basically "works for me" at the moment, this is going in to
see how it goes and if it causes problems for anyone else.

Revision 1.218 / (download) - annotate - [select for diffs], Tue Apr 18 20:37:49 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.217: +52 -2 lines
Diff to previous 1.217 (colored)

On terminals without DECSLRM, when a pane that is less than the full
with of the terminal scrolls, tmux needs to redraw the entire pane. This
results in a large amount of output data which can cause slow terminals
to struggle, particularly when many lines are scrolled together quickly.

This can be reduced by only redrawing when tmux doesn't hold any
buffered data for the terminal. If a redraw is required and data is
buffered, the redraw is deferred until all that data is consumed (it is
checked after every event loop, a timer is used to ensure this happens
at some point). While a redraw is pending, no additional data will be
written to the terminal.

The redraw still happens, now it is just pushed back if it is possible
it would just add more data on top of a terminal that is already
behind. This both gives the terminal a chance to catch up, and allows
tmux to process more scrolling (that would require additional redraws)
in the meantime.

Helps with a problem reported by Greg Hurrell.

Revision 1.217 / (download) - annotate - [select for diffs], Mon Apr 17 06:40:32 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.216: +1 -7 lines
Diff to previous 1.216 (colored)

Remove a couple of redraw flags that no longer have any effect.

Revision 1.216 / (download) - annotate - [select for diffs], Wed Apr 5 10:49:46 2017 UTC (7 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.215: +14 -7 lines
Diff to previous 1.215 (colored)

Give each client a name. This defaults to the tty name as before but
falls back to an alternative if the tty name is not available. This is
clearer than overloading the client ttyname member and allows us to
remove the path stored in the tty struct, it should always be the same
as the client.

Revision 1.215 / (download) - annotate - [select for diffs], Thu Mar 9 22:00:46 2017 UTC (7 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.214: +5 -1 lines
Diff to previous 1.214 (colored)

Clear the bracket paste mode when in the command prompt.

Revision 1.214 / (download) - annotate - [select for diffs], Thu Mar 9 17:06:35 2017 UTC (7 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.213: +47 -4 lines
Diff to previous 1.213 (colored)

Move the client identify (display-panes) code into server-client.c.

Revision 1.213 / (download) - annotate - [select for diffs], Tue Feb 14 18:13:05 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.212: +30 -1 lines
Diff to previous 1.212 (colored)

Make source-file look for files relative to the client working directory
(like load-buffer and save-buffer), from Chris Pickel. Also break the
where-is-this-file code out into its own function for loadb and saveb.

Revision 1.212 / (download) - annotate - [select for diffs], Thu Feb 9 12:09:33 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.211: +32 -1 lines
Diff to previous 1.211 (colored)

Break the message storage function into its own function, useful for
debugging.

Revision 1.211 / (download) - annotate - [select for diffs], Wed Feb 8 15:49:29 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.210: +2 -1 lines
Diff to previous 1.210 (colored)

Some other tidying bits.

Revision 1.210 / (download) - annotate - [select for diffs], Fri Feb 3 11:57:27 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.209: +2 -2 lines
Diff to previous 1.209 (colored)

Add a window or pane id "tag" to each format tree and use it to separate
jobs, this means that if the same job is used for different windows or
panes (for example in pane-border-format), it will be run separately for
each pane.

Revision 1.209 / (download) - annotate - [select for diffs], Wed Feb 1 09:55:07 2017 UTC (7 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.208: +35 -7 lines
Diff to previous 1.208 (colored)

Implement "all event" (1003) mouse mode but in a way that works. The
main issue is that if we have two panes, A with 1002 and B with 1003, we
need to set 1003 outside tmux in order to get all the mouse events, but
then we need to suppress the ones that pane A doesn't want. This is easy
in SGR mouse mode, because buttons == 3 is only used for movement events
(for other events the trailing m/M marks a release instead), but in
normal mouse mode we can't tell so easily. So for that, look at the
previous event instead - if it is drag+release as well, then the current
event is a movement event.

Revision 1.208 / (download) - annotate - [select for diffs], Fri Jan 13 11:56:43 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.207: +4 -3 lines
Diff to previous 1.207 (colored)

Make options_get_string return const string.

Revision 1.207 / (download) - annotate - [select for diffs], Fri Jan 13 10:12:12 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.206: +27 -1 lines
Diff to previous 1.206 (colored)

Add -E to detach-client to exec a command to replace the client instead
of exiting it, useful if tmux wasn't exec'd itself. From Jenna Magius.

Revision 1.206 / (download) - annotate - [select for diffs], Wed Jan 11 22:36:07 2017 UTC (7 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.205: +2 -2 lines
Diff to previous 1.205 (colored)

Add some missing special keys to key_string_lookup_key, fix a mouse
check in server_client_handle_key, and tweak a comment.

Revision 1.205 / (download) - annotate - [select for diffs], Wed Dec 7 09:16:13 2016 UTC (7 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.204: +14 -12 lines
Diff to previous 1.204 (colored)

Make prefix work in all tables (except the prefix table). Users who want
to avoid this can set prefix to "none" and bind send-prefix
themselves. Allows C-b t be bound in the copy mode tables again, pointed
out by millert@.

Revision 1.204 / (download) - annotate - [select for diffs], Thu Nov 24 18:45:45 2016 UTC (7 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.203: +10 -8 lines
Diff to previous 1.203 (colored)

The mouse valid flag needs to be correct before we fire the dragging
callback, so move the callback outside of server_client_check_mouse and
use a new special key code to indicate it.

Revision 1.203 / (download) - annotate - [select for diffs], Thu Nov 24 14:38:55 2016 UTC (7 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.202: +11 -3 lines
Diff to previous 1.202 (colored)

If in the middle of a drag, don't use an invalid key, just use
KEYC_MOUSE as a placeholder. Reported by Artem Fokin.

Revision 1.202 / (download) - annotate - [select for diffs], Thu Nov 24 13:46:50 2016 UTC (7 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.201: +15 -8 lines
Diff to previous 1.201 (colored)

Fix so that we work out the right pane from mouse events - we were doing
so too early, before the mouse event was necessarily valid, so could end
up using the pane from the previous mouse event, or the active pane.

It is important that we use the right pane now that different panes can
have different key tables (for copy mode).

Fixes problem reported by Greg Hurrell.

Revision 1.201 / (download) - annotate - [select for diffs], Wed Nov 23 17:01:24 2016 UTC (7 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.200: +16 -2 lines
Diff to previous 1.200 (colored)

For mouse keys, use the mouse pane as the default current pane.

Revision 1.200 / (download) - annotate - [select for diffs], Wed Nov 16 11:37:16 2016 UTC (7 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.199: +3 -3 lines
Diff to previous 1.199 (colored)

Do not stop dragging when the wheel is pressed, from Artem Fokin.

Revision 1.199 / (download) - annotate - [select for diffs], Tue Nov 15 15:17:28 2016 UTC (7 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.198: +3 -3 lines
Diff to previous 1.198 (colored)

Turn on margins, with a couple of fixes (only limit to the pane for line
feeds, and do not move cursor to end for full width panes).

Revision 1.198 / (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.197: +2 -1 lines
Diff to previous 1.197 (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.197 / (download) - annotate - [select for diffs], Wed Oct 19 09:22:07 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.196: +5 -6 lines
Diff to previous 1.196 (colored)

Alerts are too slow, so rather than walking all sessions and windows,
add a link of winlinks to each window and a pointer to the session to
each winlink. Also rewrite the alerts processing to return to the old
behaviour (alert in any window sets the flag on any winlink).

Revision 1.196 / (download) - annotate - [select for diffs], Sun Oct 16 22:06:40 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.195: +3 -3 lines
Diff to previous 1.195 (colored)

Use the notify name string instead of going via an enum and change
existing hooks to use notifys instead.

Revision 1.195 / (download) - annotate - [select for diffs], Sun Oct 16 19:04:05 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.194: +5 -5 lines
Diff to previous 1.194 (colored)

Mass rename struct cmd_q to struct cmdq_item and related.

Revision 1.194 / (download) - annotate - [select for diffs], Sun Oct 16 17:55:14 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.193: +33 -13 lines
Diff to previous 1.193 (colored)

Rewrite command queue handling. Each client still has a command queue,
but there is also now a global command queue. Instead of command queues
being dispatched on demand from wherever the command happens to be
added, they are now all dispatched from the top level server
loop. Command queues may now also include callbacks as well as commands,
and items may be inserted after the current command as well as at the end.

This all makes command queues significantly more predictable and easier
to use, and avoids the complex multiple nested command queues used by
source-file, if-shell and friends.

A mass rename of struct cmdq to a better name (cmdq_item probably) is
coming.

Revision 1.193 / (download) - annotate - [select for diffs], Wed Oct 12 13:03:27 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.192: +5 -4 lines
Diff to previous 1.192 (colored)

The repeat prompt in both emacs and vi (and the old one in tmux) doesn't
support line editing and instead executes a command as soon as a
non-number key is pressed. Add a -N flag to command-prompt for the same
in copy mode. Reported by Theo Buehler.

Revision 1.192 / (download) - annotate - [select for diffs], Tue Oct 11 09:30:36 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.191: +114 -9 lines
Diff to previous 1.191 (colored)

Support double and triple clicks (they are cumulative, so double is
fired then triple), and use for select-word and select-line in copy
mode. Inspired by a different solution from Omar Sandoval.

Revision 1.191 / (download) - annotate - [select for diffs], Tue Oct 11 07:23:34 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.190: +27 -8 lines
Diff to previous 1.190 (colored)

Fundamental change to how copy mode key bindings work:

The vi-copy and emacs-copy mode key tables are gone, and instead copy
mode commands are bound in one of two normal key tables ("copy-mode" or
"copy-mode-vi"). Keys are bound to "send-keys -X copy-mode-command". So:

    bind -temacs-copy C-Up scroll-up
    bind -temacs-copy -R5 WheelUpPane scroll-up

Becomes:

    bind -Tcopy-mode C-Up send -X scroll-up
    bind -Tcopy-mode WheelUpPane send -N5 -X scroll-up

This allows the full command parser and command set to be used - for
example, we can use the normal command prompt for searching, jumping,
and so on instead of a custom one:

    bind -Tcopy-mode C-r command-prompt -p'search up' "send -X search-backward '%%'"

command-prompt also gets a -1 option to only require on key press, which
is needed for jumping.

The plan is to get rid of mode keys entirely, so more to come eventually.

Revision 1.190 / (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.189: +30 -30 lines
Diff to previous 1.189 (colored)

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

Revision 1.189 / (download) - annotate - [select for diffs], Sun Oct 9 16:24:34 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.188: +3 -11 lines
Diff to previous 1.188 (colored)

Make the CLIENT_STATUS flag imply that pane status lines are redrawn if
they are enabled and break the actual screen generation code into a
separate function. Fixes problems reported by Romain Francoise.

Revision 1.188 / (download) - annotate - [select for diffs], Wed Sep 28 08:30:44 2016 UTC (7 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.187: +37 -5 lines
Diff to previous 1.187 (colored)

Rate limit TIOCSWINSZ on a timer to avoid programs getting hammered with
SIGWINCH when the size changes rapidly. To help a problem reported by
Rui Pinheiro.

Revision 1.187 / (download) - annotate - [select for diffs], Thu Jun 16 10:55:47 2016 UTC (7 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.186: +6 -5 lines
Diff to previous 1.186 (colored)

Allow a command to be specified to display-panes, similar to
command-prompt, rather than always just selecting the pane.

Revision 1.186 / (download) - annotate - [select for diffs], Sat Apr 30 18:59:02 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.185: +2 -5 lines
Diff to previous 1.185 (colored)

tty_client_ready can not be internal to tty.c again.

Revision 1.185 / (download) - annotate - [select for diffs], Fri Apr 29 15:00:48 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.184: +8 -8 lines
Diff to previous 1.184 (colored)

Add option to include status text in the pane borders. If
pane-border-status is set to "top" or "bottom" (rather than "off"),
every pane has a permanent top or bottom border containing the text from
pane-border-format.

Based on a diff sent long ago by Jonathan Slenders, mostly rewritten and
simplified by me.

Revision 1.184 / (download) - annotate - [select for diffs], Thu Apr 28 06:51:56 2016 UTC (8 years ago) by nicm
Branch: MAIN
Changes since 1.183: +4 -3 lines
Diff to previous 1.183 (colored)

After unlock, Update activity time after recalculate_sizes() so that the
session attached flag is correct.

Revision 1.183 / (download) - annotate - [select for diffs], Fri Mar 18 07:28:27 2016 UTC (8 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.182: +12 -12 lines
Diff to previous 1.182 (colored)

Instead of reusing MouseUp at the finish of a drag, add a new key
MouseDragEnd. It can be useful to bind them separately in copy mode.

Revision 1.182 / (download) - annotate - [select for diffs], Tue Mar 1 12:04:43 2016 UTC (8 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.181: +41 -3 lines
Diff to previous 1.181 (colored)

When a mouse drag is finished, fire a MouseUp key press, instead of
doing the drag end in code. From Stephen Coakley.

Revision 1.181 / (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.180: +2 -2 lines
Diff to previous 1.180 (colored)

I no longer use my SourceForge address so replace it.

Revision 1.180 / (download) - annotate - [select for diffs], Wed Dec 16 21:50:37 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.179: +3 -3 lines
Diff to previous 1.179 (colored)

Add infrastructure to work out the best target given a pane or window
alone and use it to add pane_died and pane_exited hooks.

Revision 1.179 / (download) - annotate - [select for diffs], Tue Dec 15 13:43:07 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.178: +3 -3 lines
Diff to previous 1.178 (colored)

Some hooks API changes to fire a hook while waiting another cmdq and
infrastructure that will be needed soon.

Revision 1.178 / (download) - annotate - [select for diffs], Sat Dec 12 18:32:24 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.177: +28 -10 lines
Diff to previous 1.177 (colored)

Add key-table option to set the default key table for a session, allows
different key bindings for different sessions and a few other things.

Revision 1.177 / (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.176: +8 -8 lines
Diff to previous 1.176 (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.176 / (download) - annotate - [select for diffs], Fri Dec 11 12:27:36 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.175: +2 -2 lines
Diff to previous 1.175 (colored)

Add cmdq as an argument to format_create and add a format for the
command name (will also be used for more later).

Revision 1.175 / (download) - annotate - [select for diffs], Tue Dec 8 08:34:18 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.174: +2 -2 lines
Diff to previous 1.174 (colored)

Remove format_create_flags and just pass flags to format_create.

Revision 1.174 / (download) - annotate - [select for diffs], Tue Dec 8 01:10:31 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.173: +16 -1 lines
Diff to previous 1.173 (colored)

Add hooks infrastructure, basic commands (set-hook, show-hooks) and a
couple of not very useful client hooks. This will eventually let
commands be run at various points and on notifications. Joint work with
Thomas Adam.

Revision 1.173 / (download) - annotate - [select for diffs], Tue Dec 1 09:41:03 2015 UTC (8 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.172: +5 -4 lines
Diff to previous 1.172 (colored)

Do not deref wp if window_get_active_at returns NULL which can happen on
very large terminals, from Michael Graczyk.

Revision 1.172 / (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.171: +1 -12 lines
Diff to previous 1.171 (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.171 / (download) - annotate - [select for diffs], Thu Nov 19 22:46:46 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.170: +11 -3 lines
Diff to previous 1.170 (colored)

Only assume pasting with at least two characters, reduces problems for
people who can type ^B c very fast, or who are using tmux inside
something else that buffers.

Revision 1.170 / (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.169: +5 -5 lines
Diff to previous 1.169 (colored)

Use __unused rather than rolling our own.

Revision 1.169 / (download) - annotate - [select for diffs], Sat Nov 14 09:41:06 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.168: +88 -4 lines
Diff to previous 1.168 (colored)

Push stdout and stderr to clients more aggressively, and add an event to
continue if the send fails.

Revision 1.168 / (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.167: +22 -22 lines
Diff to previous 1.167 (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.167 / (download) - annotate - [select for diffs], Wed Nov 11 23:23:33 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.166: +6 -8 lines
Diff to previous 1.166 (colored)

Drop mouse-utf8 option and always turn on UTF-8 mouse if the client says
it supports UTF-8.

Revision 1.166 / (download) - annotate - [select for diffs], Sat Oct 31 13:12:03 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.165: +1 -2 lines
Diff to previous 1.165 (colored)

The output log is only useful once and it means creating a file, so open
it once at startup instead of in every call to tty_open.

Revision 1.165 / (download) - annotate - [select for diffs], Sat Oct 31 08:13:58 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.164: +10 -6 lines
Diff to previous 1.164 (colored)

Because pledge(2) does not allow us to pass directory file descriptors
around, we can't use file descriptors for the working directory because
we will be unable to pass it to a privileged process to tell it where to
read or write files or spawn children. So move tmux back to using
strings for the current working directory. We try to check it exists
with access() when it is set but ultimately fall back to ~ if it fails
at time of use (or / if that fails too).

Revision 1.164 / (download) - annotate - [select for diffs], Wed Oct 28 09:51:55 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.163: +5 -5 lines
Diff to previous 1.163 (colored)

Like options, move the environ struct into environ.c.

Revision 1.163 / (download) - annotate - [select for diffs], Tue Oct 27 15:58:42 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.162: +11 -11 lines
Diff to previous 1.162 (colored)

Move struct options into options.c.

Revision 1.162 / (download) - annotate - [select for diffs], Tue Oct 27 13:23:24 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.161: +100 -146 lines
Diff to previous 1.161 (colored)

Break the common process set up, event loop and imsg dispatch code
between server and client out into a separate internal API. This will
make it easier to add another process.

Revision 1.161 / (download) - annotate - [select for diffs], Mon Oct 26 23:16:18 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.160: +16 -12 lines
Diff to previous 1.160 (colored)

If a mouse event has no key binding, pass it through to the pane it
happened in, not the active pane like normal key presses. Fixes problems
seen by Enrico Ghirardi.

Revision 1.160 / (download) - annotate - [select for diffs], Mon Oct 26 17:17:06 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.159: +3 -1 lines
Diff to previous 1.159 (colored)

Some extra logging of where keys are actually going.

Revision 1.159 / (download) - annotate - [select for diffs], Fri Oct 23 23:46:36 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.158: +2 -2 lines
Diff to previous 1.158 (colored)

Pasting mouse escape sequences is unlikely, so skip them when working
out whether the user is pasting.

Revision 1.158 / (download) - annotate - [select for diffs], Thu Oct 22 11:00:51 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.157: +8 -1 lines
Diff to previous 1.157 (colored)

Log identify messages.

Revision 1.157 / (download) - annotate - [select for diffs], Tue Oct 20 21:12:09 2015 UTC (8 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.156: +6 -6 lines
Diff to previous 1.156 (colored)

Use client pointer not file descriptor in logging.

Revision 1.156 / (download) - annotate - [select for diffs], Tue Oct 20 14:19:27 2015 UTC (8 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.155: +4 -3 lines
Diff to previous 1.155 (colored)

The table could change when retrying so don't save it at start of
server_client_handle_key.

Revision 1.155 / (download) - annotate - [select for diffs], Sun Oct 18 20:42:43 2015 UTC (8 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.154: +5 -4 lines
Diff to previous 1.154 (colored)

Pass current directory as a string rather than a file descriptor because
pledge doesn't let us pass directory file descriptors.

Revision 1.154 / (download) - annotate - [select for diffs], Wed Sep 16 22:24:54 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.153: +2 -2 lines
Diff to previous 1.153 (colored)

Rename cmd_q dead flag to a general flags bitmask (will be more flags later).

Revision 1.153 / (download) - annotate - [select for diffs], Mon Sep 14 10:25:52 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.152: +3 -2 lines
Diff to previous 1.152 (colored)

Make refresh-client force update of jobs, from Sina Siadat.

Revision 1.152 / (download) - annotate - [select for diffs], Tue Sep 1 19:50:09 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.151: +2 -2 lines
Diff to previous 1.151 (colored)

Tweak some error messages/comments.

Revision 1.151 / (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.150: +1 -8 lines
Diff to previous 1.150 (colored)

Some style nits and dead assignments.

Revision 1.150 / (download) - annotate - [select for diffs], Sat Aug 29 08:54:41 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.149: +2 -1 lines
Diff to previous 1.149 (colored)

We already loop over the windows in server_client_loop, so don't do it
again in server_loop just to check names.

Revision 1.149 / (download) - annotate - [select for diffs], Fri Aug 28 13:01:03 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.148: +6 -6 lines
Diff to previous 1.148 (colored)

Make session_update_activity more useful and use it in more places.

Revision 1.148 / (download) - annotate - [select for diffs], Fri Aug 28 12:16:28 2015 UTC (8 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.147: +3 -37 lines
Diff to previous 1.147 (colored)

Run status update on a per-client timer at status-interval.

Revision 1.147 / (download) - annotate - [select for diffs], Wed Jul 29 11:56:02 2015 UTC (8 years, 9 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.146: +1 -3 lines
Diff to previous 1.146 (colored)

status_out and associated data structures are no longer used.

Revision 1.146 / (download) - annotate - [select for diffs], Fri Jul 17 06:53:47 2015 UTC (8 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.145: +2 -1 lines
Diff to previous 1.145 (colored)

Initialize client fd to -1 as well, from Bobby Powers.

Revision 1.145 / (download) - annotate - [select for diffs], Mon Jul 13 15:51:31 2015 UTC (8 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.144: +4 -4 lines
Diff to previous 1.144 (colored)

Fix line endings.

Revision 1.144 / (download) - annotate - [select for diffs], Mon Jul 13 15:49:31 2015 UTC (8 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.143: +4 -3 lines
Diff to previous 1.143 (colored)

Initialize cwd fd to -1 so that we don't close fd 0 if the client is
destroyed before it is changed. Also allow ttyname() to fail. Fixes
problems when running out of file descriptors reported by Bruno Sutic.

Revision 1.143 / (download) - annotate - [select for diffs], Sun Jun 14 10:07:44 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.142: +7 -1 lines
Diff to previous 1.142 (colored)

Add a format for client PID (client_pid) and server PID (pid). Diff for
client_pid from Thomas Adam.

Revision 1.142 / (download) - annotate - [select for diffs], Fri Jun 5 18:06:30 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.141: +4 -4 lines
Diff to previous 1.141 (colored)

Change deref to the more sensible unref, and add a couple I missed before.

Revision 1.141 / (download) - annotate - [select for diffs], Fri Jun 5 18:01:12 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.140: +35 -4 lines
Diff to previous 1.140 (colored)

Instead of putting dead clients on a list and checking it every loop,
use event_once to queue a callback to deal with them. Also dead clients
with references would never actually be freed because the wrap-up
functions (the callback for stdin, or status_prompt_clear) would never
be called. So call them in server_client_lost.

Revision 1.140 / (download) - annotate - [select for diffs], Thu Jun 4 23:27:51 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.139: +22 -1 lines
Diff to previous 1.139 (colored)

Move the nested check from client to server and compare the client tty
name to all the pane pty names instead of comparing socket paths. This
means that "new -d" will work without unsetting $TMUX.

Revision 1.139 / (download) - annotate - [select for diffs], Wed May 27 13:28:04 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.138: +2 -6 lines
Diff to previous 1.138 (colored)

Move the jobs output cache into the formats code so that #() work more
generally (for example, again working in set-titles-string).

Revision 1.138 / (download) - annotate - [select for diffs], Fri May 8 15:56:49 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.137: +1 -6 lines
Diff to previous 1.137 (colored)

Remove some stuff that accidentally ended up here from portable, and
remove a little-used debug function.

Revision 1.137 / (download) - annotate - [select for diffs], Wed May 6 07:52:06 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.136: +18 -8 lines
Diff to previous 1.136 (colored)

Turn cursor off during redraw, pointed out by George Nachman.

Revision 1.136 / (download) - annotate - [select for diffs], Sat Apr 25 18:33:59 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.135: +6 -7 lines
Diff to previous 1.135 (colored)

Make message log a TAILQ.

Revision 1.135 / (download) - annotate - [select for diffs], Fri Apr 24 23:17:11 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.134: +9 -38 lines
Diff to previous 1.134 (colored)

Convert clients list into a TAILQ.

Revision 1.134 / (download) - annotate - [select for diffs], Wed Apr 22 15:30:11 2015 UTC (9 years ago) by nicm
Branch: MAIN
Changes since 1.133: +2 -6 lines
Diff to previous 1.133 (colored)

Change the windows array into an RB tree and fix some places where we
were only looking at the first winlink for a window in a session.

Revision 1.133 / (download) - annotate - [select for diffs], Tue Apr 21 15:21:41 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.132: +2 -2 lines
Diff to previous 1.132 (colored)

Don't eat the mouse event that triggers a drag end because we may want
to pass it on to application inside the pane.

Revision 1.132 / (download) - annotate - [select for diffs], Mon Apr 20 15:34:56 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.131: +95 -63 lines
Diff to previous 1.131 (colored)

Support for multiple key tables to commands to be bound to sequences of
keys. The default key bindings become the "prefix" table and -n the
"root" table. Keys may be bound in new tables with bind -T and
switch-client -T used to specify the table in which the next key should
be looked up. Based on a diff from Keith Amling.

Revision 1.131 / (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.130: +246 -89 lines
Diff to previous 1.130 (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.130 / (download) - annotate - [select for diffs], Sun Apr 19 21:05:27 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.129: +2 -3 lines
Diff to previous 1.129 (colored)

Support setting the default window and pane background colours (window
and active pane via window-style and window-active-style options, an
individual pane by a new select-pane -P flag). From J Raynor.

Revision 1.129 / (download) - annotate - [select for diffs], Tue Mar 31 17:45:10 2015 UTC (9 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.128: +2 -2 lines
Diff to previous 1.128 (colored)

Fix some format specifier nits, from Ben Boeckel.

Revision 1.128 / (download) - annotate - [select for diffs], Fri Feb 6 17:17:12 2015 UTC (9 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.127: +11 -5 lines
Diff to previous 1.127 (colored)

Use formats not status_replace for set-titles-string.

Revision 1.127 / (download) - annotate - [select for diffs], Sun Feb 1 23:43:23 2015 UTC (9 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.126: +2 -2 lines
Diff to previous 1.126 (colored)

Remove two unused arguments from status_replace.

Revision 1.126 / (download) - annotate - [select for diffs], Wed Oct 22 23:18:53 2014 UTC (9 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.125: +3 -3 lines
Diff to previous 1.125 (colored)

Fix some spacing nits.

Revision 1.125 / (download) - annotate - [select for diffs], Thu Oct 2 09:31:30 2014 UTC (9 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.124: +2 -1 lines
Diff to previous 1.124 (colored)

Update status when pane selected with mouse, from Balazs Kezes.

Revision 1.124 / (download) - annotate - [select for diffs], Mon Sep 1 21:50:18 2014 UTC (9 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.123: +2 -2 lines
Diff to previous 1.123 (colored)

Various minor style and spacing nits.

Revision 1.123 / (download) - annotate - [select for diffs], Sat Aug 9 07:33:37 2014 UTC (9 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.122: +2 -2 lines
Diff to previous 1.122 (colored)

Remove support for the continuous reporting "any" mouse mode which never
really worked properly and is rarely used.

Revision 1.122 / (download) - annotate - [select for diffs], Sun Jul 13 20:51:08 2014 UTC (9 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.121: +2 -2 lines
Diff to previous 1.121 (colored)

An EOF is a good reason to close a connection.

ok nicm@

Revision 1.121 / (download) - annotate - [select for diffs], Sun Jul 13 20:23:10 2014 UTC (9 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.120: +4 -1 lines
Diff to previous 1.120 (colored)

If a client is killed while suspended with ^Z so has gone through the
MSG_EXITED dance, don't try to resume it since a) it's pointless and b)
the tty structures have been cleaned up and tmux will crash.

Revision 1.120 / (download) - annotate - [select for diffs], Wed Apr 16 08:02:31 2014 UTC (10 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.119: +6 -1 lines
Diff to previous 1.119 (colored)

Because we pass the file descriptor from client to server, tmux can't
usefully work if stdin is /dev/tty. Complain about it more clearly.

Revision 1.119 / (download) - annotate - [select for diffs], Sun Feb 23 00:53:06 2014 UTC (10 years, 2 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.118: +3 -7 lines
Diff to previous 1.118 (colored)

Change terminal-overrides to a server option (now that we have them), it
doesn't make much sense as a session option.

Revision 1.118 / (download) - annotate - [select for diffs], Mon Feb 17 22:42:20 2014 UTC (10 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.117: +3 -3 lines
Diff to previous 1.117 (colored)

Be consistent and allow only mouse down and mouse wheel for any pane
with mouse-select-pane rather than just in copy mode, reported by Balazs
Kezes.

Revision 1.117 / (download) - annotate - [select for diffs], Fri Feb 14 14:00:18 2014 UTC (10 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (colored)

Make status-interval of zero work as indented.

Revision 1.116 / (download) - annotate - [select for diffs], Fri Feb 14 13:59:01 2014 UTC (10 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.115: +6 -6 lines
Diff to previous 1.115 (colored)

Style nit - no space between function name and bracket.

Revision 1.115 / (download) - annotate - [select for diffs], Fri Jan 31 14:19:24 2014 UTC (10 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.114: +4 -4 lines
Diff to previous 1.114 (colored)

Break up and simplify screen_redraw_screen.

Revision 1.114 / (download) - annotate - [select for diffs], Wed Nov 13 20:43:37 2013 UTC (10 years, 6 months ago) by benno
Branch: MAIN
Changes since 1.113: +4 -2 lines
Diff to previous 1.113 (colored)

from nicm: : handle msgbuf_write() returning EAGAIN

Revision 1.113 / (download) - annotate - [select for diffs], Sun Oct 20 17:28:43 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.112: +7 -4 lines
Diff to previous 1.112 (colored)

Do not run any command line command from the client which starts the
server until after the configuration file completes. This prevents it
racing against run-shell or if-shell in .tmux.conf that run in the
background.

Revision 1.112 / (download) - annotate - [select for diffs], Fri Oct 11 08:07:12 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.111: +3 -1 lines
Diff to previous 1.111 (colored)

Don't leak file descriptors in the rare MSG_VERSION case. From Chris
Johnsen.

Revision 1.111 / (download) - annotate - [select for diffs], Thu Oct 10 12:29:35 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.110: +3 -1 lines
Diff to previous 1.110 (colored)

We accidentally haven't been using $TMUX to work out the session for a
while and in fact it is less useful that using the client ttyname. So
don't bother and don't pass it from the client. If we need it in future
it is in c->environ.

Revision 1.110 / (download) - annotate - [select for diffs], Thu Oct 10 12:27:38 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.109: +4 -4 lines
Diff to previous 1.109 (colored)

Don't look at string[length - 1] if length == 0.

Revision 1.109 / (download) - annotate - [select for diffs], Thu Oct 10 12:26:36 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.108: +84 -41 lines
Diff to previous 1.108 (colored)

Alter how tmux handles the working directory to internally use file
descriptors rather than strings.

- Each session still has a current working directory.

- New sessions still get their working directory from the client that
  created them or its attached session if any.

- New windows are created by default in the session working directory.

- The -c flag to new, neww, splitw allows the working directory to be
  overridden.

- The -c flag to attach let's the session working directory be changed.

- The default-path option has been removed.

To get the equivalent to default-path '.', do:

        bind c neww -c $PWD

To get the equivalent of default-path '~', do:

        bind c neww -c ~

This also changes the client identify protocol to be a set of messages rather
than one as well as some other changes that should make it easier to make
backwards-compatible protocol changes in future.

Revision 1.108 / (download) - annotate - [select for diffs], Thu Oct 10 12:13:56 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.107: +28 -19 lines
Diff to previous 1.107 (colored)

Similarly for MSG_COMMAND - allow full imsg limit not arbitrary 2048.

Revision 1.107 / (download) - annotate - [select for diffs], Thu Oct 10 12:13:29 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.106: +4 -12 lines
Diff to previous 1.106 (colored)

Instead of fixed size buffers for some messages, send only the string
length.

Revision 1.106 / (download) - annotate - [select for diffs], Thu Oct 10 12:12:54 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

retcode -> retval for exit message.

Revision 1.105 / (download) - annotate - [select for diffs], Thu Oct 10 12:12:08 2013 UTC (10 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.104: +6 -6 lines
Diff to previous 1.104 (colored)

Merge IDENTIFY_* flags with CLIENT_* flags.

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

Allow the file descriptor received from the client to be -1.

Revision 1.103 / (download) - annotate - [select for diffs], Sun Jun 23 13:10:46 2013 UTC (10 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.102: +5 -1 lines
Diff to previous 1.102 (colored)

Focus events can cause trouble if left on and they can't be turned off
during idle periods (like the other states are) because we'd miss
events. So add a server option to control them. Defaults to off.

Revision 1.102 / (download) - annotate - [select for diffs], Sun Jun 23 12:51:28 2013 UTC (10 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.101: +8 -3 lines
Diff to previous 1.101 (colored)

Always push a focus event when the application turns it on, prompted by
discussion with Hayaki Saito a while ago.

Revision 1.101 / (download) - annotate - [select for diffs], Sun Apr 21 21:32:00 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.100: +6 -4 lines
Diff to previous 1.100 (colored)

Don't let server_client_check_focus use a dead bufferevent, from Romain
Francoise.

Revision 1.100 / (download) - annotate - [select for diffs], Wed Apr 10 11:51:16 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.99: +2 -12 lines
Diff to previous 1.99 (colored)

Remove some code not needed on OpenBSD.

Revision 1.99 / (download) - annotate - [select for diffs], Wed Mar 27 11:17:12 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.98: +1 -3 lines
Diff to previous 1.98 (colored)

Remove tmux's (already minimal) 88 colour support. Such terminals are
few and unnecessary.

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

Sort includes and fix spaces.

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

Use single stdout and stderr for control clients.

Revision 1.96 / (download) - annotate - [select for diffs], Mon Mar 25 10:03:24 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.95: +3 -1 lines
Diff to previous 1.95 (colored)

Send DSC 1000p at the beginning of a -CC client's lifetime and ST and
the end, from George Nachman.

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

Add resize-pane -Z to temporary zoom the active pane to occupy the full
window or unzoom (restored to the normal layout) if it already zoomed,
bound to C-b z by default. The pane is unzoomed on pretty much any
excuse whatsoever.

We considered making this a new layout but the requirements are quite
different from layouts so decided it is better as a special case. Each
current layout cell is saved, a temporary one-cell layout generated and
all except the active pane set to NULL.

Prompted by suggestions and scripts from several. Thanks to Aaron Jensen
and Thiago Padilha for testing an earlier version.

Revision 1.94 / (download) - annotate - [select for diffs], Sun Mar 24 09:54:10 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.93: +12 -73 lines
Diff to previous 1.93 (colored)

Add a command queue to standardize and simplify commands that call other
commands and allow a command to block execution of subsequent
commands. This allows run-shell and if-shell to be synchronous which has
been much requested.

Each client has a default command queue and commands are consumed one at
a time from it. A command may suspend execution from the queue by
returning CMD_RETURN_WAIT and then resume it by calling cmd_continue() -
for example run-shell does this from the callback that is fired after
the job is freed.

When the command queue becomes empty, command clients are automatically
exited (unless attaching). A callback is also fired - this is used for
nested commands in, for example, if-shell which can block execution of
the client's cmdq until a new cmdq becomes empty.

Also merge all the old error/info/print functions together and lose the
old curclient/cmdclient distinction - a cmdq is bound to one client (or
none if in the configuration file), this is a command client if
c->session is NULL otherwise an attached client.

Revision 1.93 / (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.92: +17 -7 lines
Diff to previous 1.92 (colored)

Handle focus events from the terminal, from Aaron Jensen.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Mar 24 09:25:04 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.91: +34 -2 lines
Diff to previous 1.91 (colored)

Do pane resize ioctls once at the end of the server loop rather than
immediately.

Revision 1.91 / (download) - annotate - [select for diffs], Sun Mar 24 09:18:16 2013 UTC (11 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.90: +47 -3 lines
Diff to previous 1.90 (colored)

Add support for focus notifications when tmux pane changes, based on
work by Aaron Jensen.

Revision 1.90 / (download) - annotate - [select for diffs], Fri Mar 22 15:54:29 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.89: +2 -3 lines
Diff to previous 1.89 (colored)

Need to set clients in context before changing their reference count.

Revision 1.89 / (download) - annotate - [select for diffs], Fri Mar 22 15:50:42 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.88: +1 -3 lines
Diff to previous 1.88 (colored)

Remove unnecessary initializers of cmd_ctx.

Revision 1.88 / (download) - annotate - [select for diffs], Fri Mar 22 15:49:55 2013 UTC (11 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.87: +16 -13 lines
Diff to previous 1.87 (colored)

Add functions to allocate and free command contexts rather than doing it
all on the stack.

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

No more lint means no more ARGSUSED.

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

Add various checks to turn off bits that can't work in control mode
(such as lock).

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

Add a format client_prefix which is 1 if prefix key has been
pressed, used for example #{?client_prefix,X,Y}. Also a few extra
server_client_status needed.

Revision 1.84 / (download) - annotate - [select for diffs], Wed Jan 30 17:00:17 2013 UTC (11 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.83: +2 -2 lines
Diff to previous 1.83 (colored)

Unused variable/type nit from Thomas Adam.

Revision 1.83 / (download) - annotate - [select for diffs], Fri Jan 18 02:10:29 2013 UTC (11 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.82: +4 -4 lines
Diff to previous 1.82 (colored)

Style nits - return (x) not return x.

Revision 1.82 / (download) - annotate - [select for diffs], Tue Jan 15 22:55:29 2013 UTC (11 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.81: +41 -15 lines
Diff to previous 1.81 (colored)

If timing between keys is less than (by default) 1 millisecond, assume
the text is being pasted. assume-paste-time option changes the value (0
disables). Based on a diff from Marcin Kulik.

Revision 1.81 / (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.80: +31 -39 lines
Diff to previous 1.80 (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.80 / (download) - annotate - [select for diffs], Thu Sep 27 10:02:56 2012 UTC (11 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.79: +5 -3 lines
Diff to previous 1.79 (colored)

Do not leak file descriptor if not a tty, reported by Sebastien Marie.

Revision 1.79 / (download) - annotate - [select for diffs], Mon Sep 3 09:32:38 2012 UTC (11 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.78: +5 -1 lines
Diff to previous 1.78 (colored)

Send notifications to control clients. Also don't redraw client when
suspended.

Revision 1.78 / (download) - annotate - [select for diffs], Wed Jul 11 07:10:15 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2
Changes since 1.77: +10 -2 lines
Diff to previous 1.77 (colored)

Make command exec functions return an enum rather than -1/0/1 values and
add a new value to mean "leave client running but don't attach" to fix
problems with using some commands in a command sequence. Most of the
work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.

Revision 1.77 / (download) - annotate - [select for diffs], Tue Jul 10 11:53:01 2012 UTC (11 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.76: +10 -16 lines
Diff to previous 1.76 (colored)

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

Revision 1.76 / (download) - annotate - [select for diffs], Wed Jun 20 12:55:55 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.75: +1 -3 lines
Diff to previous 1.75 (colored)

Remove a couple of unused variables from redbrain at gcc dot gnu dot org.

Revision 1.75 / (download) - annotate - [select for diffs], Mon Jun 18 13:16:42 2012 UTC (11 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.74: +15 -1 lines
Diff to previous 1.74 (colored)

Add a skeleton mode to tmux (called "control mode") that let's tmux
commands be sent and output received on stdout. This can be used to
integrate with other terminal emulators and should allow some other
things to be made simpler later. More to come so doesn't do much yet and
deliberately not documented.

Revision 1.74 / (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.73: +6 -10 lines
Diff to previous 1.73 (colored)

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

Revision 1.73 / (download) - annotate - [select for diffs], Mon May 21 18:27:42 2012 UTC (12 years ago) by nicm
Branch: MAIN
Changes since 1.72: +39 -122 lines
Diff to previous 1.72 (colored)

Instead of passing stdin/stdout/stderr file descriptors over imsg and
handling them in the server, handle them in the client and pass buffers
over imsg. This is much tidier for some upcoming changes and the
performance hit isn't critical.

The tty fd is still passed to the server as before.

This bumps the tmux protocol version so new clients and old servers are
incompatible.

Revision 1.72 / (download) - annotate - [select for diffs], Sun May 6 07:38:17 2012 UTC (12 years ago) by nicm
Branch: MAIN
Changes since 1.71: +20 -1 lines
Diff to previous 1.71 (colored)

Add a helper function to open the terminal for attach-/new-session.

Revision 1.71 / (download) - annotate - [select for diffs], Wed Apr 11 06:16:14 2012 UTC (12 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.70: +3 -1 lines
Diff to previous 1.70 (colored)

Stop accepting new clients for 1 second on EMFILE/ENFILE. Based on
ongoing fixes to other daemons by Theo.

Revision 1.70 / (download) - annotate - [select for diffs], Sat Mar 17 21:34:34 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.69: +4 -1 lines
Diff to previous 1.69 (colored)

Need to call recalculate_sizes() when changing window with the mouse,
from marcel partap.

Revision 1.69 / (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.68: +7 -4 lines
Diff to previous 1.68 (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.68 / (download) - annotate - [select for diffs], Fri Mar 9 21:42:13 2012 UTC (12 years, 2 months ago) by nicm
Branch: MAIN
Changes since 1.67: +1 -2 lines
Diff to previous 1.67 (colored)

Remove some bits leftover from unused backoff code.

Revision 1.67 / (download) - annotate - [select for diffs], Thu Feb 2 00:04:54 2012 UTC (12 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_1_BASE, OPENBSD_5_1
Changes since 1.66: +3 -1 lines
Diff to previous 1.66 (colored)

Do not change pane when changing window with mouse on status line,
pointed out by Romain Francoise.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Jan 29 09:37:02 2012 UTC (12 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.65: +68 -41 lines
Diff to previous 1.65 (colored)

Add an option to move the status line to the top of the screen,
requested by many.

Revision 1.65 / (download) - annotate - [select for diffs], Sun Jan 29 02:22:11 2012 UTC (12 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.64: +7 -7 lines
Diff to previous 1.64 (colored)

Call bufferevent_free before closing file descriptor associated with it
or bugs in $EventMechanism on $OtherOS makes libevent get it's knickers
in a twist. From Dylan Alex Simon.

Revision 1.64 / (download) - annotate - [select for diffs], Sat Jan 21 23:51:34 2012 UTC (12 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.63: +1 -45 lines
Diff to previous 1.63 (colored)

Remove unused backoff code that doesn't do any good.

Revision 1.63 / (download) - annotate - [select for diffs], Sat Jan 21 08:40:09 2012 UTC (12 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.62: +7 -11 lines
Diff to previous 1.62 (colored)

Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.

Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.

People who want three prefix keys are out of luck :-).

Revision 1.62 / (download) - annotate - [select for diffs], Sat Dec 24 08:26:59 2011 UTC (12 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.61: +3 -1 lines
Diff to previous 1.61 (colored)

Fix so that when mouse-select-pane and mouse-select-window are both
enabled, clicking on the status line does not change the current
pane. From Romain Francoise.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Aug 20 20:37:30 2011 UTC (12 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.60: +3 -1 lines
Diff to previous 1.60 (colored)

Fix a couple of memory leaks, from marcel partap.

Revision 1.60 / (download) - annotate - [select for diffs], Fri Jul 8 21:51:40 2011 UTC (12 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_0_BASE, OPENBSD_5_0
Changes since 1.59: +4 -1 lines
Diff to previous 1.59 (colored)

Do not continue to send data to suspended/locked clients or there will
be a huge rush of it after they are resumed/unlocked. The main output
path was fine but status line updates and the terminal state reset code
were missed.

Revision 1.59 / (download) - annotate - [select for diffs], Fri May 20 19:03:58 2011 UTC (13 years ago) by nicm
Branch: MAIN
Changes since 1.58: +2 -2 lines
Diff to previous 1.58 (colored)

Support xterm(1) cursor colour change sequences through terminfo(5) Cc
(set) and Cr (reset) extensions. Originally by Sean Estabrooks, tweaked
by me and Ailin Nemui.

Revision 1.58 / (download) - annotate - [select for diffs], Sun May 8 20:45:35 2011 UTC (13 years ago) by nicm
Branch: MAIN
Changes since 1.57: +3 -2 lines
Diff to previous 1.57 (colored)

Only select pane on click, not drag. From hsim at gmx.li.

Revision 1.57 / (download) - annotate - [select for diffs], Sun May 8 20:34:12 2011 UTC (13 years ago) by nicm
Branch: MAIN
Changes since 1.56: +18 -2 lines
Diff to previous 1.56 (colored)

Add a new option, mouse-resize-pane. When on, panes may be resized by
dragging their borders. From hsim at gmx.li.

Revision 1.56 / (download) - annotate - [select for diffs], Wed May 4 18:10:28 2011 UTC (13 years ago) by nicm
Branch: MAIN
Changes since 1.55: +17 -4 lines
Diff to previous 1.55 (colored)

Change window with mouse wheel over status line if mouse-select-window
is on, from marcel partap.

Revision 1.55 / (download) - annotate - [select for diffs], Wed May 4 17:40:32 2011 UTC (13 years ago) by nicm
Branch: MAIN
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored)

Check if mouse-select-pane is ON not off when setting mouse flags,
reported by oga.

Revision 1.54 / (download) - annotate - [select for diffs], Tue Apr 19 21:31:33 2011 UTC (13 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.53: +18 -10 lines
Diff to previous 1.53 (colored)

When mode-mouse is on (it is off by default), automatically enter copy
mode when the mouse is dragged or the mouse wheel is used. Also exit
copy mode when the mouse wheel is scrolled off the bottom. Discussed
with and written by hsim at gmx dot li.

Revision 1.53 / (download) - annotate - [select for diffs], Mon Apr 18 19:49:05 2011 UTC (13 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.52: +11 -1 lines
Diff to previous 1.52 (colored)

Add an option (mouse-select-window) which allows the mouse to be used by
clicking on the status line, written by hsim at gmx dot li.

Revision 1.52 / (download) - annotate - [select for diffs], Tue Mar 29 19:30:16 2011 UTC (13 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.51: +2 -2 lines
Diff to previous 1.51 (colored)

Change -t on display-message to be target-pane for the #[A-Z]
replacements and add -c as target-client.

Revision 1.51 / (download) - annotate - [select for diffs], Wed Jan 26 01:54:56 2011 UTC (13 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.50: +6 -6 lines
Diff to previous 1.50 (colored)

Simplify the way jobs work and drop the persist type, so all jobs are
fire-and-forget.

Status jobs now managed with two trees of output (new and old), rather
than storing the output in the jobs themselves. When the status line is
processed any jobs which don't appear in the new tree are started and
the output from the old tree displayed. When a job finishes it updates
the new tree with its output and that is used for any subsequent
redraws. When the status interval expires, the new tree is moved to the
old so that all jobs are run again.

This fixes the "#(echo %H:%M:%S)" problem which would lead to thousands
of identical persistent jobs and high memory use (this can still be
achieved by adding "sleep 30" but that is much less likely to happen by
accident).

Revision 1.50 / (download) - annotate - [select for diffs], Sat Jan 15 00:46:19 2011 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.49: +7 -2 lines
Diff to previous 1.49 (colored)

Only set a mouse mode for mouse-select-pane if none already set by the
mode (any will do).

Revision 1.49 / (download) - annotate - [select for diffs], Sat Jan 8 01:52:36 2011 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.48: +17 -17 lines
Diff to previous 1.48 (colored)

Move all calls to fcntl(...O_NONBLOCK) into a function and clear the
flag on the stdio file descriptors before closing them (fixes things
like "tmux ls && cat").

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jan 3 23:35:21 2011 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.47: +16 -1 lines
Diff to previous 1.47 (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.47 / (download) - annotate - [select for diffs], Sat Jan 1 01:12:09 2011 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.46: +3 -6 lines
Diff to previous 1.46 (colored)

Don't reset the activity timer for unattached sessions every second,
this screws up the choice of most-recently-used. Instead, break the time
update into a little function and do it when the session is attached.

Pointed out by joshe@.

Revision 1.46 / (download) - annotate - [select for diffs], Wed Dec 29 21:49:06 2010 UTC (13 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

Support all four of the xterm mouse modes. Based on a diff from hsim at
gmx.li.

Revision 1.45 / (download) - annotate - [select for diffs], Mon Dec 20 00:17:22 2010 UTC (13 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored)

Use pointer rather than index for the client's last session.

Revision 1.44 / (download) - annotate - [select for diffs], Sat Dec 11 18:39:25 2010 UTC (13 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.43: +2 -1 lines
Diff to previous 1.43 (colored)

Track the last session for a client and add a flag to switch-client and
a key binding (L) to move a client back to its last session.

Revision 1.43 / (download) - annotate - [select for diffs], Sat Dec 11 16:05:57 2010 UTC (13 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.42: +1 -6 lines
Diff to previous 1.42 (colored)

Make the prompt history global for all clients which is much more useful than per-client history.

Revision 1.42 / (download) - annotate - [select for diffs], Sat Oct 16 08:31:55 2010 UTC (13 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.41: +1 -9 lines
Diff to previous 1.41 (colored)

Trying to set FD_CLOEXEC on every fd is a lost cause, just use
closefrom() before exec.

Revision 1.37.2.1 / (download) - annotate - [select for diffs], Sat Oct 2 03:06:00 2010 UTC (13 years, 7 months ago) by william
Branch: OPENBSD_4_8
Changes since 1.37: +5 -7 lines
Diff to previous 1.37 (colored) next main 1.38 (colored)

MFC:

- - -
revision 1.39
date: 2010/08/19 17:20:26;  author: nicm;  state: Exp;  lines: +5 -7
Do not need to dup() the tty fd sent from the client because it is
already dup()d again later. Fixes a leak seen by espie@.
- - -

from nicm re PR 6458
ok deraadt

Revision 1.41 / (download) - annotate - [select for diffs], Sun Sep 26 20:43:30 2010 UTC (13 years, 7 months ago) by nicm
Branch: MAIN
Changes since 1.40: +2 -1 lines
Diff to previous 1.40 (colored)

Two new options:

- server option "exit-unattached" makes the server exit when no clients
  are attached, even if sessions are present;

- session option "destroy-unattached" destroys a session once no clients
  are attached to it.

These are useful for preventing tmux remaining in the background where
it is undesirable and when using tmux as a login shell to keep a limit
on new sessions.

Revision 1.40 / (download) - annotate - [select for diffs], Tue Aug 31 22:46:59 2010 UTC (13 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (colored)

Add missing prototype.

Revision 1.39 / (download) - annotate - [select for diffs], Thu Aug 19 17:20:26 2010 UTC (13 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.38: +5 -7 lines
Diff to previous 1.38 (colored)

Do not need to dup() the tty fd sent from the client because it is
already dup()d again later. Fixes a leak seen by espie@.

Revision 1.38 / (download) - annotate - [select for diffs], Wed Aug 11 07:34:43 2010 UTC (13 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.37: +49 -1 lines
Diff to previous 1.37 (colored)

Change the way backoff works. Instead of stopping reading from the pty
when the client tty backs up too much, just stop updating the tty and
only update the internal screen. Then when the tty recovers, force a
redraw.

This prevents a dodgy client from causing other clients to go into
backoff while still allowing tmux to be responsive (locally) when seeing
lots of output.

Revision 1.37 / (download) - annotate - [select for diffs], Wed Jul 28 22:15:15 2010 UTC (13 years, 9 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE
Branch point for: OPENBSD_4_8
Changes since 1.36: +16 -14 lines
Diff to previous 1.36 (colored)

dup() the stdin fd so it isn't closed twice (once for stdin, once for tty).

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jul 24 20:11:59 2010 UTC (13 years, 9 months ago) by nicm
Branch: MAIN
Changes since 1.35: +139 -43 lines
Diff to previous 1.35 (colored)

When changing so that the client passes its stdout and stderr as well as
stdin up to the server, I forgot one essential point - the tmux server
could now be both the producer and consumer. This happens when tmux is
run inside tmux, as well as when piping tmux commands together.

So, using stdio(3) was a bad idea - if sufficient data was written, this
could block in write(2). When that happened and the server was both
producer and consumer, it deadlocks.

Change to use libevent bufferevents for the client stdin, stdout and
stderr instead. This is trivial enough for output but requires a
callback mechanism to trigger when stdin is finished.

This relies on the underlying polling mechanism for libevent to work
with whatever devices to which the user could redirect stdin, stdout or
stderr, hence the change to use poll(2) over kqueue(2) for tmux.

Revision 1.35 / (download) - annotate - [select for diffs], Mon Jul 19 18:27:38 2010 UTC (13 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

Send the \n to stdout with the message, not stderr... doh.

Revision 1.34 / (download) - annotate - [select for diffs], Sun Jul 11 17:06:45 2010 UTC (13 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.33: +14 -8 lines
Diff to previous 1.33 (colored)

Return the command client return code with MSG_EXIT now that MSG_ERROR and
MSG_PRINT are unused.

New clients should be compatible with old tmux servers but vice versa may print
an error.

Revision 1.33 / (download) - annotate - [select for diffs], Mon Jun 28 22:10:42 2010 UTC (13 years, 10 months ago) by nicm
Branch: MAIN
Changes since 1.32: +54 -14 lines
Diff to previous 1.32 (colored)

Send all three of stdin, stdout, stderr from the client to the server, so that
commands can directly make use of them. This means that load-buffer and
save-buffer can have "-" as the file to read from stdin or write to stdout.

This is a protocol version bump so the tmux server will need to be restarted
after upgrade (or an older client used).

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

Fix problems with window sizing seen by Raghavendra D Prabhu when
starting tmux from .xinitrc.

One of the very few things the server relies on the client for now is to
pass through a message on SIGWINCH, but there is a condition where
potentially a SIGWINCH may be lost during the transition from unattached
(main.c) to attached (client.c). So trigger a size change immediately
after the client installs its SIGWINCH handler.

Also, when the terminal is resized, reset the scroll region and cursor
position. Previously, we were clearing our saved idea of these, but in
fact some terminals do not reset them on resize, so this caused problems
during redraw.

While here make a resize to the same size not cause a redraw and rename
the tmux.out output log file to include the tmux PID.

Revision 1.31 / (download) - annotate - [select for diffs], Sun May 23 19:42:19 2010 UTC (13 years, 11 months ago) by nicm
Branch: MAIN
Changes since 1.30: +5 -5 lines
Diff to previous 1.30 (colored)

Pass in the session, rather than the client, to window modes' key()
function. We were only ever using the client to find the session anyway.

This allows send-key to work properly for manipulating copy mode from
outside tmux.

From Micah Cowan.

Revision 1.30 / (download) - annotate - [select for diffs], Sat Feb 6 22:55:31 2010 UTC (14 years, 3 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.29: +17 -10 lines
Diff to previous 1.29 (colored)

Support attaching a client read-only with a new -r flag to the attach-session
command.

Revision 1.29 / (download) - annotate - [select for diffs], Sat Feb 6 18:47:41 2010 UTC (14 years, 3 months ago) by nicm
Branch: MAIN
Changes since 1.28: +1 -12 lines
Diff to previous 1.28 (colored)

Change nested check to compare server socket path rather than just assuming
that if $TMUX is set it is nested. From Micah Cowan.

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jan 8 09:14:15 2010 UTC (14 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.27: +2 -1 lines
Diff to previous 1.27 (colored)

mouse-select-pane has to redraw the borders now too.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Jan 3 12:51:05 2010 UTC (14 years, 4 months ago) by nicm
Branch: MAIN
Changes since 1.26: +8 -5 lines
Diff to previous 1.26 (colored)

Options to set the colour of the pane borders, with different colours for the
active pane.

Revision 1.26 / (download) - annotate - [select for diffs], Thu Dec 10 09:16:52 2009 UTC (14 years, 5 months ago) by nicm
Branch: MAIN
Changes since 1.25: +2 -2 lines
Diff to previous 1.25 (colored)

Add "server options" which are server-wide and not bound to a session or
window. Set and displayed with "set -s" and "show -s".

Currently the only option is "quiet" (like command-line -q, allowing it to be
set from .tmux.conf), but others will come along.

Revision 1.25 / (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.24: +9 -9 lines
Diff to previous 1.24 (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.24 / (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.23: +2 -1 lines
Diff to previous 1.23 (colored)

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

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

Two new options, window-status-format and window-status-current-format, which
allow the format of each window in the status line window list to be controlled
using similar # sequences as status-left/right.

This diff also moves part of the way towards UTF-8 support in window names but
it isn't quite there yet.

Revision 1.22 / (download) - annotate - [select for diffs], Thu Nov 19 10:22:06 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.21: +2 -2 lines
Diff to previous 1.21 (colored)

Don't interpret #() for display-message, it usually doesn't make sense and may
leak commands.

Revision 1.21 / (download) - annotate - [select for diffs], Wed Nov 18 13:16:33 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.20: +9 -2 lines
Diff to previous 1.20 (colored)

Add a per-client log of status line messages displayed while that client
exists. A new message-limit session option sets the maximum number of entries
and a command, show-messages, shows the log (bound to ~ by default).

This (and prompt history) might be better as a single global log but until
there are global options it is easier for them to be per client.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Nov 13 18:13:18 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.19: +7 -4 lines
Diff to previous 1.19 (colored)

Tidy up and fix some types, prompted by lint via deraadt.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Nov 11 08:00:42 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored)

Only need to chmod +x or -x the socket when a client is created, lost or
attached, rather than every event loop.

Revision 1.18 / (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.17: +143 -139 lines
Diff to previous 1.17 (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.17 / (download) - annotate - [select for diffs], Thu Nov 5 00:05:00 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.16: +22 -11 lines
Diff to previous 1.16 (colored)

Convert the key repeat timer to an event.

Revision 1.16 / (download) - annotate - [select for diffs], Wed Nov 4 23:42:51 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.15: +41 -41 lines
Diff to previous 1.15 (colored)

Move status timer check into the global once-per-second timer, this could maybe
be done better but one every second is better than once every 50 ms.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Nov 4 23:29:42 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.14: +4 -7 lines
Diff to previous 1.14 (colored)

Use timeout events for the identify and message timers.

Revision 1.14 / (download) - annotate - [select for diffs], Wed Nov 4 23:12:43 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.13: +4 -26 lines
Diff to previous 1.13 (colored)

Don't reenlist the client imsg event every loop, instead have a small function
to it and call it after the event triggers or after a imsg is added.

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: +2 -23 lines
Diff to previous 1.12 (colored)

Switch tty fds over to a bufferevent.

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

Initial changes to move tmux to libevent.

This moves the client-side loops are pretty much fully over to event-based only
(tmux.c and client.c) but server-side (server.c and friends) treats libevent as
a sort of clever poll, waking up after every event to run various things.

Moving the server stuff over to bufferevents and timers and so on will come
later.

Revision 1.11 / (download) - annotate - [select for diffs], Tue Nov 3 22:40:40 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.10: +10 -4 lines
Diff to previous 1.10 (colored)

Add an activity time for clients, like for sessions, and change session and
client lookup to pick the most recently used rather than the most recently
created - this is much more useful when used interactively and (because the
activity time is set at creation) should have no effect on source-file.

Based on a problem reported by Jan Johansson.

Revision 1.10 / (download) - annotate - [select for diffs], Tue Nov 3 20:29:47 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.9: +19 -18 lines
Diff to previous 1.9 (colored)

Change session and client activity and creation time members to have more
meaningful names.

Also, remove the code to try and update the session activity time for the
command client when a command message is received as is pointless because it
des not have a session.

Revision 1.9 / (download) - annotate - [select for diffs], Tue Oct 27 13:03:33 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.8: +31 -1 lines
Diff to previous 1.8 (colored)

Move the poll registration functions into the server-*.c files.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Oct 26 21:42:04 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
Changes since 1.7: +3 -3 lines
Diff to previous 1.7 (colored)

tabs are better; ok nicm

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

Don't do anything in the client callback if the client has already died to
avoid a use-after-free (the callback is used twice, once for the client itself
and once for the tty). Fixes crashes seen by Han Boetes.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Oct 25 22:00:15 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.5: +5 -4 lines
Diff to previous 1.5 (colored)

Don't try to continue processing a client if the session has been destroyed.

Revision 1.5 / (download) - annotate - [select for diffs], Sun Oct 25 21:11:21 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.4: +1 -3 lines
Diff to previous 1.4 (colored)

Remove the -d flag to tmux and just use op/AX to detect default colours.

Irritatingly, although op can be used to tell if a terminal supports default
colours, it can't be used to set them because in some terminfo descriptions it
resets attributes as a side-effect (acts as sgr0) and in others it doesn't, so
it is not possible to determine reliably what the terminal state will be
afterwards. So if AX is missing and op is present, tmux just sends sgr0.

Anyone using -d for a terminal who finds they actually needed it can replace it
using terminal-overrides, but please let me know as it is probably an omission
from terminfo.

Revision 1.4 / (download) - annotate - [select for diffs], Sun Oct 25 17:51:07 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.3: +2 -1 lines
Diff to previous 1.3 (colored)

+time.h.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Oct 22 21:01:52 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.2: +3 -3 lines
Diff to previous 1.2 (colored)

Redraw checks have to after handling input or pane redraw flags set by key
presses will not be acted on.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Oct 22 20:04:21 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN
Changes since 1.1: +37 -36 lines
Diff to previous 1.1 (colored)

The client buffers have to be checked after every event in order to catch the
escape timers and properly reset the cursor.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Oct 22 19:41:51 2009 UTC (14 years, 6 months ago) by nicm
Branch: MAIN

Split the server code handling clients, jobs and windows off into separate
files from server.c (merging server-msg.c into the client file) and rather than
iterating over each set after poll(), allow a callback to be specified when the
fd is added and just walk once over the returned pollfds calling each callback
where needed.

More to come, getting this in so it is tested.

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.