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

Toggling full screen in terminal deletes the line above #93

Open
semihbkgr opened this issue May 5, 2024 · 5 comments
Open

Toggling full screen in terminal deletes the line above #93

semihbkgr opened this issue May 5, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@semihbkgr
Copy link
Contributor

Switching from full screen to normal mode deletes the previous lines in the terminal.

@applejag
Copy link
Owner

applejag commented May 5, 2024

I don't believe I've gotten this behavior on alacritty. What terminal emulator are you using?

And do you mean just toggling it on and off? Like running kubectl klock pods followed by tapping f twice?

@semihbkgr
Copy link
Contributor Author

I am using iTerm terminal emulator with tmux and zsh shell.

And do you mean just toggling it on and off? Like running kubectl klock pods followed by tapping f twice?

Yes I meant that.

@applejag
Copy link
Owner

Ah yes now I'm able to reproduce it. Didn't really see the issue at first. It only deletes a single line. Super strange!

I wonder if it's because the output doesn't have a trailing newline, and that somehow messes it up? 🤔

@applejag applejag added the bug Something isn't working label May 10, 2024
@applejag
Copy link
Owner

Found the reason. When toggling fullscreen the status bar of "force fullscreen" appears, changing the number of lines in the output.

Charmbracelet seems to get confused when changing the number of output lines is done in the middle of switching fullscreen mode.

It seems to think it's still showing 3 lines when exiting fullscreen mode, so it clears the last 3 lines to make room for the output. But then there's only 2 lines of output as the status line disappeared, which causes this visual bug.

@applejag
Copy link
Owner

I created a small repro to verify that it's bubbletea library that's causing it, and it seems to be that way.

We could maybe work around it in klock with some hacks, but to begin with I've created an issue on bubbletea's repo. Let's see if we can get help from the charmbracelet team to get it fixed upstream instead: charmbracelet/bubbletea#1013

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