aboutsummaryrefslogtreecommitdiff
path: root/stand/lua/color.lua
Commit message (Collapse)AuthorAgeFilesLines
* lualoader: Clear up some possible naming confusionKyle Evans2018-03-211-4/+4
| | | | | | | | | | | | | | | In the original lualoader project, 'escapef' and 'escapeb' were chosen for 'escape fg' and 'escape bg'. We've carried on this naming convention, and as our use of attributes grow the likeliness of 'escapeb'/'resetb' being confused upon glance for 'escape bold'/'reset bold' increases. Fix this by renaming these four functions to {escape,reset}{fg,bg} rather than {escape,reset}{f,b} for clarity. Reported by: dteske Notes: svn path=/head/; revision=331304
* lualoader: Use less atomic options for resetting colors/attributesKyle Evans2018-03-201-1/+15
| | | | | | | | | | | | | | | | | | | | | | | Noted by dteske: CSI 1m ... CSI 22m CSI 2m ... CSI 22m CSI 4m ... CSI 24m CSI 5m ... CSI 25m CSI 7m ... CSI 27m CSI 8m ... CSI 28m CSI (30-37)m ... CSI 39m CSI (40-47)m ... CSI 49m - Provide resetf/resetb to match escapef/escapeb - Use CSI 22m to undo a bold This is a more reasonable approach than what was previously taken. Reported by: dteske Notes: svn path=/head/; revision=331259
* lualoader: Reset attributes and color scheme with color.highlight()Kyle Evans2018-03-201-1/+3
| | | | | | | | | | | Previously, we sent a CSI 0m sequence to reset attributes, which also reset the color scheme if the terminal defaults didn't match what we're expecting. Go all-in and reset the color scheme, too, just in case. Reported by: emaste Notes: svn path=/head/; revision=331257
* lualoader: Setup default color scheme if we're using colorsKyle Evans2018-03-191-1/+1
| | | | | | | | | | | | | | | The console may have been set for different colors before lualoader kicks in; notably, a black-on-white color scheme is not necessarily what we're expecting. While here, make color.default() a composition of color.escape() instead of rewriting the escape sequence to make it more obvious what it's achieving: a white-on-black color scheme with no attributes set. Reported by: emaste, whose eyes may rest easily Notes: svn path=/head/; revision=331211
* lualoader: Convert instances of KEYSTR_ESCAPE .. "[" -> KEYSTR_CSIKyle Evans2018-02-271-5/+5
| | | | Notes: svn path=/head/; revision=330087
* lualoader: Replace instances of \027 with KEYSTR_ESCAPEKyle Evans2018-02-271-5/+5
| | | | | | | | | | With exception to drawing bits, which should probably be kept as-is to not make a mess out of things. Reported by: rpokala (a while ago) Notes: svn path=/head/; revision=330084
* lualoader: More argument name expansion, part 2Kyle Evans2018-02-261-11/+12
| | | | | | | | screen also has some instances, but it also has other cleanup to go with it. Because of this, I will be committing the screen changes separately. Notes: svn path=/head/; revision=330009
* Add SPDX tags to lua filesKyle Evans2018-02-231-0/+2
| | | | Notes: svn path=/head/; revision=329851
* lualoader: Drop excessive parenthesizingKyle Evans2018-02-211-10/+10
| | | | | | | | | | | This was also a convenience convention (for me) that is not very lua-tic. Drop it. I've maintained some parentheses where I'd prefer them, for example, 'if x or y or (z and w) then', but these situations are far and few between. Notes: svn path=/head/; revision=329685
* lualoader: Drop terminating semicolonsKyle Evans2018-02-211-29/+29
| | | | | | | | | | | This was previously chosen out of convenience, as we had a mixed style and needed to be consistent. I started learning Lua on Friday, so I switched everything over. It is not a very lua-nic convention, though, so drop it. Excessive parenthesizing around conditionals is next on the chopping block. Notes: svn path=/head/; revision=329684
* stand/lua: Consistently organize modulesKyle Evans2018-02-201-0/+1
| | | | | | | | | | | | | | | | | We follow pretty closely the following structure of a module: 1. Copyright notice 2. Module requires 3. Module local declarations 4. Module local definitions 5. Module exports 6. return Re-organize the one-offs (config/drawer) and denote the start of module exports with a comment. Notes: svn path=/head/; revision=329641
* stand/lua: Round up some more style.lua(9) concernsKyle Evans2018-02-191-7/+7
| | | | Notes: svn path=/head/; revision=329594
* stand/lua: Rename bootserial for clarityKyle Evans2018-02-191-1/+1
| | | | Notes: svn path=/head/; revision=329577
* stand/lua: Style passKyle Evans2018-02-171-12/+11
| | | | | | | | | | | | | These are the style points that I'd like to try and maintain in our lua scripts: - Parentheses around conditionals - Trailing semicolons, except on block terminators - s:method(...) instead of string.method(s, ...) where applicable There's likely more, but that'll get hammered out as we continue. Notes: svn path=/head/; revision=329435
* Add the lua scripts from the lua-bootloader SoCWarner Losh2018-02-121-0/+99
These are the .lua files from from Pedro Souza's 2014 Summer of Code project. Rui Paulo, Pedro Arthur and Wojciech A. Koszek also contributed. Obtained from: https://wiki.freebsd.org/SummerOfCode2014/LuaLoader Sponsored by: Google Summer of Code Improve the SoC lua menu code to bring it in line with forth menu functionality Submitted by: Zakary Nafziger Sponsored by: FreeBSD Foundation Use loader.setenv and loader.unsetenv instead of loader.perform Convert from include("/boot/foo.lua") to foo = require("foo"); to bring in line with latest lua module conventions. Enforce a uniform style for the new .lua files: o hard tab indenation for 8 spaces o don't have if foo then bar; else bas; end on one line MFC After: 1 month Relnotes: yes Differential Review: https://reviews.freebsd.org/D14295 Notes: svn path=/head/; revision=329167