aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/vidcontrol
Commit message (Collapse)AuthorAgeFilesLines
* usr.sbin: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Purge more stray embedded $FreeBSD$ stringsJohn Baldwin2023-09-252-10/+0
| | | | | | | These do not use __FBSDID but instead use bare char arrays. Reviewed by: imp, emaste Differential Revision: https://reviews.freebsd.org/D41957
* Remove $FreeBSD$: one-line nroff patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\.\\"\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-162-2/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-162-2/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Update/fix Makefile.depend for userlandSimon J. Gerraty2023-04-191-1/+0
|
* pkgbase: Create a FreeBSD-console-tools packageEmmanuel Vadot2023-02-081-0/+1
| | | | | | | | | | | | | | | And put in it: - kbdcontrol - vidcontrol - moused - kbdmap Those aren't useful in a jail or for a modern desktop. While here, split the devd.conf part into some new files. Reviewed by: bapt Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D38321
* vidcontrol: disable p, P, and H when vt(4) is in useEd Maste2022-04-071-2/+2
| | | | | | | | | | | | | These options use the CONS_SCRSHOT ioctl to capture the contents of the current console, which is not yet supported by vt(4). Disable the options when vt(4) is in use rather than emitting a possibly confusing error message. This change should be reverted if CONS_SCRSHOT is implemented for vt(4). PR: 263099 MFC after: 1 week Sponsored by: The FreeBSD Foundation
* vidcontrol: be explicit that -p and -P are sc(4) onlyEd Maste2022-04-061-1/+5
| | | | | | PR: 263099 MFC after: 1 week Sponsored by: The FreeBSD Foundation
* Move font related data structured to sys/font.c and update vtfontcvtToomas Soome2020-06-141-18/+9
| | | | | | | | | | | | | | | Prepare support to be able to handle font data in loader, consolidate data structures to sys/font.h and update vtfontcvt. vtfontcvt update is about to output set of glyphs in form of C source, the implementation does allow to output compressed or uncompressed font bitmaps. Reviewed by: bcr Differential Revision: https://reviews.freebsd.org/D24189 Notes: svn path=/head/; revision=362172
* Fix restoring the geometry when recovering from an error. Just restore theBruce Evans2019-04-081-3/+2
| | | | | | | | previous geometry, and don't do extra work to calculate the default geometry so as to reset to that. Notes: svn path=/head/; revision=346024
* Oops, actually fix warnings from -Wpointer-sign.Bruce Evans2019-02-221-3/+3
| | | | Notes: svn path=/head/; revision=344460
* Fix warnings from -Wpointer-sign.Bruce Evans2019-02-221-3/+3
| | | | Notes: svn path=/head/; revision=344459
* Connect the restored dumb and sc terminal emulators to the kernel build.Bruce Evans2019-02-222-7/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add or fix options to control static and dynamic configuration. Keep the default of scteken, but default to statically configuring all available emulators (now 3 instead of 1). The dumb emulator is almost usable. libedit and libreadline handle dumb terminals perfectly for at least shell history. less(1) works as well as possible except on exit. But curses programs make messes. The dumb emulator has strange color support, with 2 dumb colors for normal output but fancy colorization for the cursor, mouse pointer and (with a non-dumb initial emulator) for low-level console output. Using the sc emulator instead of the default of scteken fixes at least the following bugs: - NUL is a printing character in cons25 but not in teken - teken doesn't support fixed colors for "reverse" video. - The best versions of sc are about 10 times faster than scteken (for printing to the frame buffer). This version is only about 5 times faster. Fix configuration features: - make SC_DFLT_TERM (for setting the initial emulator) a normal option. Add configuration features: - negative options SC_NO_TERM_* for omitting emulators in the static config. Modules for emulators might work, but I don't know of any - vidcontrol -e shows the available emulators - vidcontrol -E <emulator> sets the active emulator. Notes: svn path=/head/; revision=344458
* vidcontrol(1): Fix a typo in the description of -fTobias Kortkamp2018-10-201-19/+19
| | | | | | | | | | | | | While here: - Fix markup in -c - Fix mandoc -Tlint and igor warnings Reviewed by: 0mp, bjk Approved by: bjk Differential Revision: https://reviews.freebsd.org/D17428 Notes: svn path=/head/; revision=339448
* various: general adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-272-0/+4
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using misidentified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. No functional change intended. Notes: svn path=/head/; revision=326276
* vidcontrol: correct history size error messageEd Maste2017-11-211-1/+1
| | | | | | | | | | | `vidcontrol -h 0` is acceptable, so be explicit that it's less than zero that is not allowed. Reported by: Siva Mahadevan Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=326057
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Support setting the colors of cursors for the VGA renderer.Bruce Evans2017-08-252-6/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Advertise this by changing the defaults to mostly red. If you don't like this, change them (almost) back using: vidcontrol -c charcolors,base=7,height=0 vidcontrol -c mousecolors,base=0[,height=15] The (graphics mode only) mouse cursor colors were hard-coded to a black border and lightwhite interior. Black for the border is the worst possible default, since it is the same as the default black background and not good for any dark background. Reversing this gives the better default of X Windows. Coloring everything works better still. Now the coloring defaults to a lightwhite border and red interior. Coloring for the character cursor is more complicated and mode dependent. The new coloring doesn't apply for hardware cursors. For non-block cursors, it only applies in graphics mode. In text mode, the cursor color was usually a hard-coded (dull)white for the background only, unless the foreground was white when it was a hard-coded black for the background only, unless the foreground was white and the background was black it was reverse video. In graphics mode, it was always reverse video for the block cursor. Reverse video is worse, especially over cutmarking regions, since cutmarking still uses simple reverse video (nothing better is possible in text mode) and double reverse video for the cursor gives normal video. Now, graphics mode uses the same algorithm as the best case for text mode in all cases for graphics mode. The hard-coded sequence { white, black, } for the background is now { red, white, blue, } where the first 2 colors can be configured. The blue color at the end is a sentinel which prevents reverse video being used in most cases but breaks the compatibility setting for white on black and black on white characters. This will be fixed later. The compatibility setting is most needed for mono modes. The previous commit to syscons.c changed sc_cnterm() to be more careful. It followed null pointers in some cases. But sc_cnterm() has been unreachable for 15+ years since changes for multiple consoles turned off calls to the the cnterm destructor for all console drivers. Before them, it was only called at boot time. So no driver with an attached console has ever been unloadable and not even the non-console destructors have been tested much. Notes: svn path=/head/; revision=322878
* Reduce complexity and backwards compatibilty a little by removing new aliasesBruce Evans2017-08-192-87/+73
| | | | | | | | | | | | | | | | | | | and repurposing "blink". Improve accuracy of documentation of historical mistakes and other bugs. "blink" now means "set the blink attribute for the target(s)" instead of "set the blink attribute and clear other attributes [and control flags]". It was even more confusing to use "blinking" for the single attribute to keep the old meaning for "blink". "destructive" is not as historically broken or gone as the previous version said. The bugs involving resetting from defaults are now understood and partly documented (the defaults are mis-initialized). Notes: svn path=/head/; revision=322693
* I misplaced a newline in the previous commit. Fix this, and move lineBruce Evans2017-08-171-5/+6
| | | | | | | | | | | | breaks in the vt case to the same places that the man(1) puts then in the SYNOPSIS. This was already done for the syscons case. Man pages can't depend on the driver, and the SYNOPSIS is hard-coded for syscons except for -f where it is hard-coded for vt. The usage message reverses this for sc. The only other differences are whitespace and removing -[dL] and -l for vt. Notes: svn path=/head/; revision=322634
* Update vidcontrol -c to support all cursor appearance settingBruce Evans2017-08-172-25/+189
| | | | | | | | | | | | | | | | | | capabilities. Most of the capabilities (all of the arcane ones) were in FreeBSD-2.0.5, but were harder to use then, and vidcontrol didn't try. FreeBSD-4.1.0 added per-vty support, fixed the destructivness of the "destructive" cursor, and improved APIs. Start using the new APIs, support all of their capabilities, and document all of the capabilities and some of the historical mistakes. vt doesn't support any of this before or after the change. Fix minor unrelated bitrot in the usage message for the syscons case. Notes: svn path=/head/; revision=322626
* Fix setting of the border color. Teken doesn't support syscons' escapeBruce Evans2017-08-161-5/+9
| | | | | | | | | | | | | | | | | | sequence "ESC [ %d A" for this although that was used here. I will fix teken later, but use the more portable ioctl KDSBORDER here. The ioctl is also much easier to use if you check that it works. For -b, check it and complain and exit if it failed, so that it is more obvious that that vt doesn't support border colors. Don't check it when restoring the border color in revert(), since revert() is used on vt for handling other errors. Fix nearby error handling and style. For the error of an invalid color, revert() and print a specific error message using err() instead of not revert()ing and printing spam using usage(). Notes: svn path=/head/; revision=322579
* Fix a missing const in my previous commit which broke the build atBruce Evans2017-04-031-1/+1
| | | | | | | | | normal WARNS. Reported by: lwhsu Notes: svn path=/head/; revision=316462
* Show high (blinking foreground/bright background) background colors. FormatBruce Evans2017-04-031-6/+17
| | | | | | | | output and source better for this. Format output for 40 columns if there are less than 80 columns. Notes: svn path=/head/; revision=316459
* Remove the global variable 'info' and fix associated bugs and style bugs.Bruce Evans2017-04-031-41/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This variable was used 4 times in 1 function and all uses were wrong. The 4 uses were in he test_frame() (show) function, to try to restore 4 colors, 2 unnecessarily and these 2 now broken. This was wrong because it is the previous colors that must be restored, but the global holds the original colors. Excessive setting of colors at the end restored the previous colors correctly in most cases, but I removed this a couple of revisions ago. Originally, this variable had 1 correct use, to test for being on a vty as a side effect of initializing it. This is now down in init(), and init() also leaves a better-named global with the same contents. Fix this by reading the current console info into a local variable in test_frame(), as is done for several other functions. Fix style bugs in this reading for all callers: - extra blank lines - all error messages different. The first one now in init() is not as specific as the old one, but it is after a different specific one for another ioctl and is unlikely to be reached when the first ioctl succeeds. Ones after the first are to repeat the ioctl, so are even more likely to be reached. The correctness of full removal of the old global depends on the error handling for failure to initialize it being unreachable. - err() instead of warn() for failure in load_font(). This is almost unreachable, and it makes no sense to continue after undoing previous changes with revert(). - unreachable return after err() for failure in dump_screen(). Undo large renaming of local variables from the good name 'info' to the bad name _info, which was done to protect the buggy global's bad name from -Wshadow warnings. Notes: svn path=/head/; revision=316453
* Save errno across revert().Bruce Evans2017-04-031-45/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change 25 uses of errc() to err(). 2 of these were correct. 23 used errno for the arg so were just a verbose spelling of err(). 5 of these were just style bugs, and 18 depended on revert() saving errno. 1 warn() also depended on revert() saving errno. Remove 2 warnx()'s that duplicate the message from a later errx(). These used to be before returns, and should have reported errno in some cases. errno is also not reported for for openguess() failures. Only "restore" the video mode in revert() if the mode was just set (necessarily partially). Setting the mode to its current setting doesn't "restore" it, but resets it, with the least harmful change being to clear the screen. revert() is called even for some harmless syntax errors and usually did nothing except reset the mode. Now it usually does nothing. The only things that it tries to restore apart from the mode are the active vty number, the screen map, 2 colors that only need to be restored (only after a mode change) to fix kernel bugs, and 3 colors that can't be restored due to kernel bugs. (This is mostly for sc, since vt doesn't support mode changes.) revert() is not called for syntax and setting errors after [mode], so the mode reset is only done for failures to set raster mode after setting graphics mode. normal colors can only be set after [mode], and that is why reverting them should be unnecessary. Notes: svn path=/head/; revision=316447
* Fix some parsing and error handling bugs.Bruce Evans2017-04-031-54/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r146736 added an undocumented syntax and many bugs handling it. The documented syntax is "... [mode] [fg [bg]] [show]", where it is critical for reducing ambiguity and keeping things simple that the mode is parsed first. r146736 added buggy support for "... [mode] [fg [bg]] [show] [mode] [fg [bg]]". One error was that after for failing to set a partially-supported graphics mode, argv[optind] remains pointing to the mode so doesn't match the first [fg [bg]], so the setting is attempted again, with slightly worse error handling. Fix this by removing it (support for the trailing '[mode] [fg [bg]]') and cleaning up. The cleanups are mostly to remove convolutions and bugs that didn't work to handle the ambiguous syntax '[fg [bg]] [fg [bg]]' when [mode] and [show] are not present. Globals were set to allow repeating the color settings at the end. The functions that set the colors earlier were misnamed from set* to get*. All that they "got" is is settings from argv. They applied the settings to the kernel and the globals. Fix restoration of colors in revert() by restoring 2 after the mode change. Colors should not need to be restored, but a bug in scteken clobbers them on any mode change, including ones for restoration. Don't move the restoration of the other 3. Teken doesn't clobber them on mode changes because it doesn't support them at all (sc still supports the border color, but only using a non-teken ioctl). Add restoration of colors after a successful mode change to work around the scteken bug there too. The bug was previously masked by the general setting of colors at the end. Fix a longstanding parsing/error handling bug by exiting almost immediately after matching the [mode] arg but failing to set the mode. Just revert if necessary. Don't return to continue parsing but do it wrong. This bug caused spamming the output with a usage() message and exiting with status 1 whenever [mode] is not present bug [fg [bg]] or [show]. The exit code 1 was actualy an ambiguous internal code for failure to match [mode] or failure to set [mode]. This 1 was obfuscated by spelling it EXIT_FAILURE, but actual exit codes spell EXIT_FAILURE as 1. Remove another global which could have been used to disambiguate this but was only used to micro-optimize the (unnecessary except for other bugs) setting of colors at the end. Notes: svn path=/head/; revision=316443
* Remove checks that background (bg) colors are not bright and buggyBruce Evans2017-04-021-16/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | attempts to keep them that way. The bg brightness bit is interpreted as blinking in some modes, but it would barely be useful to disallow setting it when it would give blinking in code which knew when that is. The old code mostly knew this wrong, and added handling errors. It is in fact impossible to know, since future mode switches may change the meaning of the bit many times on the screen and in history. Old versions of vidcontrol disallowed bg color numbers >= 8 in all cases. This is very VGA/syscons-centric. Syscons uses the VGA defaults of blinking fg instead of bright bg in text mode and bright bg in graphics mode. On VGA, this is very easy to toggle at any time, and vt blows away the VGA text mode default at boot time. r146736 changed this to try to allow bg color numbers in graphics mode only. This is even more VGA/syscons-centric, and there are many bugs in this, and many nearby bugs in the parser. These are increased or decreased by differences and bugs in vt and teken. Perhaps the most obvious bug was that almost any vidcontrol command which changes any color or the mode causes an error if the initial fg color is bright. E.g., in syscons text mode, after "vidcontrol lightwhite" to make the fg bright, another "vidcontrol lightwhite" is rejected and buggy fixup code changes the fg to white. This is because the bright fg color creates a bright bg color for the phantom reverse video attribute, so was rejected. (The reverse video attribute is phantom because teken ignores the user's setting of it and simply reverses the fg attributes to create the bg attributes. Sometimes some layer masks off the brightness/blinking bit, but not here.) Perhaps the next most obvious one was that "vidcontrol lightgreen lightblue" was misparsed as 2 settings of the fg instead of 1 setting of the fg and 1 invalid setting of the bg. This is because the parser supports an undocumented syntax with many parsing bugs (an ambiguity gives this one). I recently fix bugs in teken that broke setting of bright fg's and bg's in the normal way. This gave more settings of then, so the old bugs showed up more often. Notes: svn path=/head/; revision=316422
* Remove pc98 support completely.Yoshihiro Takahashi2017-01-281-11/+1
| | | | | | | | | I thank all developers and contributors for pc98. Relnotes: yes Notes: svn path=/head/; revision=312910
* vidcontrol: use calloc where appropriateEd Maste2016-11-051-2/+2
| | | | | | | Reported by: kib Notes: svn path=/head/; revision=308338
* vidcontrol: improve error handling in vt(4) font loadingEd Maste2016-11-041-18/+26
| | | | | | | | | | PR: 209078 Reported by: ecturt@gmail.com Reviewed by: Oliver Pinter Differential Revision: https://reviews.freebsd.org/D8176 Notes: svn path=/head/; revision=308312
* Add "vidcontrol -i active", to print out active vty number,Edward Tomasz Napierala2016-01-192-6/+23
| | | | | | | | | | | | to be used with eg "vidcontrol -s". Reviewed by: emaste@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D4968 Notes: svn path=/head/; revision=294321
* Add META_MODE support.Simon J. Gerraty2015-06-131-0/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-081-2/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-271-1/+5
| |\ | |/ |/| | | Notes: svn path=/projects/bmake/; revision=283595
| * Merge from head@274682Simon J. Gerraty2014-11-192-15/+73
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=274683
| * \ Merge head from 7/28Simon J. Gerraty2014-08-193-17/+148
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-161-1/+0
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | Merge from headSimon J. Gerraty2013-09-051-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | Updated dependenciesSimon J. Gerraty2013-02-161-2/+0
| | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868
| * | | | Sync from headSimon J. Gerraty2012-11-041-5/+9
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=242545
| * | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar2012-08-221-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
* | | | | | vidcontrol: skip invalid video modes returned by vt(4)Ed Maste2015-04-201-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | vt(4) has a stub CONS_MODEINFO ioctl that does not provide any data but returns success. This needs to be fixed in the kernel, but address it in vidcontrol(1) as well in case it's run on an older kernel. Reviewed by: bde Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281779
* | | | | | vidcontrol: make size argument optional again for sysconsEd Maste2015-04-161-1/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r273544 changed the -f option allow no arguments in vt mode (used to reset the font back to the default), but broke the optionality of the size argument for syscons. Drop the required argument from syscons' optstring for -f so the optional argument handler works the same way for both syscons and vt. Reported by: bde Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=281581
* | | | | vt(4): Add PIO_VFONT_DEFAULT ioctl to restore the default builtin fontJean-Sébastien Pédron2014-10-232-9/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To restore the default font using vidcontrol(1), use the "-f" flag without an argument: vidcontrol -f < /dev/ttyv0 PR: 193910 Differential Revision: https://reviews.freebsd.org/D971 Submitted by: Marcin Cieslak <saper@saper.info> Reviewed by: ray@, emaste@ Approved by: ray@ MFC after: 1 week Notes: svn path=/head/; revision=273544
* | | | | Add references to vt(4) to further man-pages.Stefan Eßer2014-09-011-6/+31
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=270933
* | | | Fix vt(4) detection in kbdcontrol and vidcontrolEd Maste2014-07-021-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As sc(4) and vt(4) coexist and are both enabled in GENERIC, the existence of a vt(4) sysctl is not sufficient to determine that vt(4) is in use. Reported by: Trond Endrestøl Notes: svn path=/head/; revision=268175