dnkl changed the topic of #foot to: Foot - fast, lightweight and minimalistic Wayland terminal emulator || 1.13.1 || https://codeberg.org/dnkl/foot || channel logs: https://libera.irclog.whitequark.org/foot
ayushnix has quit [Remote host closed the connection]
radu242 has joined #foot
cherti has quit [Ping timeout: 260 seconds]
cherti has joined #foot
jao has quit [Ping timeout: 268 seconds]
an3223 has joined #foot
an3223 has quit [Ping timeout: 258 seconds]
<Arsen> I might've found a regression: if there's lots of scrollback, resizing can lead to a crash
<Arsen> on foot version: 1.13.1 -pgo +ime +graphemes -assertions
<Arsen> notably I set [scrollback] lines=50000
<Arsen> actually, not sure if it's a regression
<Arsen> setting that could've been what exposed it
<Arsen> yeah, it's fine on lower values
<dnkl> Arsen: this is sort of known, but had been near impossible to reproduce. I've *never* seen it myself.
<Arsen> oh hmm
<dnkl> one cause for the crash was fixed in 1.13.1
<Arsen> tried a super high ines value?
<Arsen> lines*
<dnkl> tried many things
<dnkl> :)
<Arsen> what if it's kde specific
<dnkl> if you have a sure-way to reproduce, let me know.
<dnkl> very unlikely
<Arsen> I can reprod on: info: main.c:421: version: 1.13.1-40-gbb02b319 (Sep 30 2022, branch 'master') -pgo +ime +graphemes +assertions btw
<dnkl> can you get a backtrace from a debug build?
<Arsen> and it's certainly reproducible on my machine: run foot, run yes in it, rapidly resize horizontally
<Arsen> it doesn't crash, actually
<Arsen> Error sending request: Broken pipe
<Arsen> ... and does it's normal shutdown
<Arsen> err: wayland.c:1236: failed to dispatch pending Wayland events: Broken pipe
<dnkl> ok, then I think I know what it is
<dnkl> with a large scrollback, text reflow takes time
<dnkl> in this case, enough time that we don't process the incoming mouse motion events quickly enough
<dnkl> the compositor fills the socket and then kills the connection
<Arsen> that would make sense, yeah
<Arsen> running with WAYLAND_DEBUG=1, I see that it's still processing a bunch of xdg_toplevel@27.configure(...)s after the compositor closed the window already
<dnkl> difficult problem to solve. With literally can't receive the Wayland events while resizing the window.
<Arsen> my (perhaps too abstract to be useless) idea for a solution is reflowing text only when the user is trying to view it from scrollback
<Arsen> though, text handling is one of those thing's I'm especially bad at, so I can't tell how possible it'd be to implement that
<Arsen> s/thing's/things
<dnkl> won't work. reflow has to start from the start of the scrollback. you can't do a partial reflow starting at the bottom
<w0rm> dnkl: how about delaying reflow when resize happens
<dnkl> might be possible to stash the original contents when a resize is started, and only truncate, not reflow, *while* resizing. and then reflow at the end, when resize is done
<dnkl> w0rm: 😂
<Arnavion> Not reflowing until the resize ends would be very annoying
<w0rm> yeah, I suppose so...
<dnkl> yeah, I know...
<Arnavion> Can the reflow algorithm work backwards one \n-delineated span at a time?
<Arsen> maybe only reflowing top_of_screen - row_number / 2 lines and letting the rest get reflown properly later?
<dnkl> we could handle it the same way we handle WINSZCH; do it after a timeout. You can see the effect of this by quickly resizing the window in e.g vim.
<Arsen> with that being hopefully enough to hide any bad resizing
<Arsen> er, I put that formula poorly
<Arsen> start from top_of_screen - row_number / 2
<dnkl> the problem is how to track the source content over multiple quick resizes, when only reflowing parts of it
<dnkl> I think the "delay" solution can wor, if the delay is sufficient small. I could try writing up a POC
<Arsen> by operating on a copy maybe? with that hopefully not being too large to copy quickly
<Arsen> and only reflowing the whole thing on a delay
<dnkl> Yeah, keep a copy of the original content *while* resizing. First iteration of the solution would just truncate, then reflow after a delay, or when resize is done.
<dnkl> Later iterations can experiment with partial reflow, to improve user experience
<Arsen> yeah, that's fair
<Arsen> thanks btw
<dnkl> copying is not an issue - we're already doing that. It's just a matter of not free:ing the original content
Ordoviz has joined #foot
an3223 has joined #foot
an3223 has quit [Ping timeout: 258 seconds]
an3223 has joined #foot
an3223 has quit [Ping timeout: 258 seconds]
talismanick has quit [Ping timeout: 244 seconds]
midgard has quit [Quit: Bye]
lbia has joined #foot
<dnkl> Arsen: fwiw, I just tested kitty, and it uses the exact same method.
<dnkl> I have a POC the does work, and greatly improves performance. For very large grids, there's still a noticable delay when starting the resize, caused by copying the original grid. I think we can get rid of that too, but requires more work
midgard has joined #foot
jao has joined #foot
rodrgz has joined #foot
ayushnix has joined #foot
ayushnix has joined #foot
ayushnix has quit [Changing host]
jao has quit [Ping timeout: 264 seconds]
lbia has quit [Quit: lbia]
ayushnix has quit [Ping timeout: 252 seconds]
ayushnix has joined #foot
ayushnix has joined #foot
ayushnix has quit [Changing host]
caveman has quit [Remote host closed the connection]
caveman has joined #foot
jao has joined #foot
lbia has joined #foot
talismanick has joined #foot
Ordoviz has quit [Quit: WeeChat 3.6]
talismanick has quit [Ping timeout: 268 seconds]
rodrgz has quit [Quit: WeeChat 3.5]
an3223 has joined #foot
an3223 has quit [Ping timeout: 258 seconds]
an3223 has joined #foot
talismanick has joined #foot
an3223 has quit [Remote host closed the connection]
an3223 has joined #foot