comint-move-point-for-output is a variable defined in `comint.el'.
Its value is

  • This variable's value is permanent if it is given a local binding.

Controls whether interpreter output moves point to the end of the output.
If nil, then output never moves point to the output.
(If the output occurs at point, it is inserted before point.)
If t or `all', move point in all windows showing the buffer.
If `this', move point only the selected window.
If `others', move point only in other windows, not in the selected window.

The default is nil.

See the variable `comint-scroll-show-maximum-output' and the function
This variable is buffer-local in all Comint buffers.

You can customize this variable.