MacOS – Scrolling of the terminal does not always stick to the bottom

bugmacosscrollingterminal

When my terminal gives lots of output (for example when I am compiling something), by default the scrolling automatically sticks to 'bottom' of my terminal window.

But when I scroll within my output, and then scroll back to the bottom using my trackpad, this sticking effect is sometimes gone and sometimes it persists.

When I use the slider on the right hand side, the sticking effect persists, just like I would expect it to be.

Is this expected behaviour or a bug? Should the terminal stick to the bottom when I scrolled all the way down?

I created this terminal oneliner to try it out for yourself (downloads the linux kernel at 10k and outputs it to the terminal):

curl --limit-rate 10k https://www.kernel.org/pub/linux/kernel/v3.x/testing/linux-3.15-rc5.tar.xz

Terminal output without sticking

Best Answer

The issue here is that the scroll is still going when the text continues to be output. The trackpad is still in a "scroll mode" in which Terminal doesn't check the position and waits until it's done.

This was originally so it would wait until your fingers are off the trackpad/you stop scrolling. With inertia scrolling, this scroll mode doesn't end until the velocity reaches 0. So, the terminal waits until it is 0, by which time the output has increased and it won't stick to the bottom. (This isn't as noticeable in Terminal due to the lack of rubber banding.)

So I guess it would technically be expected behavior but it is still undesired behavior :P