Commit Graph

2283 Commits

Author SHA1 Message Date
nicm
bee95bf378 Spacing nits. 2016-12-09 21:39:27 +00:00
nicm
2a7b4bb017 Fix send-keys with UTF-8. 2016-12-08 22:15:37 +00:00
nicm
5819d2a9d7 Do not clear the prompt when a message is shown, just leave it around and
return to it when the message is finished.
2016-12-07 23:03:04 +00:00
nicm
5ea143f521 Only skip moving the cursor if it is already in the last position _on
the same line_, fixes redraw bug reported by patrick keshishian.
2016-12-07 09:16:55 +00:00
nicm
a8f3ad4487 Make prefix work in all tables (except the prefix table). Users who want
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@.
2016-12-07 09:16:13 +00:00
nicm
1a6156d8fd Fix check for cursor at end of line. 2016-11-30 13:20:02 +00:00
nicm
6b46c62bb4 Make send -N work for all keys, not just in copy mode. From Artem Fokin. 2016-11-29 12:54:46 +00:00
nicm
9fc925ac51 When comparing ocy to orlower in tty_cmd_cell, there is no need to add
yoff (because they are both already relative to the pane). Also fix some
other minor nits.
2016-11-28 17:50:00 +00:00
nicm
6f8cedb1bc The mouse valid flag needs to be correct before we fire the dragging
callback, so move the callback outside of server_client_check_mouse and
use a new special key code to indicate it.
2016-11-24 18:45:45 +00:00
nicm
84319aa8f0 If in the middle of a drag, don't use an invalid key, just use
KEYC_MOUSE as a placeholder. Reported by Artem Fokin.
2016-11-24 14:38:55 +00:00
nicm
0d1be2e328 Fix so that we work out the right pane from mouse events - we were doing
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.
2016-11-24 13:46:50 +00:00
nicm
7e6c2cb238 Make the selection able to exist independent of the cursor position, so
that it is not affected by scrolling. If MouseDragEnd1Pane is bound to
the new "stop-selection" command:

    bind -Tcopy-mode MouseDragEnd1Pane stop-selection

A selection made with the mouse will stay as it is after button 1 is
released. (It also works bound to a key.)

