Commit Graph

391 Commits

Author SHA1 Message Date
nicm
8d2286b769 Add a cursor-colour option, from Alexis Hildebrandt in GitHub issue
2959.
2021-11-01 09:34:49 +00:00
nicm
4acad43013 Do not force the cursor to move if it is in the automargin space at EOL
and that is where we want it to be, GitHub issue 2956.
2021-10-28 18:57:06 +00:00
nicm
0cca695d6e Instead of setting the popup default colours in the draw callback, set
it up in popup_display and follow the same routine as panes in the draw
and init_ctx callbacks - use the palette if the option value is default.
Allows application-set fg and bg to work in panes again.
2021-10-25 09:22:17 +00:00
nicm
d0ab1a837a When checking ranges in tty_cmd_cells, cannot use the tty cursor
position and tty_cursor because it may be at the final invisible cursor
position on automargin terminals. The text to be drawn is confined to
the pane, so use the pane cursor position for the checks instead. Fix
from Anindya Mukherjee, redraw problem reported by naddy@.
2021-10-14 09:54:51 +00:00
nicm
b8581ec80e Make positions hidden by overlays range-based rather than character-based,
from Anindya Mukherjee.
2021-10-11 13:27:50 +00:00
nicm
5359b76619 Do not reset cursor to default if it has never been changed, fixes
problem reported by naddy.
2021-10-06 10:33:12 +00:00
nicm
9b1fdb291e Separate "very visible" flag from blinking flag, it should not affect
DECSCUSR. GitHub issue 2891.
2021-10-05 12:46:02 +00:00
nicm
de9697b456 calloc for confirm-before data since the item needs to start NULL. 2021-08-17 11:20:13 +00:00
nicm
41ababdf6c Be more sophisticated about enabling synchronized updates when there is
an overlay and treat it like the active pane (use for commands which
move the cursor only). When there is an overlay also use it for all
panes and not just the active pane. GitHub issue 2826.
2021-08-17 08:44:52 +00:00
nicm
7789639b5d Add a menu when a popup is present (mouse only for now). 2021-08-13 18:54:54 +00:00
nicm
9b00472820 Evaluate styles with the pane variables. 2021-08-12 19:47:05 +00:00
nicm
7eea3d7ab8 Break the colour palette into a struct rather than just a single array
and use that to support the OSC palette-setting sequences in popups.
Also add a pane-colours array option to specify the defaults. GitHub
issue 2815.
2021-08-11 20:49:55 +00:00
nicm
f6755c6f2c OSC 52 can be long enough to make tmux think the output buffer is too
big, so treat it as a redraw. GitHub issue 2814.
2021-08-11 07:51:31 +00:00
nicm
ef5602a590 Another minor fix - do not draw positions that are under the popup with
spaces, from Anindya Mukherjee. Also a typo fix from Linus Arver.
2021-08-06 07:32:21 +00:00
nicm
950d3c5bbc Tweak previous not to replace complete characters with spaces. 2021-08-06 03:29:15 +00:00
nicm
97b5962ab1 Correctly draw wide characters that are partially obscured. 2021-08-06 03:13:05 +00:00
nicm
93cc8df692 Do not freeze output in panes when a popup is open, let them continue to
redraw. From Anindya Mukherjee .
2021-08-05 09:43:51 +00:00
nicm
a35c897f0f Do not clear region based on current cursor position, this is not
necessary anymore and causes problems, GitHub issue 2735.
2021-06-10 07:59:31 +00:00
nicm
02a6b39db7 Improve logging of screen mode changes. 2021-06-10 07:43:44 +00:00
nicm
f9f97c8145 Change cursor style handling so tmux understands which sequences contain
blinking and sets the flag appropriately, means that it works whether
cnorm disables blinking or not. GitHub issue 2682.
2021-06-10 07:36:47 +00:00
nicm
e8224fb0d1 Fix so tmux correctly sends the cvvis (cursor very visible) capability
rather than sending it and then immediately undoing it with cnorm. Also
turn it off when the cursor shape is changed like xterm.
2021-03-12 08:39:17 +00:00
nicm
af3ffa9c41 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.
2021-02-17 07:18:36 +00:00
nicm
91d112bf12 There is no need to clear every line entirely before drawing to it, this
means moving the cursor and messes up wrapping. Better to just clear the
sections that aren't written over. GitHub issue 2537.
2021-01-18 10:27:54 +00:00
nicm
fd451aa796 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.
2020-12-03 07:12:11 +00:00
nicm
f1193b4891 If mouse bits change, clear them all and set again to avoid problems
with some bits implying others. GitHub issue 2458.
2020-11-09 10:54:28 +00:00
nicm
c8f3736b07 Use the setal capability as well as (tmux's) Setulc. 2020-10-05 09:53:01 +00:00
nicm
e538bef757 Check started flag before looking for capability. 2020-09-02 17:19:58 +00:00
nicm
37b1600d9c Add a -w flag to set- and load-buffer to send to clipboard using OSC 52.
GitHub issue 2363.
2020-09-02 13:46:35 +00:00
nicm
c908d2039f Fix various confusion about am vs xenl. 2020-06-05 09:32:15 +00:00
nicm
4694e9a2b6 Move the code to set up a padding cell into grid.c. 2020-06-02 20:51:46 +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
nicm
a06a0e1392 xterm* can have focus too. 2020-05-22 15:08:38 +00:00
nicm
0ab82d9531 Add a terminal feature for enable/disable extended keys (supported by
xterm and mintty) and add an option to make tmux send it. Only forward
extended keys if the application has requested them, even though we use
the CSI u sequence and xterm uses CSI 27 ~ - this is what mintty does as
well.
2020-05-16 16:44:54 +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
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
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
3fb4d4df43 Do not need to work out status line offset, we already have it. 2020-05-16 15:36:57 +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
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
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
nicm
d0b8f5340e Do not clear client pane redraw flags until the redraw actually happens. 2020-04-21 06:32:40 +00:00
nicm
117ec1b2e6 Apply terminal-overrides after terminal detection, it always takes
precedence.
2020-04-20 15:37:32 +00: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
135bb1edee Change the Sync capability to be a string instead of a flag. 2020-04-20 13:38:48 +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
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
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