Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

add termwiz backend and termwiz_demo #300

Closed
wants to merge 3 commits into from

Conversation

prabirshrestha
Copy link

Added termwiz backend which currently is tested in archlinux and works. It is using BufferedTerminal internally which should be doing diffs before applying the changes when calling flush.

As for windows it does compile but for some reason I don't see right chars being rendered.

//cc @wez

Copy link

@wez wez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a couple of quick comments on the termwiz color usage!

src/backend/termwiz.rs Outdated Show resolved Hide resolved
src/backend/termwiz.rs Outdated Show resolved Hide resolved
@prabirshrestha
Copy link
Author

@wez any idea why it doesn't render correctly in Windows? Once I quit alt screen also doesn't seem to go back clean. On linux it works as expected.

image

@fdehau
Copy link
Owner

fdehau commented May 27, 2020

Thanks for the contribution. From a first read the code looks good. However, I'm a bit skeptical on the need for a new backend. Are there capabilities that are only provided by termwiz ? I was not aware that this crate existed until now, but my first impression is that it is a bit higher level than other backends and thus be seen as an other great take on a "framework" to build terminal applications. @wez what is your opinion on this ? I would be more than happy to list it as an alternative to tui as I've done for cursive.

@wez
Copy link

wez commented Jun 14, 2020

@fdehau: My vision for termwiz is to enable cross platform (including first-class Windows support) text applications to detect and use a wide range of modern features in terminals, not only true color output (with a means to specify fallback on terminals that don't support it), but also including things like hyperlinks (OSC 8) and image protocols (currently iterm2 is supported, but I plan on adding sixel output soon).

termwiz has good low level foundations and optional nascent higher level support; it has an optional widget layer that is currently a bit lacking. termwiz shares the same core terminal model as wezterm, and my intent is that both will support a wide range of terminal attributes and display options.

I haven't looked at the internals in tui so I can't say whether you'd benefit from targeting the lower level API in termwiz or not, but I would suggest that it is worth evaluating that. The higher level stuff sounds like it may be a "competitor" to tui, but termwiz's widgets are pretty far behind in that "race" today :-)

@prabirshrestha
Copy link
Author

Currently wezterm widgets are very primitive so would like to use tui-rs instead. Given that I use wezterm as my terminal emulator I find it great that the same library can also be used for tui-rs which means any bug fixes or perf improvements that goes to wezterm comes for free by termwiz. termwiz does support different sent of features as mentioned earlier.

On windows there is currently only one backend so having a second backend would give more options to users.

Given that tui-rs doesn't have its own input handling apis I would like reuse the apis I'm already familiar with termwiz to build apps.

@fdehau
Copy link
Owner

fdehau commented Jun 28, 2020

Thanks @wez for the nice overview. This is a very impressive and ambitious project so if adding support in tui can give it a bit more spotlight I would be more than happy to do so. Thanks also @prabirshrestha for detailing how you plan to use this new backend. Both of you made a good case :). As I said before, the code looks good so I'm wondering if @prabirshrestha want to investigate the Windows issues first or merge as is and iterate on the Windows support later ?

@mindoodoo
Copy link

@wez We're looking at this PR over at ratatui, specifically here.

We'd love to hear from you over there 🙂. If you have any specific inputs, especially since this PR was opened close to three years ago.

@wez
Copy link

wez commented May 3, 2023

I've subscribed to that PR. I don't have any specific input right now, but if you have questions please ask them over there!

@fdehau fdehau closed this Aug 6, 2023
@prabirshrestha prabirshrestha deleted the termwiz branch August 6, 2023 09:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants