Page MenuHomeFreeBSD

Improve resizewin(1).
ClosedPublic

Authored by trasz on May 6 2017, 11:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 10 2023, 8:53 PM
Unknown Object (File)
Sep 26 2023, 12:35 PM
Unknown Object (File)
Sep 26 2023, 6:02 AM
Unknown Object (File)
Aug 21 2023, 5:33 PM
Unknown Object (File)
Jul 25 2023, 1:01 AM
Unknown Object (File)
Jun 5 2023, 9:58 PM
Unknown Object (File)
Jun 5 2023, 9:45 PM
Unknown Object (File)
May 4 2023, 4:36 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.