Re: [dev] [st] [PATCH 2/2] Keep end of lines in memory when resizing terminal

From: Anselm R Garbe <>
Date: Tue, 28 Mar 2017 10:07:07 +0200

On 27 March 2017 at 23:52, Alexander Krotov <> wrote:
> On Mon, Mar 27, 2017 at 10:00:43PM +0200, Anselm R Garbe wrote:
>> nevertheless I do think that all this still doesn't justify a
>> scrollback buffer built into st itself. Instead of mandating the use
>> of tmux et al, I would rather put a helper tool into the st repo, that
>> works as a basic shell wrapper process (no detaching). It would
>> implement the scrollback buffer only and allow to define its size in a
>> more flexible way (possibly via a command line argument) and also the
>> control sequences / key combos to actually scroll around. The tool
>> name could be stsb or something similar.
>> What do you think about this compromise?
> As Laslo Hunhold suggests down the thread, this solution is likely to be
> more complex.
> To implement it properly, you have to implement a whole VT inside
> of stsb, because it has to pass mouse events down and keep track
> of character attributes. ncurses programs will output all kinds
> of "move cursor here" and "change color" control sequences, but you
> can't just pass them again to st when you need to scroll around. You

I wouldn't implement a whole VT inside it, just filter all curses crap
out and only cache filtered regular unformatted stream output for
scrolling. There is no point to scroll back in curses mode anyways.

> In the end, you will have a stripped down dvtm, with vt but without
> multiplexing.

I would raise the bar and claim, it should be doable in less than 300 lines.

> After that, I can proceed with implementation of scrollback based
> on ring buffer. If it makes code simpler (by removing line shuffling,
> allocation and deallocation in tresize), it may be integrated into
> st. If not, it will be just another patch.

I'm not totally against putting scrollback into st, for the same
reason as putting a status bar into dwm. It could turn out to be the
simpler solution after all. But I'm not convinced yet. One has to try
very hard, before making compromises ;)

Received on Tue Mar 28 2017 - 10:07:07 CEST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 10:12:12 CEST