Commit Graph

1212 Commits (3f54c9292fc8ee147d45256e430fbf85fab98128)

Author SHA1 Message Date
Thomas Adam be10e8eee6 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-11-08 21:27:40 +00:00
Nicholas Marriott c68efec6c0 Show last client activity time in default choose-client list. 2012-11-05 13:13:04 +00:00
Thomas Adam 47fbf87185 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-10-26 20:28:58 +01:00
Nicholas Marriott d210d99cce Make mouse event structure clearer by defining events (up, click, drag)
and simplifying how buttons and wheels are represented, from Ailin
Nemui. Should be no functional changes.
2012-10-26 14:35:42 +00:00
Thomas Adam 619ffe1f4f Merge branch 'obsd-master'
Sync from OpenBSD.

* obsd-master:
  Allow session tree (C-b s) to expand and collapse sessions with left/right/space keys. From Thomas Adam.
  Remove some out of date text from man page, from Thomas Adam.
2012-10-02 10:47:16 +01:00
Nicholas Marriott 9107b0c69a Allow session tree (C-b s) to expand and collapse sessions with
left/right/space keys. From Thomas Adam.
2012-10-02 08:16:28 +00:00
Thomas Adam 48750022c0 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-09-25 17:05:36 +01:00
Nicholas Marriott 17bbf90393 Add notification for input from a pane, from George Nachman. 2012-09-25 07:41:22 +00:00
Nicholas Marriott 149f5bac05 Merge branch 'master' of ssh://tmux.git.sourceforge.net/gitroot/tmux/tmux
Conflicts:
	cmd.c
	format.c
	osdep-openbsd.c
2012-09-25 08:07:39 +01:00
Thomas Adam e342304134 Merge branch 'obsd-master'
Conflicts:
	cmd.c
	format.c
	osdep-openbsd.c
	tmux.h
