maaslalani / slides

Terminal based presentation tool
http://maaslalani.com/slides/
MIT License
9.65k stars 264 forks source link

Screen not cleaned up properly (Windows build from source) #232

Open cpkio opened 1 year ago

cpkio commented 1 year ago

Describe the bug Screen is not cleared up when switching between slides.

To Reproduce Set the terminal to 80×18 (big font size), load this sample (random text):

---
author: "Bugs demo"
date: "dd.MM.YYYY"
paging: "%d / %d"
---

# Только сложившаяся структура организации станет частью наших традиций

* Внезапно, непосредственные участники технического
  прогресса являются только методом политического
  участия и своевременно верифицированы.

* Вот вам яркий пример современных тенденций —
  дальнейшее развитие различных форм деятельности
  играет важную роль в формировании поставленных
  обществом задач.

* Имеется спорная точка зрения, гласящая примерно
  следующее: тщательные исследования конкурентов
  являются только методом политического участия
  и ограничены исключительно образом мышления.

---

# Убеждённость некоторых оппонентов расставила все точки над i

* В своём стремлении повысить качество жизни, они
  забывают, что новая модель организационной
  деятельности играет важную роль в формировании
  соответствующих условий активизации.

* Вот вам яркий пример современных тенденций —
  семантический разбор внешних противодействий
  позволяет оценить значение соответствующих условий
  активизации.

Expected behavior Expected to see no text from previous slide on next one.

Screenshots

2023-04-11_131430

2023-04-11_131437

(the header and the first line of the first slide leaked to the second)

Desktop (please complete the following information):

Delta456 commented 1 year ago

I can reproduce the same on Linux using kitty terminal.

hotbrightsunshine commented 1 year ago

I am experiencing this issue too. I fear this has to do with the usage of the \t character. When using a code block (three backticks), using \t will always issue this problem. When rendering normal text, screen is not correctly cleared when using a \t. Some pattern I noticed:

\t

will always clear wrongly.

hello\t with tab 

Using a \t inside a string is problematic, but using it at the beginning of the line is not. End of line doesn't seem to be a problem.

I am using slides under Linux Mint, with Gnome Terminal, and under Fedora with Gnome Terminal too. I am not familiar with Go programming language, but I might take a look at the source code to see if there is any problem regarding what I said.

XiaoPengYouCode commented 8 months ago

I find a same problems, if this page has content and the corresponding position of the previous page is blank, when I return to the previous page, the content of the corresponding position of this page will be retained, my command line environment is gnome42.9

gamebox commented 6 months ago

Seeing the same thing on macOS Sonoma with Alacritty. Removing all tabs from inside code blocks resolves the issue

gamebox commented 6 months ago

I wonder if swapping these two lines in internal/model/model.go:210-211 would fix the issue?

slide, err := r.Render(slide)
slide = strings.ReplaceAll(slide, "\t", tabSpaces)