Commit Graph

365 Commits

Author SHA1 Message Date
50f8ead4e6 Don't log an error when doing the first check for move-window. 2015-12-13 17:58:26 +00:00
9b7697db62 Change cmd_find_target to use a state struct from the caller. 2015-12-13 16:44:35 +00:00
ae5ddfdc1a Merge branch 'obsd-master' 2015-12-13 16:01:13 +00:00
ff599f4004 Remove the cmd_find_{session,window,pane,index} functions (which are
just wrappers around cmd_find_target) and just use cmd_find_target
directly.
2015-12-13 15:32:12 +00:00
9d191a6093 Move logging into cmd_find_target rather than each function. 2015-12-13 15:00:37 +00:00
4a4daf1303 Instead of every command resolving the target (-t or -s) itself, prepare
the state (client, session, winlink, pane) for it it before entering the
command. Each command provides some flags that tell the prepare step
what it is expecting.

This is a requirement for having hooks on commands (for example, if you
hook "select-window -t1:2", the hook command should to operate on window
1:2 not whatever it thinks is the current window), and should allow some
other target improvements.

The old cmd_find_* functions remain for the moment but that layer will
be dropped later.

Joint work with Thomas Adam.
2015-12-13 14:32:38 +00:00
5862f59ed7 Conflicts:
Makefile
2015-12-08 07:11:09 +00:00
d2fb0efcd1 Add hooks infrastructure, basic commands (set-hook, show-hooks) and a
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.
2015-12-08 01:10:31 +00:00
9fe8b28746 Merge branch 'obsd-master' 2015-11-27 15:41:28 +00:00
6a2ca34216 Do not set a limit on the length of commands when printing them. 2015-11-27 15:06:43 +00:00
76688d2040 Merge branch 'obsd-master'
Conflicts:
	cfg.c
	tmux.c
2015-09-06 20:47:50 +01:00
2a836bc306 All the cmd_*_entry declarations do not need to be in tmux.h. 2015-09-01 09:48:34 +00:00
94a8ef1cae Merge branch 'obsd-master'
Conflicts:
	Makefile
	tmux.1
2015-04-27 21:21:55 +01:00
95195f5258 Rewrite of the target resolution internals to be simpler and more
consistent but with much less duplication, but keeping the same internal
API. Also adds more readable aliases for some of the special tokens used
in targets (eg "{start}" instead of "^"). Some behaviours may have
changed, for example prefix matches now happen before fnmatch.
2015-04-27 16:25:57 +00:00
72e9ebf2ec Merge branch 'obsd-master' 2015-04-25 20:45:02 +00:00
07dfdb974d Make message log a TAILQ. 2015-04-25 18:33:59 +00:00
6dbd63ba4f Move the functions to convert ids from strings into session.c and window.c. 2015-04-25 18:09:28 +00:00
56e1132db4 Merge branch 'obsd-master' 2015-04-25 10:02:46 +00:00
aeedb464a6 Convert clients list into a TAILQ. 2015-04-24 23:17:11 +00:00
0a88377086 Merge branch 'obsd-master' 2015-04-22 10:05:54 +01:00
3909aff06a Look up indexes as number before name, makes more sense if windows are
named starting with numbers. From Thomas Adam.
2015-04-21 22:42:27 +00:00
b25dc423b0 Merge branch 'obsd-master' 2015-04-20 15:44:27 +01:00
bf635e7741 Rewrite of tmux mouse support which was a mess. Instead of having
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.
2015-04-19 21:34:21 +00:00
747cab4281 No need for $Id$ now. 2014-11-08 12:27:43 +00:00
562af864bd Merge branch 'obsd-master'
Conflicts:
	Makefile
	cmd-list-commands.c
	cmd-suspend-client.c
	job.c
	tmux.h
	xmalloc.c
2014-10-21 07:11:44 +01:00
a27ba6e380 Add xreallocarray and remove nmemb argument from xrealloc. 2014-10-08 17:35:58 +00:00
a54b0055f6 Support using pane id as part of session or window specifier (so %1
means session-of-%1 or window-of-%1) and window id as part of session
(so @1 means session-of-@1).
2014-09-25 12:51:40 +00:00
304f86cdbb Support ! for last pane. 2014-09-25 12:45:35 +00:00
a131b82e95 Merge branch 'obsd-master'
Conflicts:
	client.c
2014-08-09 20:31:36 +01:00
c5253ad8f7 Show an error if cmd_find_session can't find the current session, like
the other functions.
2014-07-13 20:57:46 +00:00
bae95844d7 Merge branch 'obsd-master'
Conflicts:
	format.c
	window.c
2014-05-13 21:58:48 +01:00
b3e8d440ed If multiple arguments are given to new-session, new-window,
split-window, respawn-window or respawn-pane, pass them directly to
execvp() to help avoid quoting problems. One argument still goes to "sh
-c" like before. Requested by many over the years. Patch from J Raynor.
2014-05-13 08:08:32 +00:00
f4ffaf5a7f Just use char ** for argv like normal people, not char *const *. 2014-05-09 09:11:24 +00:00
953c3ef47a Merge branch 'obsd-master'
Conflicts:
	Makefile
	tmux.1
	window.c
2014-04-23 11:26:11 +01:00
14a96df9ee Remove the choose-list command to prepare for some later choose-* work. 2014-04-16 21:02:41 +00:00
18cb135218 Don't write into buffer if no arguments, reported by Filipe Rosset. 2014-03-31 21:32:31 +00:00
0bb9d51965 Don't write into buffer if no arguments, reported by Filipe Rosset. 2014-02-26 21:42:59 +00:00
d02c4bda3a Merge branch 'obsd-master' 2014-01-20 10:48:12 +00:00
1a0d3cd5d3 Allow attach-session -t to accept a window and pane to select them on
attach. Based on a diff from J Raynor.
2014-01-09 14:20:55 +00:00
c1ccefc62d We accidentally haven't been using $TMUX to work out the session for a
while and in fact it is less useful that using the client ttyname. So
don't bother and don't pass it from the client. If we need it in future
it is in c->environ.
2013-10-10 12:29:35 +00:00
6ac7abe8f0 Remove now unused cmd_get_default_path. 2013-10-10 12:28:56 +00:00
b822d24b15 Support -c for new-session, based on code from J Raynor. 2013-10-10 12:07:36 +00:00
e9b09faab2 We accidentally haven't been using $TMUX to work out the session for a while
and in fact it is less useful that using the client ttyname. So don't bother
and don't pass it from the client. If we need it in future it is in c->environ.
2013-10-06 22:38:33 +01:00
5ea6148362 Remove now unused cmd_get_default_path. 2013-10-06 21:35:44 +01:00
9389cfbec9 Support -c for new-session, based on code from J Raynor. 2013-10-01 23:48:03 +01:00
a36da3a878 Remove the barely-used and unnecessary command check() function. 2013-08-21 18:01:40 +01:00
76cb088d16 Merge branch 'obsd-master'
Conflicts:
	tmux.h
2013-05-25 11:48:12 +01:00
25c430b1cd Reserve space for \0 in cmd_print, from George Nachman. 2013-05-15 15:34:09 +00:00
b5fda7ad2a Spacing, warning nits. 2013-03-25 12:00:30 +00:00
673eb160d4 Sort includes and fix spaces. 2013-03-25 11:53:54 +00:00