2012-09-24 17:55:06 +01:00
Nicholas Marriott 84612a8196 Add control_write_buffer, from George Nachman. 2012-09-24 13:39:10 +00:00
Nicholas Marriott 5d60bc7f7c Use pgrp of pty fd not pid of immediate child when recovering current working
directory (like current process). From Marcel Partap.
2012-09-24 14:05:38 +01:00
Nicholas Marriott 42272dfbd5 Use pgrp of pty fd not pid of immediate child when recovering current
working directory (like current process). From Marcel Partap.
2012-09-24 13:05:10 +00:00
Nicholas Marriott c914fcfacb When choosing a pane found by find-window, switch to that pane rather
than just the window. Also use a helper function for the inner loop.
2012-09-04 22:37:31 +01:00
Nicholas Marriott 28fd3a3835 add cmd-choose-list to allow arbitrary options to be selected. From
Thomas Adam.
2012-09-04 22:37:29 +01:00
Nicholas Marriott 41a448193f Send notifications to control clients. Also don't redraw client when
suspended.
2012-09-04 22:36:47 +01:00
Nicholas Marriott 9e7bbc7281 When choosing a pane found by find-window, switch to that pane rather
than just the window. Also use a helper function for the inner loop.
2012-09-03 12:20:17 +00:00
Nicholas Marriott 7263fa36eb add cmd-choose-list to allow arbitrary options to be selected. From
Thomas Adam.
2012-09-03 09:57:57 +00:00
Nicholas Marriott 9247c90d69 Send notifications to control clients. Also don't redraw client when
suspended.
2012-09-03 09:32:38 +00:00
Tiago Cunha 56e37487a8 Sync OpenBSD patchset 1165:
Fix up window reference counting and don't crash if the rename timer
fires while the window is dead but still referenced. Fixes problem
reported by Michael Scholz.
2012-08-31 09:22:08 +00:00
Tiago Cunha 1c608031b5 Sync OpenBSD patchset 1162:
Use a separate define for each default format template and strip clutter
from the choose-tree defaults.
2012-08-31 09:18:50 +00:00
Nicholas Marriott 58e8e0eac8 Fix up window reference counting and don't crash if the rename timer
fires while the window is dead but still referenced. Fixes problem
reported by Michael Scholz.
2012-08-21 10:00:33 +00:00
Nicholas Marriott 73c6785538 Use a separate define for each default format template and strip clutter
from the choose-tree defaults.
2012-08-14 08:51:53 +00:00
Tiago Cunha 200b0e5821 Sync OpenBSD patchset 1156:
Instead of numbering choose mode items 0-9a-z and then nothing, number
them all and if there are more than 10 use a prompt when 0-9 is
pressed. From Thomas Adam.
2012-08-12 19:28:20 +00:00
Tiago Cunha c8849ac990 Sync OpenBSD patchset 1153:
Add a queue of notifys and a way to turn them off and on (we do not want
notifys to happen during some commands). Based on code from George
Nachman.
2012-08-12 19:23:01 +00:00
Nicholas Marriott a3dec6bece Instead of numbering choose mode items 0-9a-z and then nothing, number
them all and if there are more than 10 use a prompt when 0-9 is
pressed. From Thomas Adam.
2012-08-11 06:45:33 +00:00
Nicholas Marriott 5385a9bb34 Add a queue of notifys and a way to turn them off and on (we do not want
notifys to happen during some commands). Based on code from George
Nachman.
2012-07-13 06:27:41 +00:00
Tiago Cunha 1f5e6e35d5 Sync OpenBSD patchset 1151:
Make command exec functions return an enum rather than -1/0/1 values and
add a new value to mean "leave client running but don't attach" to fix
problems with using some commands in a command sequence. Most of the
work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
2012-07-11 19:37:32 +00:00
Tiago Cunha a432fcd306 Sync OpenBSD patchset 1150:
xfree is not particularly helpful, remove it. From Thomas Adam.
2012-07-11 19:34:16 +00:00
Tiago Cunha a10143a2d1 Sync OpenBSD patchset 1146:
Add choose-tree command to show windows and sessions in the same
list. Change choose-window and -session to use the same code. From
Thomas Adam.
2012-07-11 17:13:55 +00:00
Tiago Cunha 38530de622 Sync OpenBSD patchset 1144:
Clear flags across all sessions, from Thomas Adam.
2012-07-11 17:06:11 +00:00
Nicholas Marriott ede8312d59 Make command exec functions return an enum rather than -1/0/1 values and
add a new value to mean "leave client running but don't attach" to fix
problems with using some commands in a command sequence. Most of the
work by Thomas Adam, problem reported by "jspenguin" on SF bug 3535531.
2012-07-11 07:10:15 +00:00
Nicholas Marriott df912e3540 xfree is not particularly helpful, remove it. From Thomas Adam. 2012-07-10 11:53:01 +00:00
Nicholas Marriott f20c6fe009 Add choose-tree command to show windows and sessions in the same
list. Change choose-window and -session to use the same code. From
Thomas Adam.
2012-07-08 16:04:38 +00:00
Nicholas Marriott 63f5c38023 Clear flags across all sessions, from Thomas Adam. 2012-07-08 07:27:32 +00:00
Tiago Cunha 7e02d2f459 Sync OpenBSD patchset 1143:
Provide common helper function for adding windows and sessions to choose
lists and expand %% in command before using it rather than at callback
time. From Thomas Adam.
2012-07-04 11:03:20 +00:00
Tiago Cunha 5761712799 Sync OpenBSD patchset 1142:
Clean up and simplify the choose mode code, from Thomas Adam.
2012-07-04 11:01:00 +00:00
Nicholas Marriott 67b926cf3c Provide common helper function for adding windows and sessions to choose
lists and expand %% in command before using it rather than at callback
time. From Thomas Adam.
2012-06-25 14:27:25 +00:00
Nicholas Marriott 5b6f78186c Clean up and simplify the choose mode code, from Thomas Adam. 2012-06-25 14:08:55 +00:00
Tiago Cunha 0159c74a32 Sync OpenBSD patchset 1138:
Add a skeleton mode to tmux (called "control mode") that let's tmux
commands be sent and output received on stdout. This can be used to
integrate with other terminal emulators and should allow some other
things to be made simpler later. More to come so doesn't do much yet and
deliberately not documented.
2012-06-18 15:23:01 +00:00
Nicholas Marriott 2942eca895 Add a skeleton mode to tmux (called "control mode") that let's tmux
commands be sent and output received on stdout. This can be used to
integrate with other terminal emulators and should allow some other
things to be made simpler later. More to come so doesn't do much yet and
deliberately not documented.
2012-06-18 13:16:42 +00:00
Tiago Cunha 7c7bd14c61 Sync OpenBSD patchset 1125:
Strip layout from choose-windows again (leave in list-windows),
suggested by Romain Francoise, diff from Thomas Adam.
2012-05-30 13:45:16 +00:00
Tiago Cunha 30b23baaf5 Sync OpenBSD patchset 1124:
Fix client templates, from Romain Francoise.
2012-05-30 13:44:13 +00:00
Tiago Cunha 169d362945 Sync OpenBSD patchset 1123:
Simplify logging and just fprintf(stderr, ...) for early errors.
2012-05-30 13:42:57 +00:00
Tiago Cunha c6fc8771a9 Sync OpenBSD patchset 1122:
Use a predefined structure for not-space cells used to set attributes.
2012-05-30 13:41:58 +00:00
Nicholas Marriott 1845800651 Strip layout from choose-windows again (leave in list-windows),
suggested by Romain Francoise, diff from Thomas Adam.
2012-05-28 07:59:07 +00:00
Nicholas Marriott 993f1b96a3 Fix client templates, from Romain Francoise. 2012-05-27 21:43:57 +00:00
Nicholas Marriott 196710e2d3 Simplify logging and just fprintf(stderr, ...) for early errors. 2012-05-25 08:28:10 +00:00
Nicholas Marriott 1f23f6d686 Use a predefined structure for not-space cells used to set attributes. 2012-05-23 19:19:40 +00:00
Tiago Cunha 17da2f7d5f Sync OpenBSD patchset 1121:
Store client in tty struct directly instead of using a callback function
pointer.
2012-05-22 21:05:30 +00:00
Tiago Cunha fff7c0b276 Sync OpenBSD patchset 1120:
Store mouse data in tty structure not on the stack.
2012-05-22 21:04:25 +00:00
Tiago Cunha 5cc4961fd2 Sync OpenBSD patchset 1119:
Switch all of the various choose- and list- commands over to the format
infrastructure, from Thomas Adam.
2012-05-22 21:03:25 +00:00
Tiago Cunha baafc17a1e Sync OpenBSD patchset 1118:
Add a helper function to send ready message.
2012-05-22 20:59:58 +00:00
Tiago Cunha d9cb07df3b Sync OpenBSD patchset 1116:
If there are any terminals with insert mode but not ich1, they can go
through the slow path. Tidies code slightly.
2012-05-22 20:58:33 +00:00
Tiago Cunha ffab6dbc9a Sync OpenBSD patchset 1114:
Instead of passing stdin/stdout/stderr file descriptors over imsg and
handling them in the server, handle them in the client and pass buffers
over imsg. This is much tidier for some upcoming changes and the
performance hit isn't critical.

The tty fd is still passed to the server as before.

This bumps the tmux protocol version so new clients and old servers are
incompatible.
2012-05-22 20:56:35 +00:00
Nicholas Marriott 84c708f355 Store client in tty struct directly instead of using a callback function
pointer.
2012-05-22 14:32:28 +00:00
Nicholas Marriott fe4f00834d Store mouse data in tty structure not on the stack. 2012-05-22 14:11:30 +00:00
Nicholas Marriott ebf94bc9cb Switch all of the various choose- and list- commands over to the format
infrastructure, from Thomas Adam.
2012-05-22 11:35:37 +00:00
Nicholas Marriott 682884edc5 Add a helper function to send ready message. 2012-05-22 10:56:48 +00:00
Nicholas Marriott 2f93affb98 If there are any terminals with insert mode but not ich1, they can go
through the slow path. Tidies code slightly.
2012-05-22 09:36:12 +00:00
Nicholas Marriott 7a4679a17f Instead of passing stdin/stdout/stderr file descriptors over imsg and
handling them in the server, handle them in the client and pass buffers
over imsg. This is much tidier for some upcoming changes and the
performance hit isn't critical.

The tty fd is still passed to the server as before.

This bumps the tmux protocol version so new clients and old servers are
incompatible.
2012-05-21 18:27:42 +00:00
Tiago Cunha 1340c012b0 Sync OpenBSD patchset 1111:
Add a helper function to open the terminal for attach-/new-session.
2012-05-12 15:00:19 +00:00
Nicholas Marriott 37f9bb46d8 Add a helper function to open the terminal for attach-/new-session. 2012-05-06 07:38:17 +00:00
Tiago Cunha b728970c65 Sync OpenBSD patchset 1104:
Add a flag to move-window to renumber the windows in a session (closing
any gaps) and add an option to do this automatically each time a window
is killed. From Thomas Adam.
2012-05-03 17:51:04 +00:00
Tiago Cunha d0907861f9 Sync OpenBSD patchset 1102:
Add a buffer with all input from last ground state, will be used for
control mode. From George Nachman.
2012-05-03 16:55:48 +00:00
Nicholas Marriott a6c22d650b Add a flag to move-window to renumber the windows in a session (closing
any gaps) and add an option to do this automatically each time a window
is killed. From Thomas Adam.
2012-04-29 17:20:01 +00:00
Nicholas Marriott ff5155f719 Add a buffer with all input from last ground state, will be used for
control mode. From George Nachman.
2012-04-25 21:12:49 +00:00
Tiago Cunha bae2701289 Sync OpenBSD patchset 1092:
Stop accepting new clients for 1 second on EMFILE/ENFILE. Based on
ongoing fixes to other daemons by Theo.
2012-04-12 12:43:40 +00:00
Nicholas Marriott 6703ca8d26 Stop accepting new clients for 1 second on EMFILE/ENFILE. Based on
ongoing fixes to other daemons by Theo.
2012-04-11 06:16:14 +00:00
Tiago Cunha 14e5cdf02e Sync OpenBSD patchset 1090:
Fix comment for mouse bits.
2012-04-10 09:56:04 +00:00
Tiago Cunha f99de22808 Sync OpenBSD patchset 1084:
Add a layout history which can be stepped through with select-layout -u
and -U commands (bound to 'u' and 'U' by default).
2012-04-10 09:52:45 +00:00
Nicholas Marriott ed54f01d2f Fix comment for mouse bits. 2012-04-01 21:45:48 +00:00
Nicholas Marriott 85f5485cb5 Add a layout history which can be stepped through with select-layout -u
and -U commands (bound to 'u' and 'U' by default).
2012-04-01 13:18:38 +00:00
Tiago Cunha f9f6eea444 Sync OpenBSD patchset 1072:
Add a simple form of output rate limiting by counting the number of
certain C0 sequences (linefeeds, backspaces, carriage returns) and if it
exceeds a threshold (current default 50/millisecond), start to redraw
the pane every 100 milliseconds instead of making each change as it
comes. Two configuration options - c0-change-trigger and
c0-change-interval.

