1
1
mirror of https://github.com/wez/wezterm.git synced 2025-01-08 07:01:35 +03:00
wezterm/config
x3ro 6a2e356156
Validate scrollback_lines to avoid crashes (#5996)
* Validate scrollback_lines to avoid crashes

I started using wezterm today, and I immediately tried to configure it
to use "infinite scrollback", as I use in iTerm2. From the configuration
I couldn't tell if there was a way to do this, so I just set it to a
really large number, hoping that would work. Interestingly this works
for very large numbers when the config is just being reloaded while the
terminal is running, but if you then try to restart the application it
crashes (tried to allocate like 100PB or something).

I then came across #1342 and thought "that's seems a bit too involved",
and decided that I probably don't need infinite scrollback, but just
kind of a large number. Through fair dice roll I determined `one billion - 1`
will probably suffice.

Now, this might not be the best solution, so I'm happy to get some feedback.
I was also thinking that it would be nice if one could just set it to `0`,
and then the applicatio determines a suitably large number for the amount of
RAM available, but a) I wasn't sure how this would be best implemented in the
confines of the current architecture, and b) I wasn't sure if it would be well
received.

Long story short, happy to hear your feedback.

* simplify slightly

---------

Co-authored-by: Wez Furlong <wez@wezfurlong.org>
2024-09-14 11:33:53 -07:00
..
derive allow some unused fields 2024-07-14 07:50:30 -07:00
src Validate scrollback_lines to avoid crashes (#5996) 2024-09-14 11:33:53 -07:00
Cargo.toml deps: dedup some nix versions 2024-05-13 11:53:27 -07:00