Commit Graph

26 Commits

Author SHA1 Message Date
Kartik K. Agaram 6656abeb4e . 2022-04-16 20:15:56 -07:00
Kartik K. Agaram 394c9f894c fix a few sample apps
Broken since Mar 18, when I started running tests in src/file.lua.

It's more than a little ugly that .lua files in src/ require helpers
inside .tlv apps.
2022-04-11 22:43:26 -07:00
Kartik K. Agaram 68d956e31a distinguish between window global and arg 2022-03-02 22:15:01 -08:00
Kartik K. Agaram ae51b06dab starting to make Teliva apps more testable
Tasteful apps should only perform side-effects through 'window'
arguments rather than the 'curses' module directly. It's ok however to
read constants like curses.A_NORMAL or curses.stdscr().

There are some limitations, unfortunately. Ncurses wasn't designed with
testability in mind. For example, there's no way to curs_set or
assume_default_colors without the 'curses' module. Oh well.
2022-02-27 08:41:30 -08:00
Kartik K. Agaram 9421ea7151 'doc:blurb': a place to briefly describe an app
This is for what the app does, as opposed to 'doc:main', which is also
intended to include commentary about the internal organization of the
app.
2022-02-17 20:16:36 -08:00
Kartik K. Agaram 27a99111ee fix chesstv.tlv after we introduced sandboxing 2022-02-12 18:58:24 -08:00
Kartik K. Agaram 41bf615f43 nail down trusted Teliva channels a little more
In each session, Teliva has to bootstrap a trusted channel with the
computer owner while running arbitrarily untrusted code. So let's get
really, really precise about what the trusted channel consists of:
  - the bottom-most row of screen containing the menu
  - the keystrokes the owner types in
  - ncurses COLOR_PAIR slots 254 (menu) and 255 (error)

One reason the menu colors are important: we don't want people to get
used to apps that hide the menu colors by setting default
foreground/background to invisible and then drawing their own menu one
row up.

The error COLOR_PAIR I don't see any reason to carve out right now, but
it seems like a good idea for Teliva the framework to not get into the
habit of apps doing some things for it.

I'm not sure how realistic all this is (I feel quite ill-equipped to
think about security), but it seems worthwhile to err on the side of
paranoia. Teliva will be paranoid so people don't have to be.
2021-12-21 15:47:55 -08:00
Kartik K. Agaram c0c9d31688 snapshot: migrate all sample apps to new format 2021-12-11 10:22:53 -08:00
Kartik K. Agaram d9cf3433d9 start showing call stack on errors
It turns out Lua has been providing us this information all along! I'd
just not created the space on screen to show it. Make it persist better.

Kilo now no longer tracks its own status messages, which is a regression
in a rare condition.
2021-12-04 14:12:36 -08:00
Kartik K. Agaram 31816db0cc . 2021-11-26 21:56:22 -08:00
Kartik K. Agaram 07bf55b460 save timestamp on change; show in recent changes 2021-11-26 18:47:50 -08:00
Kartik K. Agaram 5a63a5ca40 monotonically accumulate versions of definitions
One old drawback now has a new look. Before, we loaded definitions in
order, so global definitions had to exist before other global
definitions that used them. See window and grid in life.tlv. Now we load
definitions in reverse order, so initialization needs to change. Worse,
if we update window, we need to edit grid just to fix the order.

This implies that we can't yet optimize away bindings where there are no
new changes.
2021-11-24 10:10:38 -08:00
Kartik K. Agaram acb5e88b3c indent 2021-11-23 22:03:14 -08:00
Kartik K. Agaram c28174bdf5 chess: tweak colors a bit 2021-11-23 15:00:19 -08:00
Kartik K. Agaram ae3ef2ac66 chess: extract color parameters 2021-11-23 14:56:51 -08:00
Kartik K. Agaram 76fe92c6e3 chess: extract a new function 2021-11-23 14:54:56 -08:00
Kartik K. Agaram 694e4e5f96 chess: fix inconsistency in light piece color 2021-11-23 14:53:19 -08:00
Kartik K. Agaram 3e04ab5597 chess: make white pieces red for legibility 2021-11-22 17:45:55 -08:00
Kartik K. Agaram 22da460930 chesstv: light colored square on bottom right
1-based indexing is a hassle.
2021-11-22 00:32:48 -08:00
Kartik K. Agaram 86dfa10e05 chesstv.tlv: render clocks 2021-11-21 23:50:10 -08:00
Kartik K. Agaram f9cd9f75c5 chesstv.tlv: looking much better
- square colors are slightly different
- moves are now highlighted

In the process I found lots of bugs in the rendering, and gave up on
supporting adjustable orientation. Just always keep White's side at the
bottom.
2021-11-21 23:38:28 -08:00
Kartik K. Agaram 47524cb007 chess: better colors 2021-11-21 22:48:32 -08:00
Kartik K. Agaram 49cf88e189 almost done with chess app
It's still not very legible.
2021-11-21 22:23:32 -08:00
Kartik K. Agaram f564a5afc5 figured out streaming http!
http://lua-users.org/wiki/FiltersSourcesAndSinks
2021-11-21 20:47:14 -08:00
Kartik K. Agaram 3b44b9827d basic http requests starting to work
In the process we're starting to load almost all of luasocket by
default. And everything is working as expected, no unpleasant surprises.
2021-11-21 15:07:42 -08:00
Kartik K. Agaram f7ab5dd291 start on HTTP client 2021-11-21 14:33:57 -08:00