Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate scrollback_lines to avoid crashes #5996

Merged
merged 2 commits into from
Sep 14, 2024

Conversation

x3ro
Copy link
Contributor

@x3ro x3ro commented Aug 19, 2024

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.

PS: I'm happy to add documentation, etc. as needed, just wanted to get some feedback first before I invest that time 🙂

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 wez#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.
config/src/config.rs Outdated Show resolved Hide resolved
@wez wez merged commit 6a2e356 into wez:main Sep 14, 2024
14 of 17 checks passed
wez added a commit that referenced this pull request Sep 14, 2024
@wez
Copy link
Owner

wez commented Sep 14, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants