Commit Graph

86 Commits

Author SHA1 Message Date
Thomas Adam f90eb43fcb Merge branch 'obsd-master' 2013-03-25 14:59:29 +00:00
Nicholas Marriott 6fee3e9e4b Rename session idx to session id throughout and add $ prefix to targets
to use it, extended from a diff from George Nachman.
2013-03-25 10:11:45 +00:00
Nicholas Marriott 20636d956d Add a command queue to standardize and simplify commands that call other
commands and allow a command to block execution of subsequent
commands. This allows run-shell and if-shell to be synchronous which has
been much requested.

Each client has a default command queue and commands are consumed one at
a time from it. A command may suspend execution from the queue by
returning CMD_RETURN_WAIT and then resume it by calling cmd_continue() -
for example run-shell does this from the callback that is fired after
the job is freed.

When the command queue becomes empty, command clients are automatically
exited (unless attaching). A callback is also fired - this is used for
nested commands in, for example, if-shell which can block execution of
the client's cmdq until a new cmdq becomes empty.

Also merge all the old error/info/print functions together and lose the
old curclient/cmdclient distinction - a cmdq is bound to one client (or
none if in the configuration file), this is a command client if
c->session is NULL otherwise an attached client.
2013-03-24 09:54:10 +00:00
Nicholas Marriott 2243cfbe75 Need to set clients in context before changing their reference count. 2013-03-22 15:54:29 +00:00
Nicholas Marriott a1722d5c2e Remove unnecessary initializers of cmd_ctx. 2013-03-22 15:50:42 +00:00
Nicholas Marriott 2f5fa4ee9d Don't hang when clearing line in choose mode now that the cursor stays
at the end with wrap.
2013-03-22 10:38:33 +00:00
Nicholas Marriott 8d59b189cc No more lint means no more ARGSUSED. 2013-03-22 10:31:22 +00:00
Nicholas Marriott 51d989f5df Do not crash when calling choose-tree with a command that changes the mode. 2013-03-21 16:22:48 +00:00
Nicholas Marriott 180faf73af Allow choose commands to be used outside tmux, so long as at least one
client is attached.
2013-03-21 16:09:59 +00:00
Thomas Adam 64da762c15 Merge branch 'obsd-master' 2013-02-07 12:08:55 +00:00
Nicholas Marriott 8903c1f167 Automatically reflow wrapped lines when a pane is resized, requested by
many over the years and finally implemented by Richard Woodbury.
2013-02-05 11:08:59 +00:00
Thomas Adam 675c6b3773 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-12-31 18:50:37 +00:00
Nicholas Marriott 3e6d45acf6 Add -T option to select-window to toggle to last window if already
current, from Raghavendra D Prabhu.
2012-12-24 12:34:32 +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 b4ad1759b8 Merge branch 'obsd-master'
Sync from OpenBSD.
2012-10-11 17:52:23 +01:00
Nicholas Marriott 6589120667 Fix a use-after-free when collapsing the tree in choose mode, from
Carl Henrik Lunde.
2012-10-11 08:53:50 +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
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 7263fa36eb add cmd-choose-list to allow arbitrary options to be selected. From
Thomas Adam.
2012-09-03 09:57:57 +00:00
Tiago Cunha 554f19eb05 Sync OpenBSD patchset 1167:
Instead of requiring a prompt to enter all numbers >10, go back to
0-9a-z and add A-Z and enter the prompt when M-0 to M-9 are pressed
(like in copy mode). Prompted by request from mcbride@, help from Thomas
Adam.
2012-08-31 09:24:51 +00:00
Tiago Cunha 674545f7e6 Sync OpenBSD patchset 1164:
Boldify windows with alerts in choose-* list.
2012-08-31 09:20:47 +00:00
Nicholas Marriott 753775033a Instead of requiring a prompt to enter all numbers >10, go back to
0-9a-z and add A-Z and enter the prompt when M-0 to M-9 are pressed
(like in copy mode). Prompted by request from mcbride@, help from Thomas
Adam.
2012-08-27 21:29:23 +00:00
Nicholas Marriott a1e4908ed7 Boldify windows with alerts in choose-* list. 2012-08-14 09:17:14 +00:00
Tiago Cunha 454e7d9c3a Sync OpenBSD patchset 1160:
Simplify width calculation (all numbers always sequential) and don't
rely on uninitialized data, from Thomas Adam.
2012-08-12 19:31:26 +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
Nicholas Marriott 20129b7bf9 Simplify width calculation (all numbers always sequential) and don't
rely on uninitialized data, from Thomas Adam.
2012-08-12 06:22:26 +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
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
Nicholas Marriott df912e3540 xfree is not particularly helpful, remove it. From Thomas Adam. 2012-07-10 11:53:01 +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 c8c6a23d66 Sync OpenBSD patchset 1098:
Use a helper function to fire choose callback.
2012-04-24 16:21:43 +00:00
Nicholas Marriott 48e6ebbe1e Use a helper function to fire choose callback. 2012-04-23 22:40:47 +00:00
Tiago Cunha 391f1f08c0 Expand the Id keyword. 2011-07-09 09:42:33 +00:00
Tiago Cunha 095e1b410a Sync OpenBSD patchset 812:
Support all four of the xterm mouse modes. Based on a diff from hsim at
gmx.li.
2010-12-30 22:27:38 +00:00
Nicholas Marriott f7c42c21ba Support all four of the xterm mouse modes. Based on a diff from hsim at
gmx.li.
2010-12-29 21:49:06 +00:00
Nicholas Marriott 4f5c5b37b8 Pass in the session, rather than the client, to window modes' key()
function. We were only ever using the client to find the session anyway.

This allows send-key to work properly for manipulating copy mode from
outside tmux.

From Micah Cowan.
2010-05-23 19:42:19 +00:00
Micah Cowan f11f71752a Pass in the session, rather than the client, to window modes' key() function.
We were only ever using the client to find the session anyway.
2010-05-22 21:56:04 +00:00
Tiago Cunha c4724c7861 Sync OpenBSD patchset 629:
Add scroll-up/scroll-down for choose/more mode, from Micah Cowan.
2010-02-02 23:55:21 +00:00
Nicholas Marriott 06ce9da32a Add scroll-up/scroll-down for choose/more mode, from Micah Cowan. 2010-02-01 22:15:51 +00:00
Tiago Cunha dfc2ad1e5f Sync OpenBSD patchset 607:
key should be an int not a char.
2010-01-17 19:00:05 +00:00
Nicholas Marriott 8f301ed62d key should be an int not a char. 2010-01-11 23:46:22 +00:00
Tiago Cunha cc094fdfe6 Sync OpenBSD patchset 581:
Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying
colours...
2009-12-04 22:14:47 +00:00
Nicholas Marriott 15a64b805e Massive spaces->tabs and trailing whitespace cleanup, hopefully for the last
time now I've configured emacs to make them displayed in really annoying
colours...
2009-12-03 22:50:09 +00:00
Tiago Cunha c12e0b0708 Sync OpenBSD patchset 567:
Remove a couple of unused arguments where possible, and add /* ARGSUSED */ to
the rest to reduce lint output.
2009-11-28 14:50:37 +00:00
Nicholas Marriott 4ca857e0e9 Remove a couple of unused arguments where possible, and add /* ARGSUSED */ to
the rest to reduce lint output.
2009-11-26 21:37:13 +00:00