Commit Graph

2188 Commits (8110c7a25f257b13f92f34559efedba204e6ea98)

Author SHA1 Message Date
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
Nicholas Marriott 24316bed49 Apply a format when redrawing pane borders. 2020-04-29 08:21:29 +01:00
Nicholas Marriott 1f8256fc50 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-04-28 13:50:07 +01:00
Nicholas Marriott 79b4d83952 Use a grid cell not a style for the pane style. 2020-04-27 15:15:12 +01:00
Nicholas Marriott c30e765c7b Add some additional format helper functions. 2020-04-27 14:33:17 +01:00
Nicholas Marriott 9b571dacee Instead of forbidding invalid session names, sanitize them. 2020-04-24 16:40:10 +01:00
Nicholas Marriott 527f66ed23 Instead of having a default set of terminals in terminal-overrides that get XT
added and using that as a marker for xterm(1)-like, assume that if the
terminfo(5) entry already has XT or the clear capability starts with CSI then
the terminal is VT100-like and it should be safe to send DA requests. The DA
responses trigger additional features being added.

This is all to detect extensions if terminfo(5) is wrong or inadequate. If it
fails, tmux will just fall back to using the capabilities in the terminfo(5)
entry alone.
2020-04-24 15:52:44 +01:00
Nicholas Marriott 61550ac2e0 Add feature and capabilities for focus reporting. Also document AX and XT even
though they aren't tmux's.
2020-04-24 07:37:11 +01:00
Nicholas Marriott 5d69b9c4a7 Add a feature for bracketed paste. 2020-04-24 07:13:02 +01:00
Nicholas Marriott 8650f44340 Move terminal features into a single file. 2020-04-24 06:40:51 +01:00
Nicholas Marriott d53e1fedd5 Add TMUX_SOCK like TMUX_PATH for the socket directory. 2020-04-23 18:15:02 +01:00
Nicholas Marriott 0d3fdae7b6 Build list of paths and weed out duplicates before loading configs. 2020-04-23 17:56:45 +01:00
Nicholas Marriott ac91635f82 Add extension terminfo(5) capabilities for margins. 2020-04-23 12:12:02 +01:00
Nicholas Marriott c74572da92 Remove support for iTerm2's DSR 1337 extension and use the CSI > q extension
now supported by a few different terminals.
2020-04-23 10:29:03 +01:00
Thomas Adam cf5f93b2b3 Merge branch 'obsd-master' 2020-04-23 02:01:33 +01:00
nicm 899b3d2436 Indicate the marked pane in choose mode in reverse and add key to set
and clear it (m and M) and a key to jump to the starting pane (H).
2020-04-22 21:01:28 +00:00
Thomas Adam 8ae3915cc2 Merge branch 'obsd-master' 2020-04-22 12:01:38 +01:00
nicm de5163a634 Change so main-pane-width and height can be given as a percentage. 2020-04-22 06:57: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 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 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 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 7da5418758 Merge branch 'obsd-master' 2020-04-18 20:01:29 +01:00
nicm 100db552d1 A resize can realloc so cannot cache the value of the list pointer. 2020-04-18 17:20:25 +00:00
Thomas Adam 2b83ee5557 Merge branch 'obsd-master' 2020-04-18 18:01:28 +01:00
nicm ea5fdd5331 There is no point in keeping a bunch of different text buffers for each
line when writing, we only need one as big as the line width - there
can't be any more text than that since newer will overwrite older.
2020-04-18 15:12:28 +00:00
Thomas Adam 2ccf15e5d8 Merge branch 'obsd-master' 2020-04-18 16:01:34 +01:00
nicm 4a93294152 Use size_t not u_int for the bytes counters and fix a const missing. 2020-04-18 14:21:39 +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
nicm e153b928ff Add formats for pane written/skipped bytes for debugging. 2020-04-18 07:19:28 +00:00
Thomas Adam 349617a818 Merge branch 'obsd-master' 2020-04-18 08:01:37 +01: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 7a21e911e1 Merge branch 'obsd-master' 2020-04-17 16:01:33 +01:00
nicm 282a7a8d96 Make sure the cursor position is still on screen after we have trimmed
empty lines. Also improve some log messages.
2020-04-17 14:06:42 +00:00
Thomas Adam 21eb2ba419 Merge branch 'obsd-master' 2020-04-16 18:01:32 +01:00
nicm 2e347d6a38 Only start and stop sync for operations like clear and scroll where
there is a better chance more data will be on the way.
2020-04-16 16:13:56 +00:00
nicm 363d950ac0 Send secondary device attributes instead of primary which gives us a bit
more useful information on some terminals.
2020-04-16 15:14:25 +00:00
Thomas Adam 5e38d26257 Merge branch 'obsd-master' 2020-04-16 16:01:35 +01:00