Page MenuHomeFreeBSD

Improve resizewin(1).
ClosedPublic

Authored by trasz on May 6 2017, 11:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 10 2024, 11:34 PM
Unknown Object (File)
Sep 8 2024, 2:54 PM
Unknown Object (File)
Sep 5 2024, 8:42 PM
Unknown Object (File)
Aug 5 2024, 6:16 AM
Unknown Object (File)
Aug 4 2024, 1:10 AM
Unknown Object (File)
Jul 28 2024, 10:51 PM
Unknown Object (File)
Jul 7 2024, 4:44 PM
Unknown Object (File)
Jul 6 2024, 8:41 PM
Subscribers

Details

Summary

The patch does two things: it improves the way the utility reports
warnings and errors, and minimizes the chance for "unable to parse
response" error which happens when you type too fast for the machine
you're running it on (or for the serial link, not sure).

Plan is to commit those two things separately.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cem added inline comments.
usr.bin/resizewin/resizewin.c
98 ↗(On Diff #28102)

Is there any guarantee data is nul-terminated? Maybe "%.*s", (int)cnt, data?

This revision is now accepted and ready to land.May 6 2017, 3:25 PM
usr.bin/resizewin/resizewin.c
98 ↗(On Diff #28102)

Doubtful, there's probably not any point printing it (and wasn't before) except I was using it to debug when I wrote it originally.

i.e. I think you can just replace it with a single warnx("\n\ntimeout reading from terminal");

I think the \n's are worthwhile because the terminal might eat the message otherwise.

usr.bin/resizewin/resizewin.c
98 ↗(On Diff #28102)

I don't think we can add '\n's like that; warn(3) prefixes the output with the command line and it would look weird. Also, I've experimented a bit and it still displayed properly.

This revision was automatically updated to reflect the committed changes.