summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server-client.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Add StatusLeft and StatusRight mouse key modifiers for the left andnicm2018-08-221-10/+92
| | | | right parts of the status line.
* Add a flag to force redrawing of the status line even if the contentnicm2018-08-191-1/+7
| | | | hasn't changed, needed for resizing.
* Add a client redraw-window flag instead of the redraw-all flag and fornicm2018-08-191-26/+15
| | | | all just use the three flags together (window, borders, status).
* SESSION_UNATTACHED flag is no longer necessary now we have an attachednicm2018-08-181-2/+2
| | | | count instead.
* Make key trees and some other bits static.nicm2018-08-021-5/+6
|
* When a key isn't in the first table, we need to try the same key againnicm2018-07-171-11/+16
| | | | | not the any key. Also rename some labels. Fixes GitHub issue 1406 reeported by Mark Kelly.
* Add an "Any" key to run a command if a key is pressed that is not boundnicm2018-07-161-2/+6
| | | | in the current key table. GitHub issue 1404.
* Add pane focus hooks.nicm2018-07-041-9/+11
|
* Make server_client_get_cwd used (almost) everywhere we need to work outnicm2018-05-241-5/+9
| | | | | the cwd, and do not fall back to "." as it is pretty useless. GitHub issue 1331.
* Add a missing client-detached hook when the server shuts down, and donicm2018-03-081-1/+3
| | | | | not exit until jobs started from run-shell/if-shell have finished (add a job flags member and a flag to indicate other jobs). GitHub issue 1245.
* Check prefix when retrying so it is checked while repeat flag isnicm2018-02-221-2/+2
| | | | set. GitHub issue 1239.
* Add struct status_line to hold status line members of struct client, notnicm2018-02-051-8/+8
| | | | used yet but will be soon. From Thomas Adam.
* Report better error from server when socket create fails, GitHub issuenicm2017-12-191-2/+6
| | | | 1201.
* Infrastructure for drawing status lines of more than one line in height,nicm2017-10-161-8/+9
| | | | still only one is allowed but this lets tmux draw bigger ones.
* Do not attempt to use TIOCSWINSZ on a -1 file descriptor (possible ifnicm2017-09-061-3/+3
| | | | the pane has already died).
* Pass flags into cmd_find_from_* to fix prefer-unattached, reported bynicm2017-08-301-3/+3
| | | | Thomas Sattler.
* Add -d flag to display-panes to specify timeout, and make 0 mean nonicm2017-08-161-5/+4
| | | | timeout. From Laurens Post.
* Fix redraw defer code in the presence of multiple clients - the timernicm2017-07-141-19/+14
| | | | | | | may be needed for all of them, so don't delete it on the first; and don't skip setting the redraw flag if the timer is already running. Reported by Pol Van Aubel in GitHub issue 1003.
* proc_send_s now seems unnecessary.nicm2017-07-121-3/+3
|
* Remove xterm flag from key before checking prefix, reported by Peternicm2017-06-131-4/+6
| | | | Fern in GitHub issue 974.
* Continue and pass keys through if they are repeated keys, so that thenicm2017-06-061-3/+4
| | | | first key after a repeated key doesn't get lost.
* Some applications like vi(1) and tmux until 10 minutes or so ago, do notnicm2017-05-311-20/+41
| | | | | | | redraw on SIGWINCH if the size returns to the original size between the original SIGWINCH and when they get around to calling TIOCGWINSZ. So use the existing resize timer to introduce a small delay between the two resizes.
* It is not OK to ignore SIGWINCH if SIOCGWINSZ reports the size hasnicm2017-05-311-5/+4
| | | | | | unchanged, because it may have changed and changed back in the time between us getting the signal and calling ioctl(). Always redraw when we see SIGWINCH.
* Because we defer actually resizing applications (calling TIOCSWINSZ)nicm2017-05-311-2/+25
| | | | | | | | | | | | | | | | | until the end of the server loop, tmux may have gone through several internal resizes in between. This can be a problem if the final size is the same as the initial size (what the application things it currently is), because the application may choose not to redraw, assuming the screen state is unchanged, when in fact tmux has thrown away parts of the screen, assuming the application will redraw them. To avoid this, do an extra resize if the new size is the same size as the initial size. This should force the application to redraw when tmux needs it to, while retaining the benefits of deferring (so we now resize at most two times instead of at most one - and only two very rarely). Fixes a problem with break-pane and zoomed panes reported by Michal Mazurek.
* Store a copy of the old status line, will be needed soon for new choose mode.nicm2017-05-291-1/+5
|
* Function to count clients.nicm2017-05-291-1/+16
|
* Line length and spaces to tabs.nicm2017-05-161-8/+9
|
* Insert copy mode bindings at the right place in the command queue.nicm2017-05-101-2/+2
|
* If the current screen was complex enough, it was possible to make redrawnicm2017-05-091-1/+11
| | | | | | itself hit the "terminal can't keep up" check. To avoid this, record how much data we send during redraw (we know we will be starting with 0) and skip the check until it has been flushed. GitHub issue 912.
* Up to now, tmux sees \033\033[OA as M-Up and since we turned onnicm2017-05-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | xterm-keys by default, generates \033[1;3A instead of \033\033[OA. Unfortunately this confuses vi, which doesn't understand xterm keys and now sees Escape+Up pressed within escape-time as Escape followed by A. The issue doesn't happen in xterm itself because it gets the keys from X and can distinguish between a genuine M-Up and Escape+Up. Because xterm can, tmux can too: xterm will give us \033[1;3A (that is, kUP3) for a real M-Up and \033\033OA for Escape+Up - in fact, we can be sure any \033 preceding an xterm key is a real Escape key press because Meta would be part of the xterm key instead of a separate \033. So change tmux to recognise both sequences as M-Up for its own purposes, but generate the xterm version of M-Up only if it originally received the xterm version from the terminal. This means we will return to sending \033\033OA instead of the xterm key for terminals that do not support xterm keys themselves, but there is no practical way around this because they do not allow us to distinguish between Escape+Up and M-Up. xterm style escape sequences are now the de facto standard for these keys in any case. Problem reported by jsing@ and subsequently by Cecile Tonglet in GitHub issue 907.
* In order that people can use formats like #D in #() in the status linenicm2017-05-011-2/+3
| | | | | | | | | | | | | | and not have to wait for an update when they change pane, we allow commands to run more than once a second if the expanded form changes. Unfortunately this can mean them being run far too often (pretty much continually) when multiple clients exist, because some formats (including #D) will always differ between clients. To avoid this, give each client its own tree of jobs which means that the same command will be different instances for each client - similar to how we have the tag to separate commands for different panes. GitHub issue 889; test case reported by Paul Johnson.
* Mouse bindings and hooks set up an initial current state when running anicm2017-04-221-12/+6
| | | | | | | | | | | | | | | command. This is used for the session, window and pane for all commands in the command sequence if there is no -t or -s. However, using it for all commands in the command sequence means that if the active pane or current session is changed, subsequent commands still use the previous state. So make commands which explicitly change the current state (such as neww and selectp) update it themselves for later commands. Commands which may invalidate the state (like killp) are already OK because an invalid state will be ignored. Also fill in the current state for all key bindings rather than just the mouse, so that any omissions are easier to spot.
* Log error properly when no current state, and some other minor tweaks.nicm2017-04-211-4/+1
|
* Key needs to be initialized to zero now it has flags in it.nicm2017-04-211-1/+3
|
* Add cmd_find_from_winlink_pane and use it in a couple of places, andnicm2017-04-211-6/+2
| | | | make functions that can't fail void.
* It is annoying that the copy mode key table (or any other key table)nicm2017-04-211-24/+33
| | | | | | | | | | | | will suppress root key table bindings. So change to always check the root table if no binding is found in the current table (whether it be the prefix table from pressing the prefix or the copy mode table from a pane). A root key binding can be blocked by binding the key to a command that does nothing (like send-keys with no arguments). Problem reported by Thomas Sattler.
* Store state shared between multiple commands in the queue in a sharednicm2017-04-211-3/+4
| | | | structure.
* Only set up a current target for mouse key bindings. Fixes:nicm2017-04-201-7/+6
| | | | | | | bind q select-pane -U \; resize-pane -Z (There is still some possible weirdness with the way we do current targets, it should probably be done in a different way at some point.)
* Add a suspend helper function, and do not allow detaching or suspendingnicm2017-04-191-4/+19
| | | | while already doing so.
* When the data we have buffered to write to a terminal grows beyond anicm2017-04-191-3/+3
| | | | | | | | | | | | | | | | | | reasonable amount (currently width * height * 8 bytes), discard all output to the terminal and start trying to redraw periodically instead. Continue with this until the amount of data we are trying to write falls to a low level again. This helps to prevent tmux sitting on a huge buffer of data when there are processes with fast output running inside tmux but the outside terminal is slow. A new client_discarded format holds the amount of data that has been discarded due to this mechanism. The three variables (when to start this, when to stop, and how often to redraw) are basically "works for me" at the moment, this is going in to see how it goes and if it causes problems for anyone else.
* On terminals without DECSLRM, when a pane that is less than the fullnicm2017-04-181-2/+52
| | | | | | | | | | | | | | | | | | | | | with of the terminal scrolls, tmux needs to redraw the entire pane. This results in a large amount of output data which can cause slow terminals to struggle, particularly when many lines are scrolled together quickly. This can be reduced by only redrawing when tmux doesn't hold any buffered data for the terminal. If a redraw is required and data is buffered, the redraw is deferred until all that data is consumed (it is checked after every event loop, a timer is used to ensure this happens at some point). While a redraw is pending, no additional data will be written to the terminal. The redraw still happens, now it is just pushed back if it is possible it would just add more data on top of a terminal that is already behind. This both gives the terminal a chance to catch up, and allows tmux to process more scrolling (that would require additional redraws) in the meantime. Helps with a problem reported by Greg Hurrell.
* Remove a couple of redraw flags that no longer have any effect.nicm2017-04-171-7/+1
|
* Give each client a name. This defaults to the tty name as before butnicm2017-04-051-7/+14
| | | | | | | falls back to an alternative if the tty name is not available. This is clearer than overloading the client ttyname member and allows us to remove the path stored in the tty struct, it should always be the same as the client.
* Clear the bracket paste mode when in the command prompt.nicm2017-03-091-1/+5
|
* Move the client identify (display-panes) code into server-client.c.nicm2017-03-091-4/+47
|
* Make source-file look for files relative to the client working directorynicm2017-02-141-1/+30
| | | | | (like load-buffer and save-buffer), from Chris Pickel. Also break the where-is-this-file code out into its own function for loadb and saveb.
* Break the message storage function into its own function, useful fornicm2017-02-091-1/+32
| | | | debugging.
* Some other tidying bits.nicm2017-02-081-1/+2
|
* Add a window or pane id "tag" to each format tree and use it to separatenicm2017-02-031-2/+2
| | | | | | jobs, this means that if the same job is used for different windows or panes (for example in pane-border-format), it will be run separately for each pane.
* Implement "all event" (1003) mouse mode but in a way that works. Thenicm2017-02-011-7/+35
| | | | | | | | | | | main issue is that if we have two panes, A with 1002 and B with 1003, we need to set 1003 outside tmux in order to get all the mouse events, but then we need to suppress the ones that pane A doesn't want. This is easy in SGR mouse mode, because buttons == 3 is only used for movement events (for other events the trailing m/M marks a release instead), but in normal mouse mode we can't tell so easily. So for that, look at the previous event instead - if it is drag+release as well, then the current event is a movement event.