Q1: If the server keeps sending data with a newline character (\n) at the end of each line, the text will be displayed on the browser as plain text, and the browser will not automatically scroll the text up. The behavior of scrolling up or down is determined by the browser based on its default settings and the user's preferences.
If you want to have a scrolling behavior, you can use JavaScript to create a <div> element with a fixed height and set its overflow property to auto. Then, you can use JavaScript to append new text to the <div> element, which will automatically cause the element to scroll down as new text is added.
Q2: Yes, it is possible to create a "dumb terminal" inside a rectangular area using JavaScript. You can create a <textarea> element with fixed dimensions and set its readonly property to true. Then, you can use JavaScript to append new text to the <textarea> element, which will cause the text to appear as if it is being typed in real time. However, this approach may not be ideal for large amounts of text or frequent updates, as it can be slow and may cause performance issues. A better approach might be to use a <div> element with scrolling behavior, as described in the answer to Q1.