Commit Graph

94 Commits

Author SHA1 Message Date
Christian Muehlhaeuser d2c1d9bfb0 Omit unhandled error 2021-03-12 01:25:54 +01:00
Kiyon ac36017f86 WithOutput option should take io.Writer as argument. 2021-03-09 03:51:34 +01:00
kiyon 86b93a31c0
Add commands for toggling the altscreen (#62)
* Add commands EnterAltScreen and ExitAltScreen for toggling the altscreen
* Add altscreen toggling example
* ignore .idea

Co-authored-by: Christian Rocha <christian@rocha.is>
2021-03-08 12:48:34 -05:00
Christian Rocha b3f62af8b5 Add nil renderer and combination TUI-daemon program example
The Nil Renderer essentially disables the Bubble Tea renderer sending
loggings and print statements to stdout. It can be enabled via the
ProgramOption WithoutRenderer.
2021-03-07 13:01:54 -05:00
Christian Rocha 0780601791 Open a TTY if input is not a TTY, unless the user has spec'd otherwise 2021-02-27 16:03:34 -05:00
Christian Rocha 4e2643f318 Make sure we pass our mutex by reference 2021-02-27 16:03:34 -05:00
Carlos Alexandro Becker b2d948b53c Fixed a couple of typos
Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com>
2021-01-17 15:58:50 +01:00
Christian Rocha 9f04c936da Always listen for SIGINT 2021-01-11 18:11:28 -05:00
Christian Rocha c4aeadd762 Generalize output from an *os.File to an io.Writer 2020-12-30 17:59:00 -05:00
Christoph Hartmann e84314c622 allow custom input and handle eof for os.input properly
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2020-12-30 17:59:00 -05:00
Christian Rocha 8e01f5f58a Add command for hiding the cursor 2020-12-03 13:56:37 -05:00
Christian Rocha 6d70abd7d5 When showing/hiding the cursor operate on the program's io.Writer
Previously we were operating on io.Stdout.
2020-12-03 13:56:37 -05:00
Christian Rocha 480bdd41fc
Fix typo in doc comment + improve that comment 2020-10-18 12:43:41 -04:00
Christian Rocha 26899c73b3
Init, Update and View are now methods on interface Model 2020-10-15 16:08:19 -04:00
Kilian Drechsler 26477f70c0 print recovered panic message to terminal 2020-10-08 19:45:16 +00:00
Christian Rocha 3b9d076c80
Fix typo in comment 2020-10-05 14:42:09 -04:00
Christian Rocha fb48e03639
Gracefully recover from panics (but still print stack traces) by default 2020-09-21 13:14:24 -04:00
Christian Muehlhaeuser e634ad5341
Fix typo 2020-08-19 23:54:42 +02:00
Christian Rocha 6fcdf9908f
Improve examples in docs 2020-07-30 11:30:33 -04:00
Christian Rocha 17035473db
More documentation edits 2020-07-29 20:54:15 -04:00
Christian Rocha a5e38222c5
Don't expose ReadInput 2020-07-29 20:51:55 -04:00
Christian Rocha c0f67a2927
Improve GoDocs 2020-07-29 20:50:00 -04:00
Christian Rocha 2f53eeb54b
Fix a bug in macOS terminal where stuff could get sucked into the scroll area 2020-07-13 11:39:04 -04:00
Christian Rocha 8d26b4ebd7
Use mouse consts in termenv 2020-06-25 12:42:31 -04:00
Christian Rocha f3fd9decc9
Improve some comments 2020-06-24 12:14:35 -04:00
Toby Padilla e90039d16e Fix captured variable 2020-06-23 17:26:00 -04:00
Christian Rocha de147c5061
Add mouse wheel support to pager example 2020-06-23 12:01:23 -04:00
Christian Rocha 5ec2c0712a
Move cursor to (0,0) when entering the altscreen
This should fix cases in some terminals where the following paint is
vertically offset.
2020-06-22 20:47:35 -04:00
Christian Rocha d86cb562f0
Add basic mouse support 2020-06-22 20:41:26 -04:00
Christian Rocha 3a70ecdde1
Use same output for altscreen stuff as everything else 2020-06-22 15:55:52 -04:00
Christian Rocha 673752658f
Comments and cleanup 2020-06-22 13:40:32 -04:00
Christian Rocha 6bd34bdd14
Remove commands for manually getting terminal size; no longer needed
Tea core now sends the terminal dimensions on start and when the window
is resized (except on Windows where SIGWINCH, the resize signal, is not
supported).
2020-06-18 22:47:17 -04:00
Christian Rocha a6deb077c5
Adjust comments 2020-06-17 19:43:19 -04:00
Christian Rocha 4dc6992767
Cmds for scrolling + handle renderer msgs in a renderer method 2020-06-17 18:46:04 -04:00
Christian Rocha a492302609
Adjust exports of new msgs + add msg to replace ignored lines 2020-06-17 18:19:27 -04:00
Christian Rocha 8539cfcf8c
Fix a bug where left area on the first line was not always cleared 2020-06-17 14:50:39 -04:00
Christian Rocha debaf312f7
Disable resize listening on windows since it's not supported 2020-06-17 12:27:16 -04:00
Christian Rocha a152cce4b6
Adjust comments + move some code around 2020-06-17 12:12:45 -04:00
Christian Rocha 683473c26d
Blind pass at adding high performance scrolling into the renderer 2020-06-16 22:06:46 -04:00
Christian Rocha 2896e0e8e6
Remove now unused vars from old renderer 2020-06-08 12:48:57 -04:00
Christian Rocha fcbc427098
Properly shut down renderer when quitting program 2020-06-08 12:48:57 -04:00
Christian Rocha 87434a2569
Buffer/ticker-based renderer 2020-06-08 12:48:57 -04:00
Christian Rocha b10f6d6791
How about if we count the lines rendered correctly 2020-05-28 10:47:15 -04:00
Christian Rocha e7130c9633
Remove an extraneous var and rename another var for clarity 2020-05-28 10:26:03 -04:00
Christian Rocha 99df3d4226
Only render if view has actually changed 2020-05-28 10:20:59 -04:00
Christian Rocha 3b8b011b5a
Rename to Bubble Tea (with the import name tea) 2020-05-25 19:48:36 -04:00
Christian Rocha 4bf40fbe62
Rename project to Boba 2020-05-12 16:39:08 -04:00
Christian Rocha 9dd9461dde
It's a safer bet not to render any extra newlines whatsoever 2020-05-11 23:07:48 -04:00
Christian Rocha 5ae602953c
Fix bug where extra blank line was being adding to output 2020-05-11 23:07:00 -04:00
Christian Rocha b50ee76165
Subs shouldn't take a model as an argument
This also nullifies the need for SubMap
2020-05-04 18:52:44 -04:00