| eb4fa1ad | 17-Aug-2017 |
Bruce Evans <[email protected]> |
I misplaced a newline in the previous commit. Fix this, and move line 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.
I misplaced a newline in the previous commit. Fix this, and move line 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.
show more ...
|
| 92dedf1b | 17-Aug-2017 |
Bruce Evans <[email protected]> |
Update vidcontrol -c to support all cursor appearance setting 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'
Update vidcontrol -c to support all cursor appearance setting 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.
show more ...
|
| 8f92a81b | 03-Apr-2017 |
Bruce Evans <[email protected]> |
Remove the global variable 'info' and fix associated bugs and style bugs.
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
Remove the global variable 'info' and fix associated bugs and style bugs.
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.
show more ...
|
| 2b881cf4 | 03-Apr-2017 |
Bruce Evans <[email protected]> |
Save errno across revert().
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
Save errno across revert().
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.
show more ...
|
| 1b8c842e | 03-Apr-2017 |
Bruce Evans <[email protected]> |
Fix some parsing and error handling bugs.
r146736 added an undocumented syntax and many bugs handling it. The documented syntax is "... [mode] [fg [bg]] [show]", where it is critical for reducing a
Fix some parsing and error handling bugs.
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.
show more ...
|