-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Improved terminfo parser #51198
Improved terminfo parser #51198
Conversation
Oh, for this too, please don't squash-merge this. I put effort into commit messages, and it makes me sad when github stomps on it and mangles some more of the commit data while it's at it. |
f1cb65a
to
862c548
Compare
Oh also, it would be good if anyone knew of any other terminfo parsers that we could easily test against, I've found it hard to locate anything easy to use. |
862c548
to
b5e6ea3
Compare
Converted this to a draft, since you described it as such. Comment when this is ready or convert it back to non-draft state. |
b5e6ea3
to
7b071d4
Compare
7b071d4
to
de26721
Compare
Took the need to rebase as an opportunity to remove more broadcasting, after it was raised as an annoyance in #51399 (comment). |
5f73406
to
a84ddcb
Compare
I haven't been able to figure out the linked bug, but it seems like this refactor fixes some problems people ran into on Slack, so maybe we should merge this for now as an improvement? |
I don't think #51399 has any bearing on the
So I'm thinking we should merge this and keep on trying to work out exactly what is/should be going on with |
If someone would be willing to review+merge this, or say why they think it shouldn't be yet, that would be much appreciated 🙏. |
I don't know a lot about terminfo, is this mostly useful for the REPL (and non-Windows)? Can all of the terminfo functionality be excluded from the sysimage, until you do |
Pretty much. We want this for TTY output.
We'd actually need I think this would be best discussed in a separate issue/PR though. For now, this PR is just improving the current implementation. There are more (minor) improvements that I'd like to see made, but I don't want to let perfect be the enemy of the good (or here: better) which is why I'd like to see this "just merged". |
Bump |
This PR is still waiting for attention 🙂 |
This bundles up the following changes: - Rejiged TermInfo struct - Read the extended terminfo table using the same method as the non-extended table - Use signed integer types for most numeric values, as per term(5) - More robust get(::TermInfo, ...) methods - Better match the terminfo(5) "Fetching Compiled Descriptions" behaviour
a84ddcb
to
2b9d95c
Compare
While the initial terminfo PR turned out fairly well (in my biased opinion anyway 😛), it could do with a few improvements. This is a draft PR to collect the work done so far and discuss what else should be done.
So far this fixes #51190 but not (yet) #51110. Across the 2873 terminfo files on my system, I currently see seven errors raised, all in the style of #51110 (for various
screen.X
terms).The
TermInfo
struct has also been changed fromto
So it's now not possible for
get(::TermInfo, ::Symbol, default)
to get a surprising type, with the following dedicated flag/number/stringget
methods.This does slightly complicate
haskey
,keys
, andgetindex
but I feel might be worth it overall? I'm interested in second opinions.It would probably be nice to also add some more targeted test cases. We could probably use
tic -x -o .
for this?