[dev] [st] When shrinking the width of a st window, overflowing text gets cut out and it is no longer retrievable, not even if the width is reset to the original one

122 views
Skip to first unread message

LuxGiammi

unread,
Jan 5, 2021, 2:17:10 PM1/5/21
to d...@suckless.org
Dear suckless developers,

It's my first message in this mailing list.
I've been using st for more than one year and I've always had the
intention to ask this. I know that there must be a way to solve the
problem (in fact, I started to study X programming in my - little -
spare time just for this reason), but as for now, I'm quite stuck. I
regularly use a window manager (I started with i3, but now I'm happily
using dwm) and it's not so uncommon that I need more than one terminal
on the screen. The problem is, however, that whenever I spawn more
terminals, depending, of course, on the WM layout, the overflowing text
of shrunk terminals gets cut and therefore permanently lost. For the "Y
axis" text I simply installed the scrollback patch, but for the "X axis"
text, apparently, there are no patches.

So my questions for you are:
1. Has this problem previously discussed? If so, what were the outcomes
of the discussion?
2. I haven't found one yet on the website, but is there a patch that
solves this problem?

Thanks in advance.

Luxgiammi

runrin

unread,
Jan 5, 2021, 6:10:20 PM1/5/21
to dev mail list
Using a terminal multiplexer such as tmux solves this problem.

Laslo Hunhold

unread,
Jan 6, 2021, 9:52:45 AM1/6/21
to d...@suckless.org
On Tue, 05 Jan 2021 20:16:57 +0100
LuxGiammi <luxgiammi...@posteo.net> wrote:

Dear Luxgiammi,
thanks for your mail and reaching out! This is a philosophical
question, and I agree with you in fixing this in st, others don't (with
good reasons on both sides). Especially in the context of dwm I'm often
annoyed when the text is cut off. To keep things simple, a project
called scroll[0] was started to provide a scrollback buffer and
line-retainment in st. Try it out, it might suit your needs!

With best regards

Laslo

[0]:https://git.suckless.org/scroll/

Lee Phillips

unread,
Jan 6, 2021, 11:13:21 AM1/6/21
to dev mail list
By the way: some other terminal programs do not have this problem. For example, xfce4-terminal retains the information in its window under dwm resizing. However, it uses three times the memory of either st or xterm.

Lee Phillips

unread,
Jan 6, 2021, 11:28:26 AM1/6/21
to dev mail list
I compiled the current version of this scroll program and used it with both st and xterm. It had no effect. The programs behaved as before, with lines getting erased after window resizing.

I also prefer to use dwm to manage my terminal windows rather than a multiplexer, so I am keenly interested in a solution to this problem. It is the only thing that makes the dwm experience less than perfectly delightful.


Sebastian LaVine

unread,
Jan 6, 2021, 12:14:22 PM1/6/21
to d...@suckless.org
On 1/6/21 9:48 AM, Laslo Hunhold wrote:> thanks for your mail and
reaching out! This is a philosophical
> question, and I agree with you in fixing this in st, others don't (with
> good reasons on both sides). Especially in the context of dwm I'm often
> annoyed when the text is cut off. To keep things simple, a project
> called scroll[0] was started to provide a scrollback buffer and
> line-retainment in st. Try it out, it might suit your needs!
>
> With best regards
>
> Laslo
>
> [0]:https://git.suckless.org/scroll/
>

I just successfully built scroll and it seems to do the same thing that
GNU screen and other multiplexers do, which is wrap lines when the
terminal window is cut in dwm. This isn't quite what I personally would
want; I would prefer if the lines didn't wrap, but just the information
that is cut out is redrawn when the window size is expanded. Kindof like
how `less -S` works. But this will require some tinkering on my part, I
think :)

--
Sebastian LaVine | https://smlavine.com

Greg Reagle

unread,
Jan 6, 2021, 1:16:44 PM1/6/21
to d...@suckless.org
On Wed, Jan 6, 2021, at 10:50, Lee Phillips wrote:
> I compiled the current version of this scroll program and used it with
> both st and xterm. It had no effect.

No effect at all? It is at least supposed to allow you to scroll back. I suspect something is wrong with the way you're trying to use scroll.

Lee Phillips

unread,
Jan 6, 2021, 1:23:15 PM1/6/21
to dev mail list
> No effect at all? It is at least supposed to allow you to scroll back. I suspect something is wrong with the way you're trying to use scroll.

Sorry, I think I already had a scrollback patch applied to st, so I could already scroll back (and I forgot that that patch was in there). So my message was misleading. However, it has no effect on what I'm after: restoring the parts of lines cut off horizontally when changing the sizes of windows. How to use: aren't I supposed to type `scroll st` to start the terminal?

Sebastian LaVine

unread,
Jan 6, 2021, 2:03:10 PM1/6/21
to d...@suckless.org
On 1/6/21 1:22 PM, Lee Phillips wrote:
> Sorry, I think I already had a scrollback patch applied to st, so I could already scroll back (and I forgot that that patch was in there). So my message was misleading. However, it has no effect on what I'm after: restoring the parts of lines cut off horizontally when changing the sizes of windows. How to use: aren't I supposed to type `scroll st` to start the terminal?
>

What I did to make it work is to run "./scroll" in an already-existing
st window, as you would with GNU screen or tmux.

Lee Phillips

unread,
Jan 6, 2021, 2:39:57 PM1/6/21
to dev mail list
> What I did to make it work is to run "./scroll" in an already-existing st
> window, as you would with GNU screen or tmux.

This works! Thank you very much.

I was following the instructions in the man page, which say to do `scroll st`.

Nick

unread,
Jan 6, 2021, 6:07:32 PM1/6/21
to dev mail list
Quoth Lee Phillips:
Nope, the manpage includes this (and looking at git history, has
since its inception):

EXAMPLES
st -e scroll /bin/sh

You must have misread it. Anyway, I'm glad it's working for you.
This thread encouraged me to try it out too (I've been using dvtm
for this purpose up 'til now), and it seems to be working just fine.

Nick

Lee Phillips

unread,
Jan 6, 2021, 6:14:01 PM1/6/21
to dev mail list
> Nope, the manpage includes this (and looking at git history, has
> since its inception):
>
> EXAMPLES
> st -e scroll /bin/sh
>
> You must have misread it.

You're right, it does say that. But I didn't so much misread it as read the top of it, were it has:

SYNOPSIS
scroll [-Mh] [-m size] [program [arg ...]]

and failed to read the EXAMPLES. Aren't the SYNOPSIS and EXAMPLES contradictory?


Reply all
Reply to author
Forward
0 new messages