3 ms·
What more is there? It seems like a feature-complete set once there's mouse support. I suppose adding graphics for iTerm and such could be extras.
by karmakaze 3y ago
What more is there? It seems like a feature-complete set once there's mouse support. I suppose adding graphics for iTerm and such could be extras.
- deadbabe 3y agoI think mouse support would defeat the purpose of a terminal UI.
- joshka 3y agoCore Ratatui dev here. Mouse events are supported by the underlying backend libraries (e.g. crossterm). There's an example custom widget that shows how to handle these in Ratatui at https://github.com/ratatui-org/ratatui/blob/f767ea7d3766887cb79145103b5aa92e0eabf8f6/examples/custom_widget.rs#L241 https://github.com/ratatui-org/ratatui/blob/f767ea7d3766887c... Note the code is fairly manual as Ratatui doesn't provide any abstractions over the input side of UIs - just the output. (yet?)
- joshka 3y agoThere are apps that are built on ratatui that support mouse already including an example in the repo[1], and crates (and some internal changes to the buffer) to support iterm/kitty/sixel based images.[2] [1]: https://github.com/ratatui-org/ratatui/tree/main/examples#custom-widget https://github.com/ratatui-org/ratatui/tree/main/examples#cu... [2]: https://crates.io/crates/ratatui-image https://crates.io/crates/ratatui-image Compared to TurboVision, Ratatui has a lot of missing things: - Containers - Dialog types (I'm working on this in https://github.com/joshka/tui-prompts https://github.com/joshka/tui-prompts) - Higher order combinations of widgets (e.g. combine the scrollbar and paragraph) - Menus - Any event system (apps bring their own - we just handle display) - etc. - There's lots of things in TV that are provided as external crates (like editors, treeview, etc.) The main thing is that Ratatui is at least right now, just the display side of things. Things to do with events or application shell aren't built-in. This somewhat stems from the immediate vs retained mode approach to the library, but this may change in the future.