Comments (9)
Just a note that this is now in master
(via #249) and will be available in the next release.
from bubbletea.
This is a good one definitely a feature we’d like to support, however to do so we’ll need to add some additional functionality to both to the renderer as well as probably a special Cmd
for unmanaged output.
Anyway, this should be a fun one. We’ll keep this issue updated with progress.
from bubbletea.
Thanks for your input @meowgorithm ! If there's anything I can help with, please do not hesitate to ask. I will try to help as much as I can
from bubbletea.
I have a working approach to this. Right now I have it set up as a separate renderer for the sake of simplicity, and because the "AltScreen" mode is incompatible with the "log mode" @rfc2119 proposed, so putting them on the same object would require handling incompatible setup options.
Changes to expose the renderer: #246
The renderer: https://github.com/Adjective-Object/tea_log_renderer/blob/main/tea_log_renderer.go
Happy to PR this in @meowgorithm. If you're ok with this approach, let me know if you'd prefer the to keep the Renderer internal and I can make this a feature flag on the standard renderer.
from bubbletea.
Thanks for the info (and the PR!), @Adjective-Object. I'm inclined to keep the rendering interface internal for now as it (somewhat intentionally) hasn't been given the attention necessary for a public API. However, at a glance, your implementation seems to make sense.
Would you be interested in submitting a PR against the standard renderer instead? I've been imagining the public interface as a Cmd
or two, perhaps something like:
// A command for printing above the output, with a final newline
func Println(...string) Msg
// A command for printing above the output, probably also with a newline (somewhat like log.Print)
func Printf(string, vars ...string) Msg
I'd also probably leave word-wrapping as an exercise for the user, but open to your opinions here.
Let me know what you think!
from bubbletea.
from bubbletea.
Is there a convenient place for consumers to get access to the widthe of the terminal for word wrapping themselves? Otherwise it might actually make sense as an option when calling Println / Printf, for ergonomics
from bubbletea.
Is there a convenient place for consumers to get access to the widthe of the terminal for word wrapping themselves? Otherwise it might actually make sense as an option when calling Println / Printf, for ergonomics
Yep, via a WindowSizeMsg
, which is sent to update once on initialization and for window resizes.
from bubbletea.
What do you think the behaviour of the Println() Cmd should be when in AltScreen mode?
I’d simply not print anything and note in the doc comment that Printf
/Println
won’t work when the altscreen is active..
from bubbletea.
Related Issues (20)
- First line not rendering until event happens HOT 3
- Part of the screen is not rendering when the view is exactly the size of the screen HOT 3
- Proposal: Model v2, program context HOT 1
- Exiting fullscreen glitch when also removing a line in output HOT 2
- Proposal: use x/input to handle input events HOT 1
- `tea.unknownCSISequenceMsg: unknown message type` panics HOT 3
- The visible area in viewport may seem incorrect when content exceed the viewport.Width HOT 10
- Flickering on Windows when using bubbletea >=0.26.0 HOT 2
- SetWindowTitle panic after upgrade from v0.26.2 -> v0.26.3 HOT 1
- When a large update is performed, it will cause a flash. HOT 1
- PR #1033 broke the tabs example HOT 2
- View() gets stuck rendering a lipgloss.AdaptiveColor style (in an oddly specific situation) HOT 4
- Pager example with high performance rendering loses first line on resize HOT 3
- Bubbletea table and Lip Gloss color do not work with ssh.Channel. HOT 1
- Overriding the default help view
- textarea broken(ish) between 0.26.2 and 0.26.3
- Automatic command chaining: Cmd -> Cmd -> Msg HOT 1
- Allow WindowSizeMsg to be sent on sub-model Init HOT 5
- Progress bar behaving strangely
- Any support for charts?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bubbletea.