summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/server-client.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Make options_get_string return const string.nicm2017-01-131-3/+4
|
* Add -E to detach-client to exec a command to replace the client insteadnicm2017-01-131-1/+27
| | | | of exiting it, useful if tmux wasn't exec'd itself. From Jenna Magius.
* Add some missing special keys to key_string_lookup_key, fix a mousenicm2017-01-111-2/+2
| | | | check in server_client_handle_key, and tweak a comment.
* Make prefix work in all tables (except the prefix table). Users who wantnicm2016-12-071-12/+14
| | | | | | to avoid this can set prefix to "none" and bind send-prefix themselves. Allows C-b t be bound in the copy mode tables again, pointed out by millert@.
* The mouse valid flag needs to be correct before we fire the draggingnicm2016-11-241-8/+10
| | | | | callback, so move the callback outside of server_client_check_mouse and use a new special key code to indicate it.
* If in the middle of a drag, don't use an invalid key, just usenicm2016-11-241-3/+11
| | | | KEYC_MOUSE as a placeholder. Reported by Artem Fokin.
* Fix so that we work out the right pane from mouse events - we were doingnicm2016-11-241-8/+15
| | | | | | | | | | so too early, before the mouse event was necessarily valid, so could end up using the pane from the previous mouse event, or the active pane. It is important that we use the right pane now that different panes can have different key tables (for copy mode). Fixes problem reported by Greg Hurrell.
* For mouse keys, use the mouse pane as the default current pane.nicm2016-11-231-2/+16
|
* Do not stop dragging when the wheel is pressed, from Artem Fokin.nicm2016-11-161-3/+3
|
* Turn on margins, with a couple of fixes (only limit to the pane for linenicm2016-11-151-3/+3
| | | | feeds, and do not move cursor to end for full width panes).
* Initial attempt to make use of left and right margins if the terminalnicm2016-11-151-1/+2
| | | | | | | supports them (that is, if it advertises itself as a VT420 - probably just xterm). These are the vertical equivalent of the scroll region and allow much faster scrolling of panes that do not take up the full width of the terminal.
* Alerts are too slow, so rather than walking all sessions and windows,nicm2016-10-191-6/+5
| | | | | | add a link of winlinks to each window and a pointer to the session to each winlink. Also rewrite the alerts processing to return to the old behaviour (alert in any window sets the flag on any winlink).
* Use the notify name string instead of going via an enum and changenicm2016-10-161-3/+3
| | | | existing hooks to use notifys instead.
* Mass rename struct cmd_q to struct cmdq_item and related.nicm2016-10-161-5/+5
|
* Rewrite command queue handling. Each client still has a command queue,nicm2016-10-161-13/+33
| | | | | | | | | | | | | | | but there is also now a global command queue. Instead of command queues being dispatched on demand from wherever the command happens to be added, they are now all dispatched from the top level server loop. Command queues may now also include callbacks as well as commands, and items may be inserted after the current command as well as at the end. This all makes command queues significantly more predictable and easier to use, and avoids the complex multiple nested command queues used by source-file, if-shell and friends. A mass rename of struct cmdq to a better name (cmdq_item probably) is coming.
* The repeat prompt in both emacs and vi (and the old one in tmux) doesn'tnicm2016-10-121-4/+5
| | | | | | support line editing and instead executes a command as soon as a non-number key is pressed. Add a -N flag to command-prompt for the same in copy mode. Reported by Theo Buehler.
* Support double and triple clicks (they are cumulative, so double isnicm2016-10-111-9/+114
| | | | | fired then triple), and use for select-word and select-line in copy mode. Inspired by a different solution from Omar Sandoval.
* Fundamental change to how copy mode key bindings work:nicm2016-10-111-8/+27
| | | | | | | | | | | | | | | | | | | | | | | | | The vi-copy and emacs-copy mode key tables are gone, and instead copy mode commands are bound in one of two normal key tables ("copy-mode" or "copy-mode-vi"). Keys are bound to "send-keys -X copy-mode-command". So: bind -temacs-copy C-Up scroll-up bind -temacs-copy -R5 WheelUpPane scroll-up Becomes: bind -Tcopy-mode C-Up send -X scroll-up bind -Tcopy-mode WheelUpPane send -N5 -X scroll-up This allows the full command parser and command set to be used - for example, we can use the normal command prompt for searching, jumping, and so on instead of a custom one: bind -Tcopy-mode C-r command-prompt -p'search up' "send -X search-backward '%%'" command-prompt also gets a -1 option to only require on key press, which is needed for jumping. The plan is to get rid of mode keys entirely, so more to come eventually.
* Loads more static, except for cmd-*.c and window-*.c.nicm2016-10-101-30/+30
|
* Make the CLIENT_STATUS flag imply that pane status lines are redrawn ifnicm2016-10-091-11/+3
| | | | | they are enabled and break the actual screen generation code into a separate function. Fixes problems reported by Romain Francoise.
* Rate limit TIOCSWINSZ on a timer to avoid programs getting hammered withnicm2016-09-281-5/+37
| | | | | SIGWINCH when the size changes rapidly. To help a problem reported by Rui Pinheiro.
* Allow a command to be specified to display-panes, similar tonicm2016-06-161-5/+6
| | | | command-prompt, rather than always just selecting the pane.
* tty_client_ready can not be internal to tty.c again.nicm2016-04-301-5/+2
|
* Add option to include status text in the pane borders. Ifnicm2016-04-291-8/+8
| | | | | | | | | pane-border-status is set to "top" or "bottom" (rather than "off"), every pane has a permanent top or bottom border containing the text from pane-border-format. Based on a diff sent long ago by Jonathan Slenders, mostly rewritten and simplified by me.
* After unlock, Update activity time after recalculate_sizes() so that thenicm2016-04-281-3/+4
| | | | session attached flag is correct.
* Instead of reusing MouseUp at the finish of a drag, add a new keynicm2016-03-181-12/+12
| | | | MouseDragEnd. It can be useful to bind them separately in copy mode.
* When a mouse drag is finished, fire a MouseUp key press, instead ofnicm2016-03-011-3/+41
| | | | doing the drag end in code. From Stephen Coakley.
* I no longer use my SourceForge address so replace it.nicm2016-01-191-2/+2
|
* Add infrastructure to work out the best target given a pane or windownicm2015-12-161-3/+3
| | | | alone and use it to add pane_died and pane_exited hooks.
* Some hooks API changes to fire a hook while waiting another cmdq andnicm2015-12-151-3/+3
| | | | infrastructure that will be needed soon.
* Add key-table option to set the default key table for a session, allowsnicm2015-12-121-10/+28
| | | | different key bindings for different sessions and a few other things.
* Allow prefix and prefix2 to be set to None to disable (useful if younicm2015-12-121-8/+8
| | | | would rather bind the prefix in the root table).
* Add cmdq as an argument to format_create and add a format for thenicm2015-12-111-2/+2
| | | | command name (will also be used for more later).
* Remove format_create_flags and just pass flags to format_create.nicm2015-12-081-2/+2
|
* Add hooks infrastructure, basic commands (set-hook, show-hooks) and anicm2015-12-081-1/+16
| | | | | | couple of not very useful client hooks. This will eventually let commands be run at various points and on notifications. Joint work with Thomas Adam.
* Do not deref wp if window_get_active_at returns NULL which can happen onnicm2015-12-011-4/+5
| | | | very large terminals, from Michael Graczyk.
* Remove support for the UTF-8 mouse extension. This was a briefly used,nicm2015-11-231-12/+1
| | | | | | | | poor idea that was fairly quickly replaced by SGR mouse input (which is now widespread). It is impossible to tell the difference between UTF-8 and non-UTF-8 mouse input; since the mouse-utf8 option was removed tmux has not handled it correctly in any case; and it is ridiculous to have three different forms of mouse input.
* Only assume pasting with at least two characters, reduces problems fornicm2015-11-191-3/+11
| | | | | people who can type ^B c very fast, or who are using tmux inside something else that buffers.