Commit Graph

2331 Commits

Author SHA1 Message Date
Thomas Adam
c0d9eaff9b Merge branch 'obsd-master' 2020-07-04 16:01:20 +01:00
nicm
1e42689661 kill-window -a cannot just walk the list of windows because if
renumber-windows is on, the window it wants to keep could be moved.
Change to renumber afterwards and also behave better if the window is
linked into the session twice. GitHub issue 2287.
2020-07-04 14:24:02 +00:00
Thomas Adam
6c437d45ac Merge branch 'obsd-master' 2020-06-18 12:01:22 +01:00
nicm
2372b0fdc6 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.
2020-06-18 08:34:22 +00:00
Thomas Adam
eb448daa1a Merge branch 'obsd-master' 2020-06-16 10:01:21 +01:00
nicm
1bf9555e4f d and D keys to reset to default in customize mode. 2020-06-16 08:18:34 +00:00
Thomas Adam
824efe7be4 Merge branch 'obsd-master' 2020-06-13 12:01:20 +01:00
nicm
1c78155e70 Add -b flags to insert a window before (like the existing -a for after)
to break-pane, move-window, new-window. GitHub issue 2261.
2020-06-13 09:05:53 +00:00
Thomas Adam
b5c86fdc0c Merge branch 'obsd-master' 2020-06-11 22:01:23 +01:00
nicm
63c2ed1483 Add some formats for search in copy mode (search_present, search_match).
GitHub issue 2268.
2020-06-11 19:43:34 +00:00
Thomas Adam
e8c99496cd Merge branch 'obsd-master' 2020-06-11 12:01:19 +01:00
nicm
50ee41423f Add a -A option to pause a pane manually. 2020-06-11 09:55:47 +00:00
Thomas Adam
ea4425b9bd Merge branch 'obsd-master' 2020-06-10 10:01:20 +01:00
nicm
23d79cfda8 Instead of a buffer size limit on each pane, set a limit of 300 seconds
of data for each client in control mode.
2020-06-10 07:27:10 +00:00
Thomas Adam
92c8cc17c3 Merge branch 'obsd-master' 2020-06-05 14:01:19 +01:00
nicm
d919fa1ed0 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.
2020-06-05 11:20:51 +00:00
Thomas Adam
47a5afe5bf Merge branch 'obsd-master' 2020-06-05 12:01:18 +01:00
nicm
c908d2039f Fix various confusion about am vs xenl. 2020-06-05 09:32:15 +00:00
Thomas Adam
a06cf900c7 Merge branch 'obsd-master' 2020-06-05 10:01:22 +01:00
nicm
c586208991 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.
2020-06-05 07:33:57 +00:00
Thomas Adam
62c0617d79 Merge branch 'obsd-master' 2020-06-03 00:01:20 +01:00
Thomas Adam
3d5decb305 Merge branch 'obsd-master' 2020-06-02 22:01:20 +01:00
nicm
4694e9a2b6 Move the code to set up a padding cell into grid.c. 2020-06-02 20:51:46 +00:00
nicm
2a4d4bda2b Allow UTF-8 characters of width 0 to be stored, it is useful to be able
to put padding cells in as width 0.
2020-06-02 20:10:23 +00:00
Thomas Adam
31a51cae1d Merge branch 'obsd-master' 2020-06-02 11:29:48 +01:00
nicm
f3931497f8 Use CLOCK_MONOTONIC for timer measurement and add a timestamp to control
mode %output blocks.
2020-06-02 08:17:27 +00:00
nicm
9819470058 Change format callback to return value rather than storing it in the entry. 2020-06-01 19:39:25 +00:00
Thomas Adam
91e40de2da Merge branch 'obsd-master' 2020-06-01 12:01:20 +01:00
nicm
a54a88edd6 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.
2020-06-01 09:43:00 +00:00
Thomas Adam
a4cb700269 Merge branch 'obsd-master' 2020-05-26 14:02:15 +01:00
nicm
ea610a3119 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.
2020-05-26 08:41:47 +00:00
Thomas Adam
967e5f8be3 Merge branch 'obsd-master' 2020-05-26 08:42:55 +01:00
nicm
6f03e49e68 Use the internal representation for UTF-8 keys instead of wchar_t and
drop some code only needed for that.
2020-05-25 18:57:24 +00:00
nicm
49ec074271 Tidy up new UTF-8 code and make it more generic. 2020-05-25 18:19:29 +00:00
Thomas Adam
b34af611a5 Merge branch 'obsd-master' 2020-05-25 18:01:20 +01:00
nicm
bbfb44e9b2 Make some data types consistent. 2020-05-25 15:02:25 +00:00
Thomas Adam
bb5a1925ab Merge branch 'obsd-master' 2020-05-25 12:01:19 +01:00
nicm
3a5219c6d0 Instead of storing all UTF-8 characters in the extended cell which means
that 14 bytes are wasted for each character in the BMP, only store
characters of three bytes or less in the cell itself and store others
(outside the BMP or with combining characters) in a separate global
tree. Can reduce grid memory use for heavy Unicode users by around 30%.
2020-05-25 09:32:10 +00:00
Thomas Adam
aeefd585a0 Merge branch 'obsd-master' 2020-05-24 12:01:21 +01:00
nicm
18aab90959 Give control code its own state struct. 2020-05-24 09:40:17 +00:00
nicm
6c82982711 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.
2020-05-24 09:13:06 +00:00
Thomas Adam
d48f0e114e Merge branch 'obsd-master' 2020-05-22 13:40:33 +01:00
nicm
9a0763c3a0 Move client offset stuff into control.c since only control clients will
need it.
2020-05-22 11:07:04 +00:00
Thomas Adam
40126ee96c Merge branch 'obsd-master' 2020-05-21 08:55:31 +01:00
nicm
31e3f2d530 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.
2020-05-21 07:24:13 +00:00
nicm
574a9e4b6c 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.
2020-05-16 16:50:55 +00:00
nicm
e2a26740b9 Add an option to set the pane border lines style from a choice of single
lines (ACS or UTF-8), double or heavy (UTF-8), simple (plain ASCII) or
number (the pane numbers). Lines that won't work on a non-UTF-8 terminal
are translated back into ACS when they are output.
2020-05-16 16:26:34 +00:00
nicm
ecbdcc256f Add screen write flags instead of individual bits and fix line length
calculation with padding.
2020-05-16 16:22:01 +00:00
nicm
303d342d5f 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.
2020-05-16 16:20:59 +00:00
nicm
c914abfa19 Expand target from client and use it to expand the prompt. 2020-05-16 16:16:07 +00:00
nicm
72984c4834 Move editor stuff to common code in popup.c. 2020-05-16 16:13:09 +00:00
nicm
dceb6a15d0 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.
2020-05-16 16:07:55 +00:00
nicm
d67245c734 Add a customize mode where keys and options may be browsed and changed,
includes adding a brief description of each option. Bound to "C" by
default.
2020-05-16 16:02:24 +00:00
nicm
472d77fd0f Support embedded styles in the display-message message, GitHub issue
2206.
2020-05-16 15:54:20 +00:00
nicm
6ea6d46d0a Store and restore cursor position when copy mode is resized, from
Anindya Mukherjee.
2020-05-16 15:49:20 +00:00
nicm
367b4e4e0f Change message log to be per server rather than per client and include
every command that is run.
2020-05-16 15:47:22 +00:00
nicm
cf9baddd6f 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.
2020-05-16 15:45:29 +00:00
nicm
beb214bcb3 Add formats for after hook command arguments. 2020-05-16 15:40:04 +00:00
nicm
9605b080f6 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.
2020-05-16 15:34:08 +00:00
nicm
379ca54c80 Rename and tidy some stuff in struct tty_ctx. 2020-05-16 15:27:08 +00:00
nicm
78595457f9 Add 'e' key in buffer mode to open the buffer in an editor. 2020-05-16 15:24:28 +00:00
nicm
463864f5a2 Add -W and -T flags to command-prompt to only complete a window and a
target, also complete aliases.
2020-05-16 15:16:36 +00:00
nicm
2391fe23ab Copy mode search improvements:
- Add styles for the search marking styles (copy-mode-match-style and
  copy-mode-current-match-style).