This makes tmux much more responsive under very fast output (for example
yes(1) or accidentally cat'ing a large file) but may not be perfect on
all terminals and connections - feedback very welcome, particularly
where this change has a negative rather than positive effect (making it
off by default is a possibility).

After much experimentation based originally on a request Robin Lee
Powell (which ended with a completely different solution), this idea
from discussion with Ailin Nemui.
2012-03-29 21:05:16 +00:00
Nicholas Marriott f59971276a Add a simple form of output rate limiting by counting the number of
certain C0 sequences (linefeeds, backspaces, carriage returns) and if it
exceeds a threshold (current default 50/millisecond), start to redraw
the pane every 100 milliseconds instead of making each change as it
comes. Two configuration options - c0-change-trigger and
c0-change-interval.

This makes tmux much more responsive under very fast output (for example
yes(1) or accidentally cat'ing a large file) but may not be perfect on
all terminals and connections - feedback very welcome, particularly
where this change has a negative rather than positive effect (making it
off by default is a possibility).

After much experimentation based originally on a request Robin Lee
Powell (which ended with a completely different solution), this idea
from discussion with Ailin Nemui.
2012-03-20 11:01:00 +00:00
Tiago Cunha df31f1dfc9 Sync OpenBSD patchset 1070:
On xterm 271 and later, put the terminal into SCL 5 and use DECCRA for
scrolling the region in panes (if the large region check isn't
hit). With help from Ailin Nemui.
2012-03-18 02:25:26 +00:00
Tiago Cunha f41efd9d89 Sync OpenBSD patchset 1069:
Add notify hooks for various events, the functions are currently empty
stubs but will be filled in for control mode later. From George Nachman.
2012-03-18 02:22:09 +00:00
Tiago Cunha be4d77e60f Sync OpenBSD patchset 1062:
Break out termios initialization into a separate function, from George
Nachman.
2012-03-18 02:03:15 +00:00
Tiago Cunha 070d266aae Sync OpenBSD patchset 1054:
Send secondary DA to terminals with XT in terminfo when starting up and
parse it to work out the xterm version.
2012-03-18 01:55:45 +00:00
Tiago Cunha 166681eee9 Sync OpenBSD patchset 1045:
Remove some bits leftover from unused backoff code.
2012-03-18 01:33:56 +00:00
Tiago Cunha 40b1d64ce7 Sync OpenBSD patchset 1043:
Use a lock file and flock() to serialize server start, avoids problems
when running a bunch of tmux from cron at the same time. Based on a diff
from Tim Ruehsen.
2012-03-18 01:28:10 +00:00
Nicholas Marriott d8805af66b On xterm 271 and later, put the terminal into SCL 5 and use DECCRA for
scrolling the region in panes (if the large region check isn't
hit). With help from Ailin Nemui.
2012-03-17 22:56:04 +00:00
Nicholas Marriott 46210344a6 Add notify hooks for various events, the functions are currently empty
stubs but will be filled in for control mode later. From George Nachman.
2012-03-17 22:35:09 +00:00
Nicholas Marriott 889fe42e11 Break out termios initialization into a separate function, from George
Nachman.
2012-03-17 21:27:51 +00:00
Nicholas Marriott c8c0d68128 Send secondary DA to terminals with XT in terminfo when starting up and
parse it to work out the xterm version.
2012-03-15 10:36:00 +00:00
Nicholas Marriott 799f437eff Remove some bits leftover from unused backoff code. 2012-03-09 21:42:13 +00:00
Nicholas Marriott ac9ebc29a2 Use a lock file and flock() to serialize server start, avoids problems
when running a bunch of tmux from cron at the same time. Based on a diff
from Tim Ruehsen.
2012-03-09 09:57:40 +00:00
Tiago Cunha 32a6092f71 Sync OpenBSD patchset 1039:
Add A and I keys for vi status line editing.
2012-03-07 13:37:44 +00:00
Tiago Cunha 3275e9bd5b Sync OpenBSD patchset 1037:
Support "bracketed paste" mode. This adds a -p flag to paste-buffer - if
this is used and the application has requested bracketed pastes, then
tmux surrounds the pasted text by \033[200~ and \033[201~. Applications
like vim can (apparently) use this to avoid, for example, indenting the
text. From Ailin Nemui.
2012-03-07 13:36:19 +00:00
Tiago Cunha 9d79a56402 Sync OpenBSD patchset 1036:
The wlmouse offset should be part of the client, not the server. From
Ailin Nemui.
2012-03-07 13:35:03 +00:00
Nicholas Marriott 30f4c30ca3 Add A and I keys for vi status line editing. 2012-03-04 07:38:11 +00:00
Nicholas Marriott f4fdddc930 Support "bracketed paste" mode. This adds a -p flag to paste-buffer - if
this is used and the application has requested bracketed pastes, then
tmux surrounds the pasted text by \033[200~ and \033[201~. Applications
like vim can (apparently) use this to avoid, for example, indenting the
text. From Ailin Nemui.
2012-03-03 09:43:22 +00:00
Tiago Cunha e4f1fbd008 Sync OpenBSD patchset 1035:
Add move-pane command (like join-pane but allows the same window). Also
-b flag to join-pane and move-pane to place the pane to the left or
above. From George Nachman.
2012-03-03 09:19:40 +00:00
Tiago Cunha 89ab147093 Sync OpenBSD patchset 1034:
Add printf attribute to a couple of functions, from Tim Ruehsen.
2012-03-03 09:17:30 +00:00
Tiago Cunha 95f427c34e Sync OpenBSD patchset 1032:
Allow a single option to be specified to show-options to show just that
option.
2012-03-03 09:16:52 +00:00
Nicholas Marriott 4b8bb7770f The wlmouse offset should be part of the client, not the server. From
Ailin Nemui.
2012-03-03 08:55:56 +00:00
Nicholas Marriott 07ac16807f Add move-pane command (like join-pane but allows the same window). Also
-b flag to join-pane and move-pane to place the pane to the left or
above. From George Nachman.
2012-03-03 08:31:18 +00:00
Nicholas Marriott 4d9ccd3229 Add printf attribute to a couple of functions, from Tim Ruehsen. 2012-03-02 11:16:44 +00:00
Nicholas Marriott 4e7de210e4 Allow a single option to be specified to show-options to show just that
option.
2012-02-25 12:57:42 +00:00
Tiago Cunha 290636bc86 Sync OpenBSD patchset 1029:
Add a wrapper function tty_set_size from George Nachman.
2012-02-15 19:32:12 +00:00
Nicholas Marriott fddbd44c18 Add a wrapper function tty_set_size from George Nachman. 2012-02-15 17:25:02 +00:00
Tiago Cunha c82e06804e Sync OpenBSD patchset 1024:
Move window name changes into wrapper function window_set_name, from
George Nachman.
2012-02-02 02:00:12 +00:00
Tiago Cunha 4bb01c1768 Sync OpenBSD patchset 1021:
Provide defined ways to set the various default-path possibilities: ~
for home directory, . for server start directory, - for session start
directory and empty for the pane's working directory (the default). All
can also be used as part of a relative path (eg -/foo). Also provide -c
flags to neww and splitw to override default-path setting.

Based on a diff from sthen. ok sthen
2012-02-02 01:55:34 +00:00
Nicholas Marriott 8363d19307 Move window name changes into wrapper function window_set_name, from
George Nachman.
2012-02-02 00:10:11 +00:00
Nicholas Marriott 908a22e41c Provide defined ways to set the various default-path possibilities: ~
for home directory, . for server start directory, - for session start
directory and empty for the pane's working directory (the default). All
can also be used as part of a relative path (eg -/foo). Also provide -c
flags to neww and splitw to override default-path setting.

Based on a diff from sthen. ok sthen
2012-01-31 15:52:21 +00:00
Tiago Cunha 2ee0d851d9 Sync OpenBSD patchset 1017:
Give each window a unique id, like panes but prefixed with @. Based on
work from George Nachman.
2012-01-31 12:01:43 +00:00
Nicholas Marriott 0e59bc75fd Give each window a unique id, like panes but prefixed with @. Based on
work from George Nachman.
2012-01-30 09:39:34 +00:00
Tiago Cunha e4a7cefe0c Sync OpenBSD patchset 1015:
Add an option to move the status line to the top of the screen,
requested by many.
2012-01-29 12:57:01 +00:00
Nicholas Marriott 230d0fbc9e Add an option to move the status line to the top of the screen,
requested by many.
2012-01-29 09:37:02 +00:00
Tiago Cunha a34a72d2d9 Sync OpenBSD patchset 1011:
Remove unused backoff code that doesn't do any good.
2012-01-23 12:24:00 +00:00
Nicholas Marriott 678e67437f Remove unused backoff code that doesn't do any good. 2012-01-21 23:51:34 +00:00
Tiago Cunha a3c1b730c9 Sync OpenBSD patchset 1008:
Use RB trees not SPLAY.
2012-01-21 19:38:26 +00:00
Tiago Cunha a7b0b30bdd Sync OpenBSD patchset 1007:
Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.

Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.

People who want three prefix keys are out of luck :-).
2012-01-21 19:36:40 +00:00
Tiago Cunha 4bea559037 Sync OpenBSD patchset 1004:
Add a -R flag to send-keys to reset the terminal. Written ages ago and
Suggested by someone, I forget who.
2012-01-21 19:31:59 +00:00
Nicholas Marriott 8ed9124f3f Use RB trees not SPLAY. 2012-01-21 11:12:13 +00:00
Nicholas Marriott 535286c05a Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.

Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.

People who want three prefix keys are out of luck :-).
2012-01-21 08:40:09 +00:00
Nicholas Marriott 66f04514cf Add a -R flag to send-keys to reset the terminal. Written ages ago and
Suggested by someone, I forget who.
2012-01-21 08:10:21 +00:00
Tiago Cunha 5434a2759a Sync OpenBSD patchset 1002:
Add some const and fix a warning.
2012-01-20 21:21:32 +00:00
Tiago Cunha b79189958f Sync OpenBSD patchset 998:
Add space movement keys for vi mode in the status line from Ben Boeckel.
2012-01-20 21:17:18 +00:00
Nicholas Marriott 8332413305 Add some const and fix a warning. 2012-01-20 19:54:07 +00:00
Nicholas Marriott e6519d3e27 Add space movement keys for vi mode in the status line from Ben Boeckel. 2012-01-20 19:10:29 +00:00
Nicholas Marriott c1b9948525 Change the way the working directory for new processes is discovered. If
default-path isn't empty, it is used. Otherwise:

1) If tmux neww is run from the command line, the working directory of the
client is used.

2) Otherwise use some platform specific code to retrieve the current working
directory of the process in the active pane.

3) If that fails, the directory where the session was created is used.

Idea and support code, Linux, Solaris, FreeBSD bits by Romain Francoise,
OpenBSD bits by me.
2011-12-09 16:37:29 +00:00
Nicholas Marriott f308ba93aa Change the way the working directory for new processes is discovered. If
default-path isn't empty, it is used. Otherwise:

1) If tmux neww is run from the command line, the working directory of the
   client is used.

2) Otherwise sysctl KERN_PROC_CWD is used to retrieve the current
   working directory of the process in the active pane.

3) If that fails, the directory where the session was created is used.

Support code by Romain Francois, OpenBSD specific bits by me.

Note this requires a recent userland and kernel with KERN_PROC_CWD.
2011-12-09 16:28:18 +00:00
Tiago Cunha 76862acf3e Sync OpenBSD patchset 986:
Support "jump to" like vi in copy mode using t and T keys. Also add x
and X for delete in edit mode.

From Ben Boeckel, thanks.
2011-12-06 18:50:26 +00:00
Nicholas Marriott e04d13f6a6 Support "jump to" like vi in copy mode using t and T keys. Also add x
and X for delete in edit mode.

From Ben Boeckel, thanks.
2011-12-04 16:18:01 +00:00
Tiago Cunha 774bffb3c6 Sync OpenBSD patchset 982:
Add word movement and editing command for command prompt editing, from
Ben Boeckel.
2011-11-25 13:34:20 +00:00
Tiago Cunha 9ec457575d Sync OpenBSD patchset 979:
Make window_pane_index work the same as window_index, from Ben Boeckel.
2011-11-25 13:30:45 +00:00
Nicholas Marriott fc5f8804ec Add word movement and editing command for command prompt editing, from
Ben Boeckel.
2011-11-15 23:34:12 +00:00
Nicholas Marriott 57df442916 Make window_pane_index work the same as window_index, from Ben Boeckel. 2011-11-15 23:19:51 +00:00
Tiago Cunha 03ee7f7edf Sync OpenBSD patchset 969:
Support for \e[3J to clear the history. Also send the corresponding
terminfo code (E3) before locking.
2011-10-23 15:10:22 +00:00
Tiago Cunha a8ca1340ad Sync OpenBSD patchset 968:
Try to resolve relative paths for loadb and saveb (first using client
working directory if any then default-path or session wd).
2011-10-23 15:08:58 +00:00
Tiago Cunha 1c1797e4f2 Sync OpenBSD patchset 965:
Add client formats, from Ben Boeckel.
2011-10-23 15:03:50 +00:00
Nicholas Marriott f0aad68aee Support for \e[3J to clear the history. Also send the corresponding
terminfo code (E3) before locking.
2011-10-23 10:16:14 +00:00
Nicholas Marriott 7ff4cf9405 Try to resolve relative paths for loadb and saveb (first using client
working directory if any then default-path or session wd).
2011-10-23 08:34:01 +00:00
Nicholas Marriott 16d75a6bf2 Add client formats, from Ben Boeckel. 2011-10-23 01:12:46 +00:00
Tiago Cunha 40af1a854c Sync OpenBSD patchset 953:
Add initial framework for more powerful formatting of command output and
use it for list-{panes,windows,sessions}. This allows more descriptive
replacements (such as #{session_name}) and conditionals.

Later this will be used for status_replace and list-keys and other
places.
2011-09-21 16:31:15 +00:00
Nicholas Marriott 4a5dff3f11 Add initial framework for more powerful formatting of command output and
use it for list-{panes,windows,sessions}. This allows more descriptive
replacements (such as #{session_name}) and conditionals.

Later this will be used for status_replace and list-keys and other
places.
2011-08-26 10:53:16 +00:00
Tiago Cunha c41a93d130 Sync OpenBSD patchset 949:
Add a tty_bell wrapper function, from Dylan Alex Simon.
2011-08-25 21:12:52 +00:00
Nicholas Marriott 029c34ce6b Add a tty_bell wrapper function, from Dylan Alex Simon. 2011-08-24 09:58:44 +00:00
Tiago Cunha e097f0b4ee Sync OpenBSD patchset 927:
Allow the initial context on prompts to be set with the new -I option to
command-prompt. From Tiago Cunha.
2011-07-03 21:52:50 +00:00
Tiago Cunha ff7343c203 Sync OpenBSD patchset 926:
PANE_FREEZE doesn't do anything anymore, so remove it.
2011-07-03 21:51:17 +00:00
Nicholas Marriott ad60a2c952 Allow the initial context on prompts to be set with the new -I option to
command-prompt. From Tiago Cunha.
2011-07-02 21:05:44 +00:00
Nicholas Marriott 1202284f37 PANE_FREEZE doesn't do anything anymore, so remove it. 2011-06-27 00:04:49 +00:00
Nicholas Marriott f513898e92 PatchSet 924
Date: 2011/06/05 12:19:03
Author: nicm
Branch: HEAD
Tag: (none)
Log:
Add a respawn-pane command, from Marcel Partap.
2011-06-23 19:23:12 +00:00
Nicholas Marriott fa0f10d77a PatchSet 923
Date: 2011/06/05 11:53:05
Author: nicm
Branch: HEAD
Tag: (none)
Log:
Get rid of the layout string code which tries to walk through the layout
hierarchy and instead just look at what panes are actually in the window.
2011-06-23 19:21:26 +00:00
Nicholas Marriott 65177b82be Add a respawn-pane command, from Marcel Partap. 2011-06-05 11:19:03 +00:00
Nicholas Marriott 2b60c648c4 Get rid of the layout string code which tries to walk through the layout
hierarchy and instead just look at what panes are actually in the window.
2011-06-05 10:53:05 +00:00
Tiago Cunha b2f301f4e2 Sync OpenBSD patchset 916:
Support DECSCUSR sequence to set the cursor style with two new
terminfo(5) extensions, Cs and Csr. Written by Ailin Nemui.
2011-05-22 16:26:09 +00:00
Tiago Cunha 719755574d Sync OpenBSD patchset 915:
Support xterm(1) cursor colour change sequences through terminfo(5) Cc
(set) and Cr (reset) extensions. Originally by Sean Estabrooks, tweaked
by me and Ailin Nemui.
2011-05-22 16:25:02 +00:00
Tiago Cunha 89f35125b4 Sync OpenBSD patchset 914:
Support setting the xterm clipboard when copying from copy mode using
the xterm escape sequence for the purpose (if xterm is configured to
allow it).

Written by and much discussed Ailin Nemui, guidance on
xterm/termcap/terminfo from Thomas Dickey.
2011-05-22 16:23:07 +00:00
Nicholas Marriott 3ea5e06bfb Support DECSCUSR sequence to set the cursor style with two new
terminfo(5) extensions, Cs and Csr. Written by Ailin Nemui.
2011-05-20 19:17:39 +00:00
Nicholas Marriott 944b5e6fa0 Support xterm(1) cursor colour change sequences through terminfo(5) Cc
(set) and Cr (reset) extensions. Originally by Sean Estabrooks, tweaked
by me and Ailin Nemui.
2011-05-20 19:03:58 +00:00
Tiago Cunha 69e0aabcdf Sync OpenBSD patchset 913:
Add three new copy-mode commands - select-line, copy-line,
copy-end-of-line. From Dave Disser and Randy Stauner a while back.
2011-05-18 20:35:36 +00:00
Tiago Cunha 4efd45628d Sync OpenBSD patchset 905:
Add a new option, mouse-resize-pane. When on, panes may be resized by
dragging their borders. From hsim at gmx.li.
2011-05-18 20:30:14 +00:00
Tiago Cunha 4fcbf4b872 Sync OpenBSD patchset 904:
Use the tsl and fsl terminfo(5) capabilities to update terminal title
and automatically fill them in on terminals with the XT capability
(which means their title setting is xterm-compatible). From hsim at
gmx.li.
2011-05-18 20:28:43 +00:00
Nicholas Marriott 96e7f33da3 Support setting the xterm clipboard when copying from copy mode using
the xterm escape sequence for the purpose (if xterm is configured to
allow it).

Written by and much discussed Ailin Nemui, guidance on
xterm/termcap/terminfo from Thomas Dickey.
2011-05-18 20:24:29 +00:00
Nicholas Marriott 58908fd8c5 Add three new copy-mode commands - select-line, copy-line,
copy-end-of-line. From Dave Disser and Randy Stauner a while back.
2011-05-18 18:06:36 +00:00
Nicholas Marriott f3741f0653 Add a new option, mouse-resize-pane. When on, panes may be resized by
dragging their borders. From hsim at gmx.li.
2011-05-08 20:34:12 +00:00
Nicholas Marriott 295ace6820 Use the tsl and fsl terminfo(5) capabilities to update terminal title
and automatically fill them in on terminals with the XT capability
(which means their title setting is xterm-compatible). From hsim at
gmx.li.
2011-05-08 19:53:06 +00:00
Tiago Cunha 215ee46106 Sync OpenBSD patchset 896:
When mode-mouse is on (it is off by default), automatically enter copy
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.
2011-04-25 20:33:42 +00:00
Nicholas Marriott 8738141913 When mode-mouse is on (it is off by default), automatically enter copy
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.
2011-04-19 21:31:33 +00:00
Nicholas Marriott dc6bd98425 |PatchSet 893
|Date: 2011/04/18 20:49:05
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Add an option (mouse-select-window) which allows the mouse to be used by
|clicking on the status line, written by hsim at gmx dot li.
2011-04-18 21:07:58 +00:00
Nicholas Marriott 0bb2119781 Add an option (mouse-select-window) which allows the mouse to be used by
clicking on the status line, written by hsim at gmx dot li.
2011-04-18 19:49:05 +00:00
Nicholas Marriott 75f218dc73 If the terminal supports sitm for italics, use it instead of standout
(smso). From Tiago Resende.
2011-04-09 07:48:58 +00:00
Nicholas Marriott 0a09d04e1b If the terminal supports sitm for italics, use it instead of standout
(smso). From Tiago Resende.
2011-04-09 07:48:08 +00:00
Nicholas Marriott e5f4bf3f3e |PatchSet 884
|Date: 2011/04/06 22:51:31
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Change so that an empty session name always means the current sessions
|even if given with, for example, -t '', and explicitly forbid empty
|session names and those containing a : when they are created.
2011-04-06 22:29:26 +00:00
Nicholas Marriott 4e452a2e11 |PatchSet 882
|Date: 2011/04/05 20:37:01
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Add a flag to cmd_find_session so that attach-session can prefer
|unattached sessions when choosing the most recently used (if -t is not
|given). Suggested by claudio@.
2011-04-06 22:24:01 +00:00
Nicholas Marriott ffce6b34b2 |PatchSet 876
|Date: 2011/03/29 20:30:16
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Change -t on display-message to be target-pane for the #[A-Z]
|replacements and add -c as target-client.
2011-04-06 22:21:02 +00:00
Nicholas Marriott 8ab7fcf7eb |PatchSet 873
|Date: 2011/03/28 20:44:31
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Style: uint -> u_int and a missing else.
2011-04-06 22:18:56 +00:00
Nicholas Marriott 2b508f7f6b |PatchSet 871
|Date: 2011/03/27 21:31:25
|Author: nicm
|Branch: HEAD
|Tag: (none)
|Log:
|Don't include meta twice when working out the flags to output for
|xterm-style keys - bit 3 is accepted on input but not on output. Also a
|style nit in the header.
2011-04-06 22:17:33 +00:00
Nicholas Marriott 536fc24653 PatchSet 870
Date: 2011/03/27 21:27:26
Author: nicm
Branch: HEAD
Tag: (none)
Log:
Give each pane created in a tmux server a unique id (starting from 0),
put it in the TMUX_PANE environment variable and accept it as a
target. Suggested by and with testing and tweaks from Ben Boeckel.
2011-04-06 22:16:33 +00:00
Nicholas Marriott ec89eb9552 Change so that an empty session name always means the current sessions
even if given with, for example, -t '', and explicitly forbid empty
session names and those containing a : when they are created.
2011-04-06 21:51:31 +00:00
Nicholas Marriott 5d519ba526 Add a flag to cmd_find_session so that attach-session can prefer
unattached sessions when choosing the most recently used (if -t is not
given). Suggested by claudio@.
2011-04-05 19:37:01 +00:00
Nicholas Marriott d88c20e718 Change -t on display-message to be target-pane for the #[A-Z]
replacements and add -c as target-client.
2011-03-29 19:30:16 +00:00
Nicholas Marriott fa6abac98d Style: uint -> u_int and a missing else. 2011-03-28 19:44:31 +00:00
Nicholas Marriott 7ce8fee4f3 Don't include meta twice when working out the flags to output for
xterm-style keys - bit 3 is accepted on input but not on output. Also a
style nit in the header.
2011-03-27 20:31:25 +00:00
Nicholas Marriott 808502ac3d Give each pane created in a tmux server a unique id (starting from 0),
put it in the TMUX_PANE environment variable and accept it as a
target. Suggested by and with testing and tweaks from Ben Boeckel.
2011-03-27 20:27:26 +00:00
Tiago Cunha a0295b4c2f Sync OpenBSD patchset 866:
Support passing through escape sequences to the underlying terminal by
using DCS with a "tmux;" prefix. Escape characters in the sequences must
be doubled. For example:

$ printf '\033Ptmux;\033\033]12;red\007\033\\'

Will pass \033]12;red\007 to the terminal (and change the cursor colour
in xterm). From Kevin Goodsell.
2011-03-19 23:30:37 +00:00
Tiago Cunha d0cca3924e Sync OpenBSD patchset 863:
Add a -P option to detach to HUP the client's parent process (usually
causing it to exit as well).
2011-03-19 23:27:35 +00:00
Nicholas Marriott 79e30daeae Support passing through escape sequences to the underlying terminal by
using DCS with a "tmux;" prefix. Escape characters in the sequences must
be doubled. For example:

$ printf '\033Ptmux;\033\033]12;red\007\033\\'

Will pass \033]12;red\007 to the terminal (and change the cursor colour
in xterm). From Kevin Goodsell.
2011-03-07 23:46:27 +00:00
Nicholas Marriott 7954126dcd Add a -P option to detach to HUP the client's parent process (usually
causing it to exit as well).
2011-03-03 08:51:47 +00:00
Tiago Cunha 3d7b8105e1 Sync OpenBSD patchset 855:
Simplify the way jobs work and drop the persist type, so all jobs are
fire-and-forget.

Status jobs now managed with two trees of output (new and old), rather
than storing the output in the jobs themselves. When the status line is
processed any jobs which don't appear in the new tree are started and
the output from the old tree displayed. When a job finishes it updates
the new tree with its output and that is used for any subsequent
redraws. When the status interval expires, the new tree is moved to the
old so that all jobs are run again.

This fixes the "#(echo %H:%M:%S)" problem which would lead to thousands
of identical persistent jobs and high memory use (this can still be
achieved by adding "sleep 30" but that is much less likely to happen by
accident).
2011-02-15 15:20:03 +00:00
Tiago Cunha 3b56ebce6d Sync OpenBSD patchset 854:
Use LIST_* not SLIST_*.
2011-02-15 15:12:28 +00:00
Tiago Cunha 2ab568fa88 Sync OpenBSD patchset 853:
When clearing the entire screen, clear lines that are used into the
history like xterm does. Requested ages ago by someone I've forgotten.
2011-02-15 15:10:47 +00:00
Tiago Cunha 4e4568cade Sync OpenBSD patchset 852:
Check if the index is in use and fail before creating the child process,
rather than leaving a stray child on failure.
2011-02-15 15:09:52 +00:00
Tiago Cunha d0d1c0e486 Sync OpenBSD patchset 848:
Set $TMUX without the session when background jobs are run.
2011-02-14 23:11:33 +00:00
Nicholas Marriott db7a89b1ee Simplify the way jobs work and drop the persist type, so all jobs are
fire-and-forget.

