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.
86 files changed
tree: f8566b756787ef7ceeed61e63f61b2a0ece4c751
  1. .gitignore
  2. .mailmap
  3. CHANGES
  4. FAQ
  5. Makefile.am
  6. README
  7. SYNCING
  8. TODO
  9. arguments.c
  10. array.h
  11. attributes.c
  12. autogen.sh
  13. cfg.c
  14. client.c
  15. clock.c
  16. cmd-attach-session.c
  17. cmd-bind-key.c
  18. cmd-break-pane.c
  19. cmd-capture-pane.c
  20. cmd-choose-buffer.c
  21. cmd-choose-client.c
  22. cmd-choose-list.c
  23. cmd-choose-tree.c
  24. cmd-clear-history.c
  25. cmd-clock-mode.c
  26. cmd-command-prompt.c
  27. cmd-confirm-before.c
  28. cmd-copy-mode.c
  29. cmd-delete-buffer.c
  30. cmd-detach-client.c
  31. cmd-display-message.c
  32. cmd-display-panes.c
  33. cmd-find-window.c
  34. cmd-has-session.c
  35. cmd-if-shell.c
  36. cmd-join-pane.c
  37. cmd-kill-pane.c
  38. cmd-kill-server.c
  39. cmd-kill-session.c
  40. cmd-kill-window.c
  41. cmd-link-window.c
  42. cmd-list-buffers.c
  43. cmd-list-clients.c
  44. cmd-list-commands.c
  45. cmd-list-keys.c
  46. cmd-list-panes.c
  47. cmd-list-sessions.c
  48. cmd-list-windows.c
  49. cmd-list.c
  50. cmd-load-buffer.c
  51. cmd-lock-server.c
  52. cmd-move-window.c
  53. cmd-new-session.c
  54. cmd-new-window.c
  55. cmd-paste-buffer.c
  56. cmd-pipe-pane.c
  57. cmd-queue.c
  58. cmd-refresh-client.c
  59. cmd-rename-session.c
  60. cmd-rename-window.c
  61. cmd-resize-pane.c
  62. cmd-respawn-pane.c
  63. cmd-respawn-window.c
  64. cmd-rotate-window.c
  65. cmd-run-shell.c
  66. cmd-save-buffer.c
  67. cmd-select-layout.c
  68. cmd-select-pane.c
  69. cmd-select-window.c
  70. cmd-send-keys.c
  71. cmd-server-info.c
  72. cmd-set-buffer.c
  73. cmd-set-environment.c
  74. cmd-set-option.c
  75. cmd-show-environment.c
  76. cmd-show-messages.c
  77. cmd-show-options.c
  78. cmd-source-file.c
  79. cmd-split-window.c
  80. cmd-start-server.c
  81. cmd-string.c
  82. cmd-suspend-client.c
  83. cmd-swap-pane.c
  84. cmd-swap-window.c
  85. cmd-switch-client.c
  86. cmd-unbind-key.c
  87. cmd-unlink-window.c
  88. cmd.c
  89. colour.c
  90. compat.h
  91. compat/
  92. configure.ac
  93. control-notify.c
  94. control.c
  95. environ.c
  96. examples/
  97. format.c
  98. grid-cell.c
  99. grid-view.c
  100. grid.c
  101. input-keys.c
  102. input.c
  103. job.c
  104. key-bindings.c
  105. key-string.c
  106. layout-custom.c
  107. layout-set.c
  108. layout.c
  109. log.c
  110. mode-key.c
  111. names.c
  112. notify.c
  113. options-table.c
  114. options.c
  115. osdep-aix.c
  116. osdep-darwin.c
  117. osdep-dragonfly.c
  118. osdep-freebsd.c
  119. osdep-hpux.c
  120. osdep-linux.c
  121. osdep-netbsd.c
  122. osdep-openbsd.c
  123. osdep-sunos.c
  124. osdep-unknown.c
  125. paste.c
  126. resize.c
  127. screen-redraw.c
  128. screen-write.c
  129. screen.c
  130. server-client.c
  131. server-fn.c
  132. server-window.c
  133. server.c
  134. session.c
  135. signal.c
  136. status.c
  137. tmux.1
  138. tmux.c
  139. tmux.h
  140. tools/
  141. tty-acs.c
  142. tty-keys.c
  143. tty-term.c
  144. tty.c
  145. utf8.c
  146. window-choose.c
  147. window-clock.c
  148. window-copy.c
  149. window.c
  150. www/
  151. xmalloc.c
  152. xterm-keys.c