Skip to content
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

Mouse scrolling doesn't work in Windows Terminal #183

Open
GoodClover opened this issue Feb 6, 2021 · 13 comments
Open

Mouse scrolling doesn't work in Windows Terminal #183

GoodClover opened this issue Feb 6, 2021 · 13 comments
Labels
bug Something isn't working upstream The issue is with a library.

Comments

@GoodClover
Copy link

GoodClover commented Feb 6, 2021

For a demonstration of the bug, a video explains best:
Amfora scroll-back bug demonstration video
(This is Windows Terminal with cmd)

When you either change your terminal's font size (what I did in the video) or resize the terminal window, Amfora re-renders everything to fit (already better than some programs :).
However, it appears that rather than clearing the entire screen + scroll-back it just clears the screen and leaves a messed up scroll-back.
As far as I can tell this is the only thing that can cause this issue in amfora.

I presume that this caused by a use of the ED escape sequence mode 2 instead of mode 3, meaning that the screen is cleared and not the scroll-back.
Either that or a different sequence of escape codes that is not ED is being used to clear the screen, in that case it should be switched to ED.

image
Above screenshot from Wikipedia

This may actually be an upstream issue, but I'm not a Go programmer so idk

@makew0rld makew0rld added bug Something isn't working upstream The issue is with a library. labels Feb 7, 2021
@makew0rld
Copy link
Owner

Thanks for reporting! This is likely an upstream bug with cview or tcell. In the cview-update branch I have updated both those dependencies. Could you unzip and run this binary to see if the issue still occurs? The binary is for 64-bit Windows. If you're uncomfortable running the binary you can build it yourself by following the instructions on the README, but running git checkout cview-update before building.

amfora.exe.zip

@GoodClover
Copy link
Author

The issue appears to still be there in the executable you attached.

@makew0rld
Copy link
Owner

I have opened gdamore/tcell#428 to ask about this. As this is an upstream issue, this will remain open and unfixed until I understand the issue better, and likely until someone else fixes it. Thanks again for spotting this.

@gdamore
Copy link

gdamore commented Feb 20, 2021

tcell definitely does not use ED. tcell attempts to rely on only a minimal set of terminal features unless they bring particular value. Our redraw doesn't clear the screen at all, instead we redraw the entire screen.

I will look into supporting this escape code, however adding support for new escape codes is kind of a pain because we never know what the various terminals (and terminfo descriptions) have.

@makew0rld
Copy link
Owner

@gdamore Thanks for responding, I understand the value in sticking to simple features.

Do you have suggestions for what cview could do to mitigate this while waiting for the possible fix?

@makew0rld makew0rld changed the title When changing terminal size terminal scroll-back isn't cleared. Windows: Scroll-back isn't cleared on terminal size change Mar 5, 2021
@makew0rld
Copy link
Owner

makew0rld commented Mar 5, 2021

I opened this cview issue to notify @tslocum about this.

@gdamore Any ideas about how to fix this?

@gdamore
Copy link

gdamore commented Mar 5, 2021

I will eventually try to get this done in tcell. Unfortunately I haven't had much time to work on tcell (it doesn't really pay any bills), but hopefully I'll get to it soon.

If someone wanted to submit a PR to tcell I'd be open.

@makew0rld
Copy link
Owner

@GoodClover could you confirm something? Does scrolling with the mouse work normally? Like without font size changes or window resizes like you mention. When you scroll with the mouse on a Gemini page, does it work?

@GoodClover
Copy link
Author

GoodClover commented Mar 28, 2021

Nope, you can't don't get scroll-back normally, only when the window is resized/font changed/etc.
Normally it's fully cleared when doing anything in amfora.

@makew0rld
Copy link
Owner

Ok, I believe I understand the issue then, as I explain here. I will work with the cview dev towards a fix. The actual issue is that scrolling is broken in Windows Terminal. The thing shown in your video is just a side effect.

@makew0rld makew0rld changed the title Windows: Scroll-back isn't cleared on terminal size change Mouse scrolling doesn't work in Windows Terminal Mar 28, 2021
@GoodClover
Copy link
Author

Oh, sorry about the fuss them.
If it's an issue with Windows Terminal then it's probably best to just get them to fix it rather than make a workaround?

@makew0rld
Copy link
Owner

I'm not entirely sure if what they're doing can be labelled as a bug. If I can fix it on my end I will.

@makew0rld
Copy link
Owner

If tcell is updated in Amfora this may be fixed, see this comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream The issue is with a library.
Projects
None yet
Development

No branches or pull requests

3 participants