Page MenuHomeFreeBSD

Improve resizewin(1).
ClosedPublic

Authored by trasz on May 6 2017, 11:05 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 24, 12:44 PM
Unknown Object (File)
Fri, May 23, 10:29 PM
Unknown Object (File)
Wed, May 21, 1:11 AM
Unknown Object (File)
Mon, May 19, 3:31 AM
Unknown Object (File)
Apr 24 2025, 8:53 PM
Unknown Object (File)
Apr 21 2025, 12:18 AM
Unknown Object (File)
Apr 20 2025, 1:03 PM
Unknown Object (File)
Apr 16 2025, 7:29 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.