-
-
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
terminfo parser cannot handle ncurses 6.4's screen.xterm-256color #51110
Comments
Ok, I've just had a little look at this. I've done a small investigation. The short versionI think the terminfo file is malformed, or I've misunderstood something. The long versionThe terminfo file starts as follows.
Since it starts with the magic value At this point, we're at At
The next five (
At this point, it's doesn't look like the numbers add up. A table entry is required to label every flag+number+string entry, and also to give the value of each string entry. In other words,
This clearly doesn't line up, and we'll see more later. At this point, we are at
The last index is apparently However, since we are told there are 149 table entries (not 150), the next two bytes ( The first 74 table entries are read as read as string values. In addition to the first value, the last value also looks odd — more like a label value. (Base) julia> strings = table_strings[1:string_count]
74-element Vector{String}:
"\x83\x01\e]112\a"
"\e]12;%p1%s\a"
"\e]52;%p1%s;%p2%s\a"
"\e[2 q"
⋮
"\e[29m"
"\e[9m"
"\e[M%?%p4%t%p3%e%{3}%;%' '%+%c%p2%'!'%+%c%p1%'!'%+%c"
"AX" Then we end up with 75 labels for 2 flags and 74 strings, and the error you've reported. So, I'm not sure what's going on with this terminfo file, or how we should handle it. Immediate stepsThis all said, I have noticed one or two touch-ups that should be done to Other people's thoughts on this particular terminfo file would be appreciated. |
I've now tested against the 2873 terminfo files on my system, and I'm finding seven cause any problems (all of this sort): (Base) julia> terms = let terms = String[]
for (root, dirs, files) in walkdir("/usr/share/terminfo")
append!(terms, files)
end
terms
end;
(Base) julia> for term in terms
try
Base.load_terminfo(term)
catch err
@error "Failed with $term" err
end
end
┌ Error: Failed with screen-bce.xterm-new
│ err = DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 75 and 76
└ @ Base REPL[3]:5
┌ Error: Failed with screen.putty-m1
│ err = DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 7 and 8
└ @ Base REPL[3]:5
┌ Error: Failed with screen.putty-m1b
│ err = DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 7 and 8
└ @ Base REPL[3]:5
┌ Error: Failed with screen.putty-m2
│ err = DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 7 and 8
└ @ Base REPL[3]:5
┌ Error: Failed with screen.xterm-256color
│ err = DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 75 and 76
└ @ Base REPL[3]:5
┌ Error: Failed with screen.xterm-new
│ err = DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 75 and 76
└ @ Base REPL[3]:5
┌ Error: Failed with screen.xterm-xfree86
│ err = DimensionMismatch: arrays could not be broadcast to a common size; got a dimension with lengths 75 and 76
└ @ Base REPL[3]:5 |
Can anyone else confirm that this was fixed by #51399? I tried to reproduce earlier today and found out that it was working. |
This seems to work now; closing. |
As noticed on Arch Linux, in a screen session:
MWE:
... or:
screen.xterm-256color.zip
x-ref: #50797 (cc @tecosaur)
The text was updated successfully, but these errors were encountered: