Commit Graph

11 Commits

Author SHA1 Message Date
Warner Losh
1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Jessica Clarke
456c1199d3 resizewin: Stop printing bogus NUL to TTY
A char array has an implicit NUL terminating it, which sizeof will
include, so we need to subtract 1 here. Printing a NUL can cause issues
for things like CI environments that aren't expecting it, especially
with recent Jenkins being stricter about not putting NUL in XML files.

Fixes:		3d222369ac ("Add a small tool, resizewin(1), to query terminal for window size")
MFC after:	1 week
2023-06-14 23:58:36 +01:00
Edward Tomasz Napierala
deb808ad3b Improve terminology in a comment.
Suggested by:	ian
MFC after:	2 weeks
2017-06-26 16:08:28 +00:00
Edward Tomasz Napierala
dd99f75ce6 Make resizewin(1) do flushing by using TCSAFLUSH instead of TCSANOW
followed by tcflush(3).  This works just as well and is more elegant.

Suggested by:	bde
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-06-26 13:14:41 +00:00
Edward Tomasz Napierala
bd274cceae Sort variable declarations; no functional changes.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-05-08 09:14:41 +00:00
Edward Tomasz Napierala
f1504c0c26 Add resizewin -z. It makes resizewin not do anything if the terminal
size is already set to something other than zero. It's supposed to be
called from eg /etc/profile - it's not neccessary to query terminal
size when logging in over the network, because the protocol used already
takes care of this, but it's neccessary when logging over a serial line.

Reviewed by:	cem, Daniel O'Connor <darius@dons.net.au>
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10637
2017-05-08 08:58:51 +00:00
Edward Tomasz Napierala
048fd859ce Use tcflush(3) instead of (nonstandard) TIOCFLUSH.
Reported by:	kib
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-05-08 08:34:50 +00:00
Edward Tomasz Napierala
7ffc8a5418 Make resizewin(1) discard the terminal queues, to lower the chance
for "unable to parse response" error which happens when youre typing
too fast for the machine you're running it on.

Reviewed by:	cem, Daniel O'Connor <darius@dons.net.au>
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10624
2017-05-07 17:21:22 +00:00
Edward Tomasz Napierala
31cf65bbf8 Rename a variable, hopefully fixing build after r317901.
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
2017-05-07 12:08:41 +00:00
Edward Tomasz Napierala
46f44afb63 Improve error reporting in resizewin(1).
Reviewed by:	cem (earlier version)
MFC after:	2 weeks
Sponsored by:	DARPA, AFRL
Differential Revision:	https://reviews.freebsd.org/D10624
2017-05-07 09:19:42 +00:00
Conrad Meyer
3d222369ac Add a small tool, resizewin(1), to query terminal for window size
Submitted by:	Daniel O'Connor
Reviewed by:	kan, wblock, cem
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D4438
2016-04-13 00:30:42 +00:00