From Artem Fokin.
2016-11-24 13:38:44 +00:00
nicm
6de466cf8b For mouse keys, use the mouse pane as the default current pane. 2016-11-23 17:01:24 +00:00
nicm
24916f2f6e Error on invalid modifier keys. 2016-11-23 16:44:42 +00:00
nicm
3cf19d6dd0 Key running commands for #() by the unexpanded command, and run them
again if the expanded form changes (otherwise at most once per second as
usual). Fixes issues reported by Gregory Pakosz.
2016-11-17 10:06:08 +00:00
nicm
ddf7ac5ae4 Fix calculation of whether we need a region for drawing a cell (only if
full width and at the edge of the region), otherwise clear the region entirely.
2016-11-16 13:31:22 +00:00
nicm
a8e2d851fe Don't error if renaming a session to its current name, from shik dot
chen at gmail dot com.
2016-11-16 11:41:17 +00:00
nicm
81f1d625af Do not stop dragging when the wheel is pressed, from Artem Fokin. 2016-11-16 11:37:16 +00:00
nicm
5636d38a9d Initialize modeprefix to 1 properly in window_pane_create, from Artem Fokin. 2016-11-16 09:22:16 +00:00
nicm
e88b74350f The target validity check used window_pane_visible but that may be false
if the pane is zoomed, so instead add a new function to just check if
the pane is actually on screen (most commands still want to accept panes
invisible by zoom). Also reject panes outside the window for various
special targets. Problem reported by Sean Haugh.
2016-11-16 00:24:03 +00:00
nicm
c34a79b152 Turn on margins, with a couple of fixes (only limit to the pane for line
feeds, and do not move cursor to end for full width panes).
2016-11-15 15:17:28 +00:00
nicm
d81a5c630f And of course I just find a bug, disable previous for now. 2016-11-15 14:08:27 +00:00
nicm
0ace779cde Initial attempt to make use of left and right margins if the terminal
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.
2016-11-15 14:02:32 +00:00
nicm
9fe43d6acb Add copy-pipe-and-cancel, from Artem Fokin. 2016-11-15 09:53:23 +00:00
nicm
afbf0d42a7 rotate-window needs to unzoom, problem reported by Sean Haugh. 2016-11-14 16:27:12 +00:00
nicm
db2412e2ac Apply the right fix for run -b, used the wrong diff before. 2016-11-12 19:05:53 +00:00
nicm
b7398a4918 Do not execute commands for a client until it has identified, fixes
problem reported by Frank Terbeck.
2016-11-12 19:04:41 +00:00
nicm
36f8fa316d Do not crash with run-shell -b and no window pane available, reported by
Sergei Dyshel.
2016-11-11 11:37:25 +00:00
nicm
f947d25c9d Do not try to set the CHANGED flag on windows with no active pane, fixes
problem reported by Nelo-T Wallus.
2016-11-04 18:56:25 +00:00
nicm
353439acee enum values need to fit in 32 bits; we only use enum for numbering and
Unicode characters fit in 24 bits, so we can leave key_code as 64 bits
and change KEYC_BASE down to 0x10000000.
2016-11-04 14:47:38 +00:00
nicm
382e09bed1 Make an empty state on error rather than leaving something partially
created (which now is now a fatal() later).
2016-11-02 13:35:36 +00:00
nicm
c83feeb6f8 Clear window alert flags after setting winlink alert flags, fixes problem
reported by Tommy Allen.
2016-11-01 09:07:18 +00:00
nicm
abea17afd9 Buffer name can be NULL, check before strdup(). 2016-10-26 11:48:07 +00:00
nicm
99946aaaaf Do not handle activity or silence alerts in the current window, reported
by jasper@.
2016-10-25 07:24:10 +00:00
nicm
8084a2c9e6 Add %%% to substitute with quotes escaped (convert " to \"). Use this
for the prompts in copy mode. Fixes problems with jumping to ' reported
by Theo Buehler.
2016-10-21 13:51:59 +00:00
nicm
99c262b7d0 Do not have a default binding for C-b in copy-mode-vi or it conflicts
with the default prefix. Reported by natano@.
2016-10-19 09:24:57 +00:00
nicm
899e629bf0 Alerts are too slow, so rather than walking all sessions and windows,
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).
2016-10-19 09:22:07 +00:00
nicm
bc27451e15 Move session-create hook out of session_create so it works with grouped sessions. 2016-10-19 08:17:11 +00:00
nicm
e0e9a54a32 Clear cell entry with grid_default_entry not grid_default_cell. 2016-10-18 19:52:49 +00:00
nicm
fb109ae97d xterm-keys was in the wrong place in the list; Dilyan Palauzov. 2016-10-18 19:25:26 +00:00
nicm
a0998e42b7 Make grid_clear_cell set up the entry properly for 256 and RGB cells. 2016-10-18 14:56:17 +00:00
nicm
cf7289662f Tweak a couple of log statements. 2016-10-18 12:51:26 +00:00
nicm
2e5c49a1fd Give each item on queue a name for better logging. 2016-10-18 08:46:43 +00:00
nicm
8763bced76 Zero dirty count after flushing. 2016-10-18 08:39:18 +00:00
nicm
c2f88373e7 Store the right size in the pipe offset for pipe-pane. 2016-10-18 07:38:16 +00:00
nicm
fe106842c8 Use notifys for alerts too. 2016-10-16 22:18:04 +00:00
nicm
41e633acf5 Use the notify name string instead of going via an enum and change
existing hooks to use notifys instead.
2016-10-16 22:06:40 +00:00
nicm
d15d54c2c8 Add hook_session and hook_window formats to get information on the
affected session or window when a hook fires. Enable session-created and
session-closed hooks now that that is available.
2016-10-16 19:55:52 +00:00
nicm
3f35b5299f Provide a way for hooks to tag formats onto the commands they fire so
that the user can get at additional information - now used for the
"hook" format, more to come.
2016-10-16 19:36:37 +00:00
nicm
026ad08b56 Notifys can go via the command queue instead of using their own queue. 2016-10-16 19:15:02 +00:00