New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Application Scrollbar Mode #1033
Comments
You'll find the previous mention issue #751 marked as insane difficulty, soliciting implementation patches. |
is reported for me consistently at the bottom, I cannot reproduce your observation.
This is on purpose and is just dedicated to prevent any loops. The position must be set only by the application, as implicit setting would in turn trigger additional reports. |
It occurs very consistently for me. Keep in mind it will jump to 100 when you release the scrollbar at the bottom, but prior to that it's often misaligned. Screen size of 24 rows. As for loops, I think you're mistaken, but rather than argue, could you add an escape code to set an option to enable implicit confirmation? |
Heck, and while at it, an option to make the scrollwheel events generated universal across the terminal, unless mouse tracking is enabled. |
What I see is occasional incomplete delivery of the escape sequence while the button is still held, like About immediate scrollbar synchronization: I had tried that, it caused trouble. |
I've uploaded an attempt to nudge the complete delivery of application scrollbar sequences. Please try whether that solves the "100" issue. |
The most recent build still seems to have issues, and scrolling stalls if you move the scrollbar too quickly. I can provide you with a working implementation if you want to see for yourself. Might save us some back and forths and aid you in debugging. As for synchronization, I guess it's not a huge issue. Might want to more clearly document this. As for reporting, that's correct, the default scrollwheel behavior of mintty isn't particularly useful in custom scroll modes. |
Yes please, if you have something, show me. I don't quite understand the last two sentences. |
I put up a beta version, to install:
For testing it's probably easiest to create a small script file, place the following text in a file named scroll.tin
To run it:
The bottom right shows the scrollbar position as reported by mintty. The upper left shows the scrollbar position as reported back by tintin. As for synchronization, the biggest issue I ran into is that tintin's idea of a scrollbar is slightly different from that of mintty. Right now I'm using an approximation that seems to work well enough, but a clear description of how the application scrollbar is supposed to behave might be helpful, and to really handle it perfectly seems tricky. I also notice a stutter when using the right click 'scroll here' scrollbar option. Looks like mintty jumps to the location, reports, jump back, then jumps back to the location once it gets the confirmation. I could see this becoming a more prominent issue when using the feature remotely. |
The position refers to the upper end of the viewport, that might cause some confusion. So if for example you set up |
I see, tintin measures from the bottom end of the viewport, so that explains some of the trouble I ran into. I've updated https://mudhalla.net/tintin-beta.tar.gz so it properly utilizes the viewport. |
I considered to scale the pos value to match the size value at 100%, but the current way matches the Windows paradigm of scrollbar dimensions unchanged and avoids scaling and rounding effects. I have improved the feature description and uploaded that to the wiki pages: |
Released 3.4.0. |
There appears to be a bug where the scrollbar loses track of the position it reports. It's fairly easy to reproduce.
echo -e "\e[100;100;1#t"
Grabbing the scrollbar it reports:
\e[100#d
Slide up and down while keeping the button pressed down, and when you return to the starting position it will report a semi-random value between 95 and 100, rather than 100.
I assume it's a rounding error where mintty calculates the new position based on the current position, rather than the absolute position.
Another issue is that the scrollbar jumps back to the end position if you release the button halfways up. This can be fixed by echoing back the position with \e[#d, but this seems unnecessary as well as a recipe for infinite loops.
An option to set the color of the scrollbar could be a nice addition. Something like \e[31;46#m, to set the foreground to red and background to cyan, 256 and truecolor support would be great as well.
The text was updated successfully, but these errors were encountered: