summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/input-keys.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Support for windows larger than visible on the attached client. This hasnicm2018-10-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Apply the xterm key flag when needed for send-keys, fixes problemnicm2017-06-281-2/+2
| | | | reported by Franky Spamschleuder.
* Add explicit keys for the bracketed paste sequences, both to avoid mixnicm2017-06-121-1/+5
| | | | ups with other keys and to make logs clearer.
* Up to now, tmux sees \033\033[OA as M-Up and since we turned onnicm2017-05-071-1/+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.
* Implement "all event" (1003) mouse mode but in a way that works. Thenicm2017-02-011-10/+32
| | | | | | | | | | | 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.
* Revert previous for now, it will break TERM=screen.nicm2017-01-251-6/+6
|
* If xterm-keys is on, use xterm(1) style keys for Home and End as well asnicm2017-01-251-6/+6
| | | | modified keys.
* Remove some dead code in cmd-move-window.c and make a load of localnicm2016-10-031-4/+4
| | | | functions static.
* Limit x, y and b to 0x7ff for UTF-8 mouse input, suggested by schwarze@.nicm2016-03-021-1/+3
|
* Use system wcwidth() instead of carrying around UTF-8 width tables.nicm2016-03-011-4/+17
|
* I no longer use my SourceForge address so replace it.nicm2016-01-191-2/+2
|
* Allow prefix and prefix2 to be set to None to disable (useful if younicm2015-12-121-3/+3
| | | | would rather bind the prefix in the root table).
* Partly revert previous, it is harmless to keep support for UTF-8 mousenicm2015-11-231-1/+7
| | | | mode inside tmux, just no longer support it for tmux itself.
* Remove support for the UTF-8 mouse extension. This was a briefly used,nicm2015-11-231-7/+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.
* 0x7f is a valid key.nicm2015-11-161-2/+2
|
* All these return values from utf8_* are confusing, use an enum.nicm2015-11-141-2/+2
|
* Rename overly-long utf8data to ud throughout.nicm2015-11-121-6/+6
|
* Support UTF-8 key bindings by expanding the key type from int tonicm2015-11-121-15/+25
| | | | | | uint64_t and converting UTF-8 to Unicode on input and the reverse on output. (This allows key bindings, there are still omissions - the largest being that the various prompts do not accept UTF-8.)
* Move struct options into options.c.nicm2015-10-271-2/+2
|
* Some extra logging of where keys are actually going.nicm2015-10-261-3/+4
|
* Don't eat the mouse event that triggers a drag end because we may wantnicm2015-04-211-1/+2
| | | | to pass it on to application inside the pane.
* Rewrite of tmux mouse support which was a mess. Instead of havingnicm2015-04-191-49/+50
| | | | | | | | | | | | | | | | | | | | | | | | | options for "mouse-this" and "mouse-that", mouse events may be bound as keys and there is one option "mouse" that turns on mouse support entirely (set -g mouse on). See the new MOUSE SUPPORT section of the man page for description of the key names and new flags (-t= to specify the pane or window under mouse as a target, and send-keys -M to pass through a mouse event). The default builtin bindings for the mouse are: bind -n MouseDown1Pane select-pane -t=; send-keys -M bind -n MouseDown1Status select-window -t= bind -n MouseDrag1Pane copy-mode -M bind -n MouseDrag1Border resize-pane -M To get the effect of turning mode-mouse off, do: unbind -n MouseDrag1Pane unbind -temacs-copy MouseDrag1Pane The old mouse options are now gone, set-option -q may be used to suppress warnings if mixing configuration files.
* Fix some format specifier nits, from Ben Boeckel.nicm2015-03-311-2/+2
|
* Tidy up mode-mouse check.nicm2014-11-051-14/+12
|
* Revert the up/down wheel emulation for now, there will be a better waynicm2014-07-211-16/+1
| | | | to do this along later for those who want it.
* Drop explicit support for F13-F20 and change to match the xterm terminfonicm2014-07-211-9/+9
| | | | | | | | | | | | | entry: F13-F24 are S-F1 to S-F12 F25-F36 are C-F1 to C-F12 F37-F48 are C-S-F1 to C-S-F12 F49-F60 are M-F1 to M-F12 and F61-F63 are M-S-F1 to M-S-F3 This should be no difference for applications inside tmux, but means that any key binding for F13 will need to be replaced by S-F1 and so on.
* Send up and down keys for mouse wheel in alternate screen mode (when itnicm2014-05-081-1/+16
| | | | normally does nothing), from Marcel Partap.
* There is no longer a need for a paste_stack struct or for global_buffersnicm2014-04-241-2/+2
| | | | to be global. Move to paste.c.
* A couple of trivial mouse-related style nits.nicm2014-04-031-2/+2
|
* Remove log_debug2 as well and simplify log.c.nicm2014-03-311-4/+4
|
* Don't limit width and height to 222 in standard mouse mode.nicm2013-05-071-2/+2
|
* Add resize-pane -Z to temporary zoom the active pane to occupy the fullnicm2013-03-241-2/+3
| | | | | | | | | | | | | | window or unzoom (restored to the normal layout) if it already zoomed, bound to C-b z by default. The pane is unzoomed on pretty much any excuse whatsoever. We considered making this a new layout but the requirements are quite different from layouts so decided it is better as a special case. Each current layout cell is saved, a temporary one-cell layout generated and all except the active pane set to NULL. Prompted by suggestions and scripts from several. Thanks to Aaron Jensen and Thiago Padilha for testing an earlier version.
* Support the latest theory for mouse input, this is enabled/disabled withnicm2013-03-221-3/+16
| | | | | SM/RM 1006 and is similar in style to SGR input: \033[<b;x;yM or \033[b;x;ym. From Egmont Koblinger.
* Support middle-click paste, based on a diff from Ailin Nemui.nicm2012-11-271-5/+12
|
* Revert last, after discussion it isn't necessary.nicm2012-11-271-3/+2
|
* If the application inside tmux has requested any mouse modes itself, donicm2012-11-271-2/+3
| | | | not let mode-mouse take any effect. From Sergey Naumov.
* Make mouse event structure clearer by defining events (up, click, drag)nicm2012-10-261-7/+7
| | | | | and simplifying how buttons and wheels are represented, from Ailin Nemui. Should be no functional changes.
* xfree is not particularly helpful, remove it. From Thomas Adam.nicm2012-07-101-2/+2
|
* Only enter copy mode on scroll up, from Ailin Nemui.nicm2012-05-051-2/+3
|
* Simplify mouse input function.nicm2012-04-011-6/+7
|
* Extend the mode-mouse option to add a third choice which means the mousenicm2011-07-301-2/+4
| | | | | | | does not enter copy mode. Patch from SF bug 3374493. In future the mode-mouse option is likely to die and be broken into several smaller options.
* When mode-mouse is on (it is off by default), automatically enter copynicm2011-04-191-1/+8
| | | | | | mode when the mouse is dragged or the mouse wheel is used. Also exit copy mode when the mouse wheel is scrolled off the bottom. Discussed with and written by hsim at gmx dot li.
* Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262nicm2011-01-031-5/+17
| | | | | | | | | | and supports larger terminals than the older way. If the new mouse-utf8 option is on, UTF-8 mouse input is enabled for all UTF-8 terminals. The option defaults to on if LANG etc are set in the same manner as the utf8 option. With help and based on code from hsim at gmx.li.
* Last few tables that should be const.nicm2011-01-011-7/+7
|
* Support all four of the xterm mouse modes. Based on a diff from hsim atnicm2010-12-291-2/+2
| | | | gmx.li.
* Massive spaces->tabs and trailing whitespace cleanup, hopefully for the lastnicm2009-12-031-4/+4
| | | | | time now I've configured emacs to make them displayed in really annoying colours...
* Output the right keys for application and number keypad modes (they were thenicm2009-11-251-34/+34
| | | | wrong way round).
* Don't output rxvtisms either.nicm2009-11-101-23/+1
|
* It would help if I read my own comments... make alt keys work again by sendingnicm2009-11-041-4/+3
| | | | alt AND the key not alt instead of it.
* Convert the window pane (pty master side) fd over to use a bufferevent.nicm2009-11-041-10/+14
| | | | | The evbuffer API is very similar to the existing tmux buffer API so this was remarkably painless. Not many possible ways to do it, I suppose.