Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]>
- Loading branch information