<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/stand/lua/screen.lua, branch release/13.1.0</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>lualoader: don't botch disabling of color</title>
<updated>2019-10-21T20:09:43+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2019-10-21T20:09:43+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a6cf4be0421c1df870218105ce590203c285b5a2'/>
<id>a6cf4be0421c1df870218105ce590203c285b5a2</id>
<content type='text'>
When colors are disabled, color.escape{fg,bg} would return the passed in
color rather than the proper ANSI sequence for the color.
color.escape{fg,bg} would be wrong.

Instead return '', as the associated reset* functions will also return ''.
This should get rid of the funky '2' and '4' in the kernel selector if
you're booting serial.

Reported by:	npn
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When colors are disabled, color.escape{fg,bg} would return the passed in
color rather than the proper ANSI sequence for the color.
color.escape{fg,bg} would be wrong.

Instead return '', as the associated reset* functions will also return ''.
This should get rid of the funky '2' and '4' in the kernel selector if
you're booting serial.

Reported by:	npn
</pre>
</div>
</content>
</entry>
<entry>
<title>Serial console menus for lua.</title>
<updated>2018-08-20T16:44:09+00:00</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2018-08-20T16:44:09+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=116c5314595e87faf4da9601bace8b9d0663f15b'/>
<id>116c5314595e87faf4da9601bace8b9d0663f15b</id>
<content type='text'>
Remove a bunch of special cases for UEFI and serial consoles.  We do
want to do curses and menu things here. This makes us match what we do
in FORTH, with the possible exception of boxes around menus.

Differential Revision:  https://reviews.freebsd.org/D16816
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove a bunch of special cases for UEFI and serial consoles.  We do
want to do curses and menu things here. This makes us match what we do
in FORTH, with the possible exception of boxes around menus.

Differential Revision:  https://reviews.freebsd.org/D16816
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: Clear up some possible naming confusion</title>
<updated>2018-03-21T15:09:47+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-03-21T15:09:47+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8ce1744f827719361008973cb4387ab8cb005d32'/>
<id>8ce1744f827719361008973cb4387ab8cb005d32</id>
<content type='text'>
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
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: Use global printc instead of loader.printc</title>
<updated>2018-03-02T16:06:20+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-03-02T16:06:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=223e9874b6cb7c1bd3a2a71a4317d36cfd2fe393'/>
<id>223e9874b6cb7c1bd3a2a71a4317d36cfd2fe393</id>
<content type='text'>
r330282 registered loader.printc as printc, so use it instead. This makes
sense for a couple reasons, the major point being that it reads a little bit
easier and pairs nicely with the global 'print'.

Similar cases can not really be made for other loader.* functions as most of
them are either highly specific to our use-case or usually available in
other modules, such as `os`. printc does not have a standard implementation
in the Lua world(*), so we have a little more leeway with it, and it's kind
of a special case of the globally available 'print'.

(*) I've been in the Lua world for all of two weeks, so this could be wrong.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
r330282 registered loader.printc as printc, so use it instead. This makes
sense for a couple reasons, the major point being that it reads a little bit
easier and pairs nicely with the global 'print'.

Similar cases can not really be made for other loader.* functions as most of
them are either highly specific to our use-case or usually available in
other modules, such as `os`. printc does not have a standard implementation
in the Lua world(*), so we have a little more leeway with it, and it's kind
of a special case of the globally available 'print'.

(*) I've been in the Lua world for all of two weeks, so this could be wrong.
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: Further screen cleanup</title>
<updated>2018-02-28T04:31:19+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-02-28T04:31:19+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=ed1d0954ca4abf42d76a9da282650fe5bc6956bb'/>
<id>ed1d0954ca4abf42d76a9da282650fe5bc6956bb</id>
<content type='text'>
- Add screen.default_x and screen.default_y to determine where
  screen.defcursor resets the cursor to.
- Use screen.setcursor in screen.defcursor instead of rewriting the escape
  sequence.
- Use screen.default_y when resetting the cursor after writing the new
  twiddle character, add a comment verbally describing the position just in
  case.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Add screen.default_x and screen.default_y to determine where
  screen.defcursor resets the cursor to.
- Use screen.setcursor in screen.defcursor instead of rewriting the escape
  sequence.
