Commit Graph

96 Commits (01c4919f5f86d7c120451ae642e722ea7d9651d7)

Author SHA1 Message Date
nicm cdacc12ce3 Add support for OSC 8 hyperlinks (a VTE extension now supported by other
terminals such as iTerm2). Originally written by me then extended and
completed by first Will Noble and later Jeff Chiang. GitHub issues 911,
2621, 2890, 3240.
2022-06-30 09:55:53 +00:00
nicm e6e737ac0b Add an option to set the character used for unused areas of the
terminal, GitHub issue 3110.
2022-03-16 17:00:17 +00:00
nicm 07e2d88c20 Use ACS for pane border indicators so they work with different line
types, from Thomas Adam.
2022-02-04 11:57:22 +00:00
nicm 7e34645fcb Add option to show arrows for active pane indicator, GitHub issue 3022
from Marcel Partap.
2022-02-01 14:46:41 +00:00
nicm c6149adf55 Make pane-border-format a pane option, GitHub issue 2999. 2021-12-13 09:42:20 +00:00
nicm 5745bd27fd Do not allow inline styles to replace mode-style for the selected item,
from Alexis Hildebrandt in GitHub issue 2946.
2021-10-26 12:22:23 +00:00
nicm add20637f2 Add popup-border-lines option to set popup line style, from Alexis
Hildebrandt, GitHub issue 2930.
2021-10-14 13:19:01 +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 7789639b5d Add a menu when a popup is present (mouse only for now). 2021-08-13 18:54:54 +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 9013600074 Return to applying pane-border-style to the area outside panes, GitHub
issue 2816.
2021-08-11 09:05:21 +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 ff860e5fe4 Move mode set/reset after sync so cursor doesn't flicker, from Avi
Halachmi.
2021-04-13 05:25:05 +00:00
nicm 3dddc11603 Send Unicode directional isolate characters around horizontal pane
borders if the terminal support UTF-8 and an extension terminfo(5)
capability "Bidi" is present. On terminals with BiDi support (ie, VTE)
this seems to be enough to display right-to-left text acceptably enough
to be usable (with some caveats about the mouse position). Requested by
and with help from Mahmoud Elagdar in GitHub issue 2425.
2021-02-05 12:29:18 +00:00
nicm f6095cad99 Do not include the status line size when working out the character for
the pane status line. GitHub issue 2493.
2020-12-07 09:46:58 +00:00
nicm 1f5e520def Correct checks for window borders. 2020-07-22 06:21:46 +00:00
nicm b6aeb86c20 Check for no pane border status line separately from top/bottom. 2020-06-27 10:23:10 +00:00
nicm 5340bf556e Correctly redraw pane border bottom line when the status line is on and
at the bottom, reported by Kaushal Modi.
2020-06-23 14:10:43 +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 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 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 21a39c997b Do not redraw or update mode if nothing has changed. 2020-05-16 14:42:06 +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 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
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
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
nicm b2443aa2f9 Add support for the iTerm2 sychronized updates escape sequence which
drastically reduces flickering.
2020-04-16 13:35:24 +00:00
nicm 8a838b0372 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.
2020-03-24 08:09:43 +00:00
nicm 90dba3ec66 Mark pane status line jobs with FORMAT_STATUS also so it redraws when
they finish, GitHub issue 1852.
2019-07-24 21:16:17 +00:00
nicm d83f356218 Add #define for the pane status line option position numbers. 2019-06-26 13:03:47 +00:00
nicm 5fef946df4 Always redraw overlay if it is on (so status line doesn't redraw over it). 2019-05-26 18:27:52 +00:00
nicm f9682d2e55 Add a flag to redraw only the overlay, and remove the overlay on resize. 2019-05-08 18:07:12 +00:00
nicm 89db309e10 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.
2019-05-07 20:01:41 +00:00
nicm e3b1358bbc Do not let the size of the pane status screen go negative. 2019-04-17 14:41:08 +00:00
nicm 979313832c 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.
2019-03-18 20:53:33 +00:00
nicm b588b1729a Use a pointer for the active screen in the status line instead of
copying them around all the time.
2019-03-16 19:12:13 +00:00
nicm b4f5b99e4b Tidy and rename some bits of status line code. 2019-03-16 17:14:07 +00:00
nicm 938156d73b DECRC and DECSC apparently need to preserve origin mode as well, based
on a fix from Marc Reisner.
2019-03-12 20:02:47 +00:00
nicm 646995384d 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.
2018-10-18 08:38:01 +00:00
nicm cac4eadca0 Add a flag to force redrawing of the status line even if the content
hasn't changed, needed for resizing.
2018-08-19 20:13:07 +00:00
nicm 88327c7698 Add a client redraw-window flag instead of the redraw-all flag and for
all just use the three flags together (window, borders, status).
2018-08-19 16:45:03 +00:00
nicm 3bc08b0dc0 Some tidying and helper functions. 2018-08-18 16:14:03 +00:00
nicm 14b97fc889 Add size to arguments struct too. 2018-08-14 11:38:05 +00:00
nicm d0a600ccaa Some tidying, use a struct for arguments (there will be more later) and
add a helper function.
2018-08-14 11:31:34 +00:00
nicm 7f4513ec34 Add struct status_line to hold status line members of struct client, not
used yet but will be soon. From Thomas Adam.
2018-02-05 08:21:54 +00:00
nicm c363c236aa Fix memory leak in screen_redraw_make_pane_status. 2017-12-22 23:16:41 +00:00
nicm 2f6935a630 Infrastructure for drawing status lines of more than one line in height,
still only one is allowed but this lets tmux draw bigger ones.
2017-10-16 19:30:53 +00:00