On Wed, Mar 22, 2017 at 11:55:33AM +0100, hiro wrote: > example: make the terminal smaller, make it bigger again: lines have > been cut off...
It is a bug in st and xterm. tmux and screen handle it by reflowing lines, wrapping them if necessary. dvtm makes end of lines invisible [1] but keeps them in memory. I have already created a patch to fix it in st, will submit it to dev@suckless.org after some cleanup. I implemented dvtm approach. It is simpler, because number of lines always stays the same. Therefore, no lines are removed. And we don't have an option to move them to scrollback, because st has no scrollback. Just a thought: adding scrollback to st can make code simpler and faster. Goal of st is not to have unlimited scrollback buffer [2], but using ring buffer should be ok. Just allocate 1024 lines at the start and use part of them. No need to shuffle lines around in tresize etc. Scrollback patch [3] can be reimplemented along these lines without adding separate history variable. [1] https://github.com/martanne/dvtm/blob/master/vt.c#L129 [2] http://st.suckless.org/goals [3] http://st.suckless.org/patches/scrollback