Status jobs now managed with two trees of output (new and old), rather
than storing the output in the jobs themselves. When the status line is
processed any jobs which don't appear in the new tree are started and
the output from the old tree displayed. When a job finishes it updates
the new tree with its output and that is used for any subsequent
redraws. When the status interval expires, the new tree is moved to the
old so that all jobs are run again.

This fixes the "#(echo %H:%M:%S)" problem which would lead to thousands
of identical persistent jobs and high memory use (this can still be
achieved by adding "sleep 30" but that is much less likely to happen by
accident).
2011-01-26 01:54:56 +00:00
Nicholas Marriott 4dfb29fa38 Use LIST_* not SLIST_*. 2011-01-26 00:11:47 +00:00
Nicholas Marriott ecc22c521d When clearing the entire screen, clear lines that are used into the
history like xterm does. Requested ages ago by someone I've forgotten.
2011-01-25 23:40:26 +00:00
Nicholas Marriott 1270f8fed8 Check if the index is in use and fail before creating the child process,
rather than leaving a stray child on failure.
2011-01-25 22:31:50 +00:00
Nicholas Marriott b8023044c3 Set $TMUX without the session when background jobs are run. 2011-01-23 11:03:43 +00:00
Tiago Cunha 332bfbf273 Sync OpenBSD patchset 845:
Mouse highlight mode (1001) requires a program to cooperate so
supporting it through tmux is not as easy as this, remove it for now.
2011-01-21 23:56:11 +00:00
Tiago Cunha 492e3aa437 Sync OpenBSD patchset 834:
Move all calls to fcntl(...O_NONBLOCK) into a function and clear the
flag on the stdio file descriptors before closing them (fixes things
like "tmux ls && cat").
2011-01-21 23:44:13 +00:00
Nicholas Marriott 8f8e81c0c9 Mouse highlight mode (1001) requires a program to cooperate so
supporting it through tmux is not as easy as this, remove it for now.
2011-01-15 00:16:00 +00:00
Nicholas Marriott 69cb1f830e Move all calls to fcntl(...O_NONBLOCK) into a function and clear the
flag on the stdio file descriptors before closing them (fixes things
like "tmux ls && cat").
2011-01-08 01:52:36 +00:00
Tiago Cunha 30f6d9b167 Sync OpenBSD patchset 813:
Add a function to create window flags rather than doing the same thing
in two places. From Thomas Adam.
2011-01-07 16:55:40 +00:00
Tiago Cunha 1df427bc7b Sync OpenBSD patchset 829:
Clean up and simplify tmux command argument parsing.