- Show the current match (the one with the cursor on it) in a different style.

- Copying without a selection will copy the current match if there is one.
2020-05-16 15:11:52 +00:00
nicm
80e52545a0 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.
2020-05-16 15:06:03 +00:00
nicm
f03b61131b Drop having a separate type for style options and make them all strings,
which allows formats to be expanded. Any styles without a '#{' are still
validated when they are set but any with a '#{' are not. Formats are not
expanded usefully in many cases yet, that will be changed later.

To make this work, a few other changes:

- set-option -a with a style option automatically appends a ",".

- OSC 10 and 11 don't set the window-style option anymore, instead the
  fg and bg are stored in the pane struct and act as the defaults that
  can be overridden by window-style.

- status-fg and -bg now override status-style instead of trying to keep
  them in sync.
2020-05-16 15:01:30 +00:00
nicm
5bf96c2f2c Use a grid cell not a style for the pane style. 2020-05-16 14:53:23 +00:00
nicm
a29196ca6a Build list of paths and weed out duplicates before loading configs, and
add TMUX_SOCK like TMUX_PATH for the socket directory.
2020-05-16 14:26:33 +00:00
nicm
4e0a718666 Add extension terminfo(5) capabilities for margins. 2020-05-16 14:22:51 +00:00
nicm
9dd58470e4 Remove support for iTerm2's DSR 1337 extension and use the CSI > q
extension now supported by a few different terminals.
2020-05-16 14:16:25 +00:00
Nicholas Marriott
57fe03dc5a 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.
2020-05-16 14:57:36 +01:00
Nicholas Marriott
c364a7142c Only forward extended keys if the application has requested them, even though
we use the CSI u sequence and xterm uses CSI 27 ~ - this is what mintty does as
well.
2020-05-15 17:40:24 +01:00
Nicholas Marriott
6d92b99dbc Add a terminal feature for enable/disable extended keys (supported by xterm and
mintty) and add an option to make tmux send it.
2020-05-15 16:15:24 +01:00
Nicholas Marriott
340fd691cb Separate key flags and modifiers, log key flags, make the "xterm" flag more
explicit and fix M- keys with a leading escape.
2020-05-15 12:16:41 +01:00
Nicholas Marriott
031d4864a9 Rename KEYC_ESCAPE to KEYC_META. 2020-05-15 11:24:30 +01:00
Nicholas Marriott
5ee4d991b6 xterm-keys has been on by default for 5 years and all other modern terminals
use these key sequences by default. Merge the code into the main tty and input
tree processing (convering the latter to use a tree rather than a table at the
same time) and make the option a no-op.
2020-05-15 10:31:54 +01:00
Nicholas Marriott
31621036ad Add an option to set the pane border lines style from a choice of single lines
(ACS or UTF-8), double or heavy (UTF-8), simple (plain ASCII) or number (the
pane numbers). Lines that won't work on a non-UTF-8 terminal are translated
back into ACS when they are output.
2020-05-14 16:49:08 +01:00
Nicholas Marriott
09a66451ce Add screen write flags instead of individual bits and fix line length
calculation with padding.
2020-05-14 13:18:05 +01:00
Nicholas Marriott
0bdbf47ef9 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.
2020-05-14 11:18:19 +01:00
Nicholas Marriott
12eceaf2b3 Expand target from client and use it to expand the prompt. 2020-05-14 10:35:26 +01:00
Nicholas Marriott
09a2246b00 Use safe loop for freeing client files. 2020-05-13 21:11:46 +01:00
Nicholas Marriott
4cb1d3d7a9 Move editor stuff to common code in popup.c. 2020-05-13 06:58:07 +01:00
Nicholas Marriott
8d238491d0 Show default key bindings in customize mode. 2020-05-12 10:22:38 +01:00
Nicholas Marriott
5a34f51d33 Include key bindings in customize mode. 2020-05-12 08:57:55 +01:00
Nicholas Marriott
c489bf0a1e Support embedded styles in the display-message message, GitHub issue 2206. 2020-05-11 09:18:35 +01:00
Nicholas Marriott
d01e7aac89 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.
2020-05-10 16:52:46 +01:00
Nicholas Marriott
013d857ef8 Wrap all lines in customize mode, not just the description. 2020-05-09 15:29:14 +01:00
Nicholas Marriott
a61cbf1c33 Add a customize mode where options may be browsed and changed, includes adding
a brief description of each option. Bound to "C" by default.
2020-05-08 19:10:09 +01:00
Nicholas Marriott
7a95e9bf7e Change message log to be per server rather than per client and include every
command that is run.
2020-05-06 13:43:22 +01:00
Nicholas Marriott
2f89d2e7d8 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.
2020-05-05 15:42:20 +01:00
Nicholas Marriott
e810f15272 Store and restore cursor position when copy mode is resized, from Anindya
Mukherjee.
2020-05-05 10:20:57 +01:00
Nicholas Marriott
9991a14e81 Add formats for after hook command arguments. 2020-05-05 06:19:29 +01:00
Nicholas Marriott
af69289e0e Clamping to area needs to use the offset without the status line, since that is
where the window offsets are based.
2020-05-02 16:17:44 +01:00
Nicholas Marriott
3f1fc9cde3 Get the whole overlay screen not just the mode so cursor changes are included. 2020-05-01 17:30:28 +01:00
Nicholas Marriott
8110c7a25f 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.
2020-05-01 17:01:36 +01:00
Nicholas Marriott
93dca5ab3f Move size to tty_ctx. 2020-05-01 13:19:05 +01:00
Nicholas Marriott
5ce194f15d Rename some tty_ctx members. 2020-05-01 13:01:55 +01:00
Nicholas Marriott
cc19203be2 Add 'e' key in buffer mode to open the buffer in an editor. 2020-05-01 09:02:44 +01:00
Nicholas Marriott
25487757bc Add -W and -T flags to command-prompt to only complete a window and a target. 2020-04-30 12:02:21 +01:00
Nicholas Marriott
6f700904a9 Copy mode search improvements:
- Add styles for the search marking styles (copy-mode-match-style and
  copy-mode-current-match-style).

- Show the current match (the one with the cursor on it) in a different style.

- Copying without a selection will copy the current match if there is one.
2020-04-29 18:08:21 +01:00
Nicholas Marriott
b06235c345 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.

Lots of scope for being more sophisticated left here.
2020-04-29 13:56:10 +01:00