git: 9ddd9ff24bb1 - stable/15 - vidcontrol: Disallow -i mode with vt(4)

Ed Maste <[email protected]> Sat, 01 Aug 2026 15:30:23 +0000
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a6e110f.37dfe.2e7c97af__43576.2346651003$1785598242$gmane$org@gitrepo.freebsd.org>
The branch stable/15 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=9ddd9ff24bb1ebd0a432702d0057ad66a7277478

commit 9ddd9ff24bb1ebd0a432702d0057ad66a7277478
Author:     Ed Maste <[email protected]>
AuthorDate: 2026-03-10 21:13:31 +0000
Commit:     Ed Maste <[email protected]>
CommitDate: 2026-08-01 15:30:12 +0000

    vidcontrol: Disallow -i mode with vt(4)
    
    vt(4) does not (currently) support changing the video mode.  Report that
    -i mode is not supported rather than printing an empty list.
    
    PR:             207411
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D58163
    
    (cherry picked from commit c3e38c0093f2dbfafdfcc585a2f06b0313e7f6b1)
---
 usr.sbin/vidcontrol/vidcontrol.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/vidcontrol/vidcontrol.c b/usr.sbin/vidcontrol/vidcontrol.c
index e4cf1e8efc53..87e779eca9f2 100644
--- a/usr.sbin/vidcontrol/vidcontrol.c
+++ b/usr.sbin/vidcontrol/vidcontrol.c
@@ -182,7 +182,7 @@ usage(void)
 	if (vt4_mode)
 		fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n",
 "usage: vidcontrol [-Cx] [-b color] [-c appearance] [-f [[size] file]]",
-"                  [-g geometry] [-h size] [-i active | adapter | mode]",
+"                  [-g geometry] [-h size] [-i active | adapter]",
 "                  [-M char] [-m on | off]",
 "                  [-r foreground background] [-S on | off] [-s number]",
 "                  [-T xterm | cons25] [-t N | off] [mode]",
@@ -1206,7 +1206,10 @@ show_info(char *arg)
 	} else if (!strcmp(arg, "adapter")) {
 		show_adapter_info();
 	} else if (!strcmp(arg, "mode")) {
-		show_mode_info();
+		if (vt4_mode)
+			warnx("-i mode is not supported by vt(4)");
+		else
+			show_mode_info();
 	} else {
 		revert();
 		errx(1, "argument to -i must be active, adapter, or mode");