Skip to content

Fix scrollback reset position in tsm_screen_sb_reset()#26

Merged
kdj0c merged 1 commit intokmscon:mainfrom
caramelli:main
Feb 28, 2026
Merged

Fix scrollback reset position in tsm_screen_sb_reset()#26
kdj0c merged 1 commit intokmscon:mainfrom
caramelli:main

Conversation

@caramelli
Copy link
Copy Markdown
Contributor

sb_pos_num represents the number of scrollback lines above the currently visible screen.

When the terminal displays the latest output (normal mode), all scrollback lines are above the visible screen, therefore sb_pos_num == sb_count (the total number of lines in the scrollback buffer).

However, tsm_screen_sb_reset() currently sets sb_pos_num to 0 when leaving scrollback mode.

Instead, it appears that sb_pos_num should be restored to sb_count to correctly reflect normal mode.

This has been tested using tsm_screen_sb_get_line_count() and tsm_screen_sb_get_line_pos() in the scrollbar implementation done for DFBTerm

@kdj0c kdj0c merged commit 964c8a0 into kmscon:main Feb 28, 2026
2 checks passed
@kdj0c
Copy link
Copy Markdown
Contributor

kdj0c commented Feb 28, 2026

Thanks for your PR.

It looks good to me, so I merged it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants