Skip to content

Refactor scrollback and selection#36

Open
kdj0c wants to merge 7 commits intokmscon:mainfrom
kdj0c:linked_list
Open

Refactor scrollback and selection#36
kdj0c wants to merge 7 commits intokmscon:mainfrom
kdj0c:linked_list

Conversation

@kdj0c
Copy link
Copy Markdown
Contributor

@kdj0c kdj0c commented Apr 17, 2026

scrollback/selection: refactor scrollback and selection code

scrollback: Use a standard double linked list instead of open
coding it everywhere.
selection: Use the same line pointer, if the line is in the screen
or in the scrollback. This greatly simplify the code.

Fix kmscon/kmscon#330

Jocelyn Falempe added 2 commits April 17, 2026 09:57
scrollback: Use a standard double linked list instead of open
coding it everywhere.
selection: Use the same line pointer, if the line is in the screen
or in the scrollback. This greatly simplify the code.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Make sure posx and posy are on the screen, before setting the selection.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Jocelyn Falempe added 3 commits April 17, 2026 10:14
This remove some duplicated code

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Add a generic function to get the next selection line, and use that
to count and copy the lines, regardless if they are in the scrollback
buffer or not.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
Jocelyn Falempe added 2 commits April 17, 2026 11:31
Otherwise the selection pointers may point to the other screen lines
which can cause problems when trying to copy.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
The scrollback is only for the main screen.
Also remove the reset from the tests, as its not necessary, and now
reset the scrollback.

Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
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.

Segfault in calc_line_len from libtsm

1 participant