Originally, tmux commands were parsed in the client process into a
struct with the command data which was then serialised and sent to the
server to be executed. The parsing was later moved into the server (an
argv was sent from the client), but the parse step and intermediate
struct was kept.

This change removes that struct and the separate parse step. Argument
parsing and printing is now common to all commands (in arguments.c) with
each command left with just an optional check function (to validate the
arguments at parse time), the exec function and a function to set up any
key bindings (renamed from the old init function).

This is overall more simple and consistent.

There should be no changes to any commands behaviour or syntax although
as this touches every command please watch for any unexpected changes.
2011-01-07 14:45:34 +00:00
Tiago Cunha 219442cff7 Sync OpenBSD patchset 828:
Support for UTF-8 mouse input (\033[1005h). This was added in xterm 262
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.
2011-01-07 14:34:45 +00:00
Nicholas Marriott 7502cb3adb Clean up and simplify tmux command argument parsing.
Originally, tmux commands were parsed in the client process into a
struct with the command data which was then serialised and sent to the
server to be executed. The parsing was later moved into the server (an
argv was sent from the client), but the parse step and intermediate
struct was kept.

This change removes that struct and the separate parse step. Argument
parsing and printing is now common to all commands (in arguments.c) with
each command left with just an optional check function (to validate the
arguments at parse time), the exec function and a function to set up any
key bindings (renamed from the old init function).

This is overall more simple and consistent.

There should be no changes to any commands behaviour or syntax although
as this touches every command please watch for any unexpected changes.
2011-01-04 00:42:46 +00:00
Tiago Cunha 36c7c7537a Sync OpenBSD patchset 826:
Move the user-visible parts of all options (names, types, limit, default
values) together into one set of tables in options-table.c. Also clean
up and simplify cmd-set-options.c and move a common print function into
option-table.c.
2011-01-03 23:52:38 +00:00