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

bug: Handle zones in non WithAltScreen #11

Open
2 tasks done
Chillance opened this issue Nov 13, 2022 · 1 comment
Open
2 tasks done

bug: Handle zones in non WithAltScreen #11

Chillance opened this issue Nov 13, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@Chillance
Copy link

Chillance commented Nov 13, 2022

🌧 Describe the problem

AltScreen enables a fresh screen and everything starts from the top. But, if I don't use this AltScreen, it seems the zones y position will be calculated wrong. I tested with not having a AltScreen and I noticed my styles triggered when I was at the top with the mouse, although the output was at the bottom. So, it seemed to work, but it essentially triggered like the text was at the top.

I'm not sure how or if this could be solved but it would be nice if this worked somehow. Able to set some offset or even calculate it properly somehow?

⛅ Expected behavior

zones to work in non AltScreen.

🔄 Minimal reproduction

No response

💠 Version: bubblezone

b3469cc

🖥 Version: Operating system

linux/ubuntu

⚙ Additional context

No response

🤝 Requirements

@Chillance Chillance added the bug Something isn't working label Nov 13, 2022
@lrstanley
Copy link
Owner

From my initial testing, it looks as though mouse coordinates still return as if it was a full screen, however non-alt-screen programs scan start at any height from the top of the screen. Looking at the events that bubbletea produces, I don't see a way of being able to calculate the difference to be able to tell how far offset from the top of the screen it may be (it may not be something bubbletea can even determine).

May reach out to folks on the bubbletea team to see if there is some hidden magic we can do to determine such an offset.

I suspect that if there is a way, maybe it's something like the cursor reports it's position, and on initial start, bubbletea places that cursor in the first block, waits for it to report it's position, then begins drawing regular content. However, I am also unsure if adjusting the output height during runtime has any impacts on the reported height either.

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

No branches or pull requests

2 participants