Copying Text After Pausing Display in CoolTerm

If you have specific questions or problems with any of my Freeware applications, post them here.
GeorgeIoak
Posts: 7
Joined: Wed Feb 07, 2024 1:09 pm

Copying Text After Pausing Display in CoolTerm

Post by GeorgeIoak »

Is it just me or does it seem to be a bit buggy if you want to scroll back up to find something and when you find what you want if you try to click and select it the text the screen display jumps down to the current output.
User avatar
roger
Site Admin
Posts: 439
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Copying Text After Pausing Display in CoolTerm

Post by roger »

Hi George,

which version (macOS, Window, Linux) are you using? Do you have "Smart Display Pausing" turned on in the Preferences? Without that turned on, the display automatically scrolls to the bottom when new data arrives.

Roger
GeorgeIoak
Posts: 7
Joined: Wed Feb 07, 2024 1:09 pm

Re: Copying Text After Pausing Display in CoolTerm

Post by GeorgeIoak »

Sorry, Windows, 2.1.0 Build 1282 64-bit and yes I do turn on Pausing
User avatar
roger
Site Admin
Posts: 439
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Copying Text After Pausing Display in CoolTerm

Post by roger »

Does the status text on the bottom say "Display Paused" in red when you scroll up? It should, and when it does, it really should not jump back to the bottom. Is it correlated to any specific event when that happens, or is it trying to select the text that makes that happen?
User avatar
roger
Site Admin
Posts: 439
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Copying Text After Pausing Display in CoolTerm

Post by roger »

Ok, I think I see what you mean. I just tried this on a Win 11 system.
- if I scroll up using the scroll wheel in a CoolTerm that isn't activate (i.e. not the foremost window) by hovering the mouse over the window and use the wheel, the window scrolls up.
- if I then click in the window to select the text, the window is activated and the textarea jumps back to the bottom.
- However, if the window is already active (i.e. the frontmost one), it doesn't jump to the bottom and instead selects the text as expected.

Can you confirm on your end that, when the window is active and you scroll up to select text, it doesn't jump back down.

This is not the expected behavior, and I'll look into that. It seems that the event of activating the window by clicking in the text area is being handled in an unexpected way.
GeorgeIoak
Posts: 7
Joined: Wed Feb 07, 2024 1:09 pm

Re: Copying Text After Pausing Display in CoolTerm

Post by GeorgeIoak »

You got it, I was just about to try and post a video. It's interesting that the windows knows to pause the display but then clicking in the window makes it jump.

Yes, it seems if the window is active it appears to operate correctly but I think most of the time I'll let the data scroll by while I'm working on something else and when something catches my eye I try to click over and copy it and well, you know...
User avatar
roger
Site Admin
Posts: 439
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Copying Text After Pausing Display in CoolTerm

Post by roger »

The interesting thing is that the display unpauses when that happens. What I need to track down is whether clicking on the window causes the display to scroll down resulting in it being unpaused, or if clicking in the window causes an event that calls the code to unpause it which then causes the text area to scroll to the bottom.

Classic chicken and egg problem :-)
In any case, thanks for reporting this. I'll look into it as soon as I have some time.
User avatar
roger
Site Admin
Posts: 439
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Copying Text After Pausing Display in CoolTerm

Post by roger »

GeorgeIoak wrote: Wed Feb 07, 2024 2:52 pm You got it, I was just about to try and post a video. It's interesting that the windows knows to pause the display but then clicking in the window makes it jump.

Yes, it seems if the window is active it appears to operate correctly but I think most of the time I'll let the data scroll by while I'm working on something else and when something catches my eye I try to click over and copy it and well, you know...
Another interesting thing to note is that this only happens if new data has arrived while the window was inactive but not paused. It successfully adds any new text to the text area, even if the window isn't active, as it should. When you then scroll the text while it's still inactive, and then click into the window to select text, it scrolls to the bottom. I have confirmed that it does that even if CoolTerm is not paused. Thus, the unpausing is a result of the jump to the bottom, not the other way around. Also, if you then click outside the window to de-activate it again and then scroll the contents, and then go back and click the window again, it does NOT jump to the bottom. It only does that if new text has been added while it's been deactivated.

I haven't looked any further, but so far I think I can rule out any of the smart pausing code.
GeorgeIoak
Posts: 7
Joined: Wed Feb 07, 2024 1:09 pm

Re: Copying Text After Pausing Display in CoolTerm

Post by GeorgeIoak »

All I can tell you is that I've lost a few hairs on this one but I really appreciate you looking into it! It's something I tend to use a lot
User avatar
roger
Site Admin
Posts: 439
Joined: Fri Apr 24, 2009 12:41 am
Contact:

Re: Copying Text After Pausing Display in CoolTerm

Post by roger »

Well, after looking into this further, I have some good news and some bad news.

The good news is that the CoolTerm code is not responsible for this :-)
Also, the macOS version doesn't do this at all. Everything behaves as expected.

Now, the bad news is that this is something that the Windows operating system appears to be doing on its own, and that there is absolutely nothing I can do to fix it in code. CoolTerm uses native UI controls on each respective platform, and while they behave MOSTLY the same across platforms, there are some peculiarities that only exist on one platform but not the others. This thing where activating a window with a TextArea control that has received new text while it was inactive and has been scrolled away from the bottom would automatically scroll back to the bottom is something that happens automatically with this particular type of UI control only on Windows. I have confirmed this with a very simple demo project with a window and a textarea control and a single line of code that get's triggered by a 10 second timer that adds a new line of text. The demo project behaves exactly the same. You don't even have to click on the text area, simply activating the window (by clicking anywhere in the window) will do this if new text has been and the control has been scrolled away after while it was no active.

So, I wish I had better news, but the only way to fix this would be to implement a new custom textarea control from scratch (using graphics), but that's a pretty gargantuan task that I don't want to take on at this time. I might do it eventually, though, since proper support for all ANSI control sequences, which I may want to add to CoolTerm in the future, would require this.

The ONLY workaround for this problem is to click on it first before you scroll. Then it's activated and you can select the text you are scrolling to.

Regards,

Roger
Post Reply