0

Using jquery terminal 1.2.0 & jquery 3.2.1 mostly works but proper scrolling is eluding me in one of two different ways. I am looking at the api reference. The demos look great. I looked but didn't find another similar question among tagged questions. I am using terminal.echo() to write to the terminal.

At first I was seeing the same container resizing problem as as @zack in his question about remain-the-same-size. So I added a height, both with and without a width value. It still behaves the same.

Now each typed command stays at the top. After pressing enter the output is printed, the output scrolls up, the scrollbar moves, then a new prompt is printed and visible at the top of the screen.

I realize these are almost two different questions but changes produce different behaviors as I try to get something that works.

Has anyone else seen these behaviors?

Per the comments I went to codepen as described and here's a screenshot of the result.

left-ok-scrolls-up-right-bad-scrolls-down-and-resize

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Grant Bowman
  • 307
  • 6
  • 16
  • 1
    Do you have demo somewhere? maybe you can create [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). You can for instance fork this [codepen](https://codepen.io/jcubic/pen/MbVMwO) – jcubic Apr 25 '17 at 07:13
  • I will extract a minimal example, good suggestion. Both those links are helpful as well, thanks. – Grant Bowman Apr 25 '17 at 18:39
  • OK, at codepen on the left HTML I put `
    ` for the html and changed the JS box on the right `term = $('body')` to `term = $('#line')`. With or without a height this reproduces the resizing down problem as in @zack's question. The overflow css property also did not make a difference.
    – Grant Bowman Apr 25 '17 at 20:20
  • Aha, putting a div inside helps but the scolling of the two divs are not quite working yet. I want the background div to stay the same and the terminal to grow until it needs to scroll then add a scrollbar, perhaps just show the scrollbar all the time. Adding heights and displaying the inside div differently seem to be forward progress. – Grant Bowman Apr 25 '17 at 20:47
  • Actually adding to the inside div float and clear properties, not changing the display. – Grant Bowman Apr 25 '17 at 20:53
  • Do you have a link to codepen demo? – jcubic Apr 26 '17 at 07:17
  • I used the link [you gave me](https://codepen.io/jcubic/pen/MbVMwO) and just typed on the left side `
    ` on the left and on the right changed the word `body` to the word `#line`. I think doing a div inside a div and giving the outside one the right bounding size will yield a good result.
    – Grant Bowman Apr 28 '17 at 00:37
  • I can't reproduce any issue, can you explain bit more what steps do I need to do and what is the expected results? Maybe a screenshot will help. – jcubic Apr 28 '17 at 07:24
  • screenshot uploaded. left side is ok, the text scrolls up at the bottom. right side is changed per my third comment here. The text scrolls down and resizes the div with each command so it appears to scroll down at the bottom which is off the screen. – Grant Bowman May 04 '17 at 07:17
  • 1
    Oh, it's because the scrollbar is on body not on terminal, you need to set the height, if you want full screen terminal then you can use `.terminal { height: 100vh; }` or set the height using javascript (you will need to recalculate it on resize event). – jcubic May 04 '17 at 10:19
  • 1
    Also there was one bug in 1.3.0 with signature (caused by cols method) fixed in 1.3.1 – jcubic May 04 '17 at 13:07
  • Please provide all relevant code in an [mcve] *in the question itself*, **not only on a third-party site**. – Heretic Monkey May 04 '17 at 17:11

0 Answers0