Re: [dev] [st] Understading st behaviour

From: <>
Date: Wed, 16 Apr 2014 11:54:34 -0400

On Wed, Apr 16, 2014, at 4:19, Amadeus Folego wrote:
> It works! As I am using tmux just for the scrollback and paste
> capabilities I am not worried with losing sessions.
> Maybe I'll write a suckless multiplexer for this sometime.

Eh - "multiplexing" refers to the multiple session capability, not to
the scrolling.

The basic issue is that tmux provides three relatively distinct
features: scrolling, multiplexing, and detachability. A program
providing any one of these capabilities essentially has to be a terminal
emulator - you can take some shortcuts, like passing through the
keyboard, and passing through output rather than reinterpreting it, but
you've got to parse all output control sequences to know what's on the
screen. For scrolling, you need it in order to understand what has
scrolled off the screen and in order to restore the main screen when
you're done with scrolling. For multiplexing, you need it in order to
effectively switch between windows. For detaching, you need it to
restore the content when reattaching.

I've actually used a detaching program that doesn't track screen
contents (it discards all output while detached, and sends SIGWINCH or
control-L on reattach to make the program redraw itself) - it's not
pleasant to deal with for non-fullscreen programs. You could do
multiplexing the same way, in principle, but it's intractable for

A "truly suckless" design would have the three features in separate
programs. And since they all have to do essentially the same thing
(maintain their own idea of the screen state and redraw it on demand),
this functionality could be in a library. Or you could just have it in
the scrolling program and the other two programs don't care, which would
make it a somewhat unpleasant experience to try to use them without
being in conjunction with the scrolling program.

That's also three separate programs you have to control from the
Received on Wed Apr 16 2014 - 17:54:34 CEST

This archive was generated by hypermail 2.3.0 : Wed Apr 16 2014 - 18:00:14 CEST