Commit Graph

662 Commits (b3e5a99c8fd37b8b1d2921f996bf24f47631e7a2)

Author SHA1 Message Date
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 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 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 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 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 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 21a39c997b Do not redraw or update mode if nothing has changed. 2020-05-16 14:42:06 +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 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 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 09a2246b00 Use safe loop for freeing client files. 2020-05-13 21:11:46 +01:00
Nicholas Marriott 0070313e28 Fix comparison of tty name. 2020-05-10 16:57:33 +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 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 cb1131a294 menu_mode_cb needs to return a screen also. 2020-05-02 15:15:52 +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 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
Nicholas Marriott a477c03ad5 Do not update mode until actually drawing something. 2020-04-24 12:14:53 +01:00
Nicholas Marriott 8650f44340 Move terminal features into a single file. 2020-04-24 06:40:51 +01:00
Thomas Adam 2cbca7ce16 Merge branch 'obsd-master' 2020-04-21 12:01:35 +01:00
nicm 57bd6e0447 Turn off the block flag to reset the state or the cursor will not be
moved back to the right place.
2020-04-21 06:34:13 +00:00
Thomas Adam 32c3fe40eb Merge branch 'obsd-master' 2020-04-20 17:43:20 +01:00
Thomas Adam c706aadf52 Merge branch 'obsd-master' 2020-04-20 17:42:29 +01:00
nicm 2083a6ea20 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.
2020-04-20 14:59:31 +00:00
nicm c91b4b2e14 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.
2020-04-20 13:25:36 +00:00
Thomas Adam 3898d4e7c8 Merge branch 'obsd-master' 2020-04-20 12:01:32 +01:00
nicm 86862c976a Also redraw panes which aren't pane 0. Problem reported by tb@. 2020-04-20 09:07:55 +00:00
Thomas Adam b1be668a3e Merge branch 'obsd-master' 2020-04-20 08:01:31 +01:00
nicm 4bc0a83d51 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).
2020-04-20 06:07:39 +00:00
Thomas Adam 8c9bbc3749 Merge branch 'obsd-master' 2020-04-19 00:01:31 +01:00
nicm 62ff5e4b01 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.
2020-04-18 21:35:32 +00:00
Thomas Adam e1799ed7c8 Merge branch 'obsd-master' 2020-04-18 10:01:31 +01:00
nicm b0a37e7514 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.
2020-04-18 07:32:53 +00:00
Thomas Adam 349617a818 Merge branch 'obsd-master' 2020-04-18 08:01:37 +01:00
nicm baf1fca273 Only update mode when actually going to redraw something. 2020-04-18 06:52:36 +00:00
nicm 1d2bd864f2 Add a flag to protect against nested syncs and add some extra logging to
redrawing.
2020-04-18 06:20:50 +00:00
nicm d94bdf7420 Revert previous, there is still a problem. 2020-04-18 06:15:07 +00:00
nicm 5289d4ed13 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.
2020-04-18 06:10:15 +00:00
Thomas Adam 87d79e6d36 Merge branch 'obsd-master' 2020-04-18 00:01:30 +01:00
nicm a7a9460d27 Set mode properly before and after redrawing, and don't bother
calculating cursor position if it won't be used.
2020-04-17 22:16:28 +00:00
Thomas Adam 5e38d26257 Merge branch 'obsd-master' 2020-04-16 16:01:35 +01:00
nicm 5ec80bd249 Move the UTF-8 flag to terminal flags. 2020-04-16 14:25:35 +00:00