On terminals without DECSLRM, when a pane that is less than the full
with of the terminal scrolls, tmux needs to redraw the entire pane. This
results in a large amount of output data which can cause slow terminals
to struggle, particularly when many lines are scrolled together quickly.

This can be reduced by only redrawing when tmux doesn't hold any
buffered data for the terminal. If a redraw is required and data is
buffered, the redraw is deferred until all that data is consumed (it is
checked after every event loop, a timer is used to ensure this happens
at some point). While a redraw is pending, no additional data will be
written to the terminal.

The redraw still happens, now it is just pushed back if it is possible
it would just add more data on top of a terminal that is already
behind. This both gives the terminal a chance to catch up, and allows
tmux to process more scrolling (that would require additional redraws)
in the meantime.

Helps with a problem reported by Greg Hurrell.
1 file changed
tree: 9b785ced1b4399d976e2e0d18070ea915dc00df7
  1. Makefile
  2. alerts.c
  3. arguments.c
  4. attributes.c
  5. cfg.c
  6. client.c
  7. cmd-attach-session.c
  8. cmd-bind-key.c
  9. cmd-break-pane.c
  10. cmd-capture-pane.c
  11. cmd-choose-buffer.c
  12. cmd-choose-client.c
  13. cmd-choose-tree.c
  14. cmd-command-prompt.c
  15. cmd-confirm-before.c
  16. cmd-copy-mode.c
  17. cmd-detach-client.c
  18. cmd-display-message.c
  19. cmd-display-panes.c
  20. cmd-find-window.c
  21. cmd-find.c
  22. cmd-has-session.c
  23. cmd-if-shell.c
  24. cmd-join-pane.c
  25. cmd-kill-pane.c
  26. cmd-kill-server.c
  27. cmd-kill-session.c
  28. cmd-kill-window.c
  29. cmd-list-buffers.c
  30. cmd-list-clients.c
  31. cmd-list-keys.c
  32. cmd-list-panes.c
  33. cmd-list-sessions.c
  34. cmd-list-windows.c
  35. cmd-list.c
  36. cmd-load-buffer.c
  37. cmd-lock-server.c
  38. cmd-move-window.c
  39. cmd-new-session.c
  40. cmd-new-window.c
  41. cmd-paste-buffer.c
  42. cmd-pipe-pane.c
  43. cmd-queue.c
  44. cmd-refresh-client.c
  45. cmd-rename-session.c
  46. cmd-rename-window.c
  47. cmd-resize-pane.c
  48. cmd-respawn-pane.c
  49. cmd-respawn-window.c
  50. cmd-rotate-window.c
  51. cmd-run-shell.c
  52. cmd-save-buffer.c
  53. cmd-select-layout.c
  54. cmd-select-pane.c
  55. cmd-select-window.c
  56. cmd-send-keys.c
  57. cmd-send-prefix.c
  58. cmd-set-buffer.c
  59. cmd-set-environment.c
  60. cmd-set-hook.c
  61. cmd-set-option.c
  62. cmd-show-buffer.c
  63. cmd-show-environment.c
  64. cmd-show-messages.c
  65. cmd-show-options.c
  66. cmd-source-file.c
  67. cmd-split-window.c
  68. cmd-string.c
  69. cmd-swap-pane.c
  70. cmd-swap-window.c
  71. cmd-switch-client.c
  72. cmd-unbind-key.c
  73. cmd-wait-for.c
  74. cmd.c
  75. colour.c
  76. control-notify.c
  77. control.c
  78. environ.c
  79. format.c
  80. grid-view.c
  81. grid.c
  82. hooks.c
  83. input-keys.c
  84. input.c
  85. job.c
  86. key-bindings.c
  87. key-string.c
  88. layout-custom.c
  89. layout-set.c
  90. layout.c
  91. log.c
  92. mode-key.c
  93. names.c
  94. notify.c
  95. options-table.c
  96. options.c
  97. paste.c
  98. proc.c
  99. procname.c
  100. pty.c
  101. resize.c
  102. screen-redraw.c
  103. screen-write.c
  104. screen.c
  105. server-client.c
  106. server-fn.c
  107. server.c
  108. session.c
  109. signal.c
  110. status.c
  111. style.c
  112. tmux.1
  113. tmux.c
  114. tmux.h
  115. tty-acs.c
  116. tty-keys.c
  117. tty-term.c
  118. tty.c
  119. utf8.c
  120. window-choose.c
  121. window-clock.c
  122. window-copy.c
  123. window.c
  124. xmalloc.c
  125. xmalloc.h
  126. xterm-keys.c