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

Increase CSI param limit to 256 to match Kitty #6194

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jdugan6240
Copy link

On the current WezTerm master, the maximum number of params a CSI sequence is allowed to have is 32, which is too low to successfully parse some perfectly valid CSI sequences as described here: #5161.

This PR increases this limit to 256 params, as this is what the Kitty terminal emulator uses.

One unfortunate side effect is that due to this change, the byte string in the csi_too_many_params test now needs to have 257 params in its CSI sequence, which makes the test rather unwieldy. I am open to suggestions on how to improve this situation.

Copy link
Owner

@wez wez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for diving in!

vtparse/src/lib.rs Outdated Show resolved Hide resolved
@@ -422,7 +422,7 @@ impl VTParser {
full: false,
},

params: Default::default(),
params: [CsiParam::Integer(0); MAX_PARAMS],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this change needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default::default() doesn't work on 256 element long arrays - at least, I couldn't get it to work.

@jdugan6240
Copy link
Author

@wez, I'm tremendously sorry it took me so long to get back to this PR. I cleaned up the csi_too_many_params test, but unfortunately the Default::default() change did in fact prove necessary.

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