- Use screen.default_y when resetting the cursor after writing the new
  twiddle character, add a comment verbally describing the position just in
  case.
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: Re-do twiddle</title>
<updated>2018-02-28T04:23:28+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-02-28T04:23:28+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=0901ba3aa149d7453e65d98ee8083237dd5db9f0'/>
<id>0901ba3aa149d7453e65d98ee8083237dd5db9f0</id>
<content type='text'>
It worked on my test setup, but is clearly non-functional on others.

Further examination of check-password.4th showed that it actually reset the
cursor to 0,25 every time and overwrote the previous password prompt. Do
that, and also clear the "Incorrect Password" text if the correct password
gets entered.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It worked on my test setup, but is clearly non-functional on others.

Further examination of check-password.4th showed that it actually reset the
cursor to 0,25 every time and overwrote the previous password prompt. Do
that, and also clear the "Incorrect Password" text if the correct password
gets entered.
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: Convert instances of KEYSTR_ESCAPE .. "[" -&gt; KEYSTR_CSI</title>
<updated>2018-02-27T22:02:39+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-02-27T22:02:39+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2bb86aefecd5d75e7c4f3197e7c9d4357e57511a'/>
<id>2bb86aefecd5d75e7c4f3197e7c9d4357e57511a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: Replace instances of \027 with KEYSTR_ESCAPE</title>
<updated>2018-02-27T21:52:22+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-02-27T21:52:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d5b2439e5dfd2d4264b1f7ac05650186268caf45'/>
<id>d5b2439e5dfd2d4264b1f7ac05650186268caf45</id>
<content type='text'>
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)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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)
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: Add a twiddle at password prompt</title>
<updated>2018-02-27T21:22:57+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-02-27T21:22:57+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a6f1506f1a4f9dd9bfa65f01e535afcf60ada183'/>
<id>a6f1506f1a4f9dd9bfa65f01e535afcf60ada183</id>
<content type='text'>
This gives some form of feedback while typing, and matches-(ish*) Forth
behavior. The cursor generally rests two column after the password prompt,
then the twiddle is drawn three columns later and the cursor reset to
resting position after being drawn.

I've removed the note about re-evaluating it for security considerations and
instead set it up as a module-local variable that we can set later depending
on environment or something. It's set to false with no chance of changing at
the moment.

*As close as I can tell from reading check-password.4th, because I don't
have an easy test (or deployed) setup for forth loader to check how close
it is. Please do mention if it's not close enough.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This gives some form of feedback while typing, and matches-(ish*) Forth
behavior. The cursor generally rests two column after the password prompt,
then the twiddle is drawn three columns later and the cursor reset to
resting position after being drawn.

I've removed the note about re-evaluating it for security considerations and
instead set it up as a module-local variable that we can set later depending
on environment or something. It's set to false with no chance of changing at
the moment.

*As close as I can tell from reading check-password.4th, because I don't
have an easy test (or deployed) setup for forth loader to check how close
it is. Please do mention if it's not close enough.
</pre>
</div>
</content>
</entry>
<entry>
<title>lualoader: screen argument fixes</title>
<updated>2018-02-26T04:12:54+00:00</updated>
<author>
<name>Kyle Evans</name>
<email>kevans@FreeBSD.org</email>
</author>
<published>2018-02-26T04:12:54+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5495d73c35a88f8e2549d641f39d89625e054e11'/>
<id>5495d73c35a88f8e2549d641f39d89625e054e11</id>
<content type='text'>
screen was also guilty of not-so-great argument names, but it was also
guilty of handling color sequences on its own. Change those bits to using
the color module instead.

As a side note, between color and screen, I'm not 100% sure that returning
the color_value is the right thing to do if we won't generate the escape
sequences. This should be re-evaluated at a later time, and they should
likely return nil instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
screen was also guilty of not-so-great argument names, but it was also
guilty of handling color sequences on its own. Change those bits to using
the color module instead.

As a side note, between color and screen, I'm not 100% sure that returning
the color_value is the right thing to do if we won't generate the escape
sequences. This should be re-evaluated at a later time, and they should
likely return nil instead.
</pre>
</div>
</content>
</entry>
</feed>
