叼爆了的TUI库Cursive

https://github.com/gyscos/Cursive

0?wx_fmt=png

0?wx_fmt=png

0?wx_fmt=png

0?wx_fmt=png

0?wx_fmt=png

0?wx_fmt=png

0?wx_fmt=png

Check out the other examples to get these results, and more:

(Colors may depend on your terminal configuration.)

Goals

  • Ease of use. Simple apps should be simple. Complex apps should be manageable.

  • Linux TTY Compatibility. Colors may suffer, and UTF-8 may be too much, but most features must work properly on a Linux TTY.

  • Flexibility. This library should be able to handle simple UI scripts, complex real-time applications, or even games.

    • menuconfig

    • nmtui

    • In particular, it tries to have enough features to recreate these kind of tools:

Non-goals

  • Extreme performance. This is a simple layout library, guys, not compiz piped into libcaca. Unless you are running it on your microwave's microcontroller, it's not going to be slow.

  • Multi-threaded UI. Callback methods are blocking - careful what you're doing in there! Feel free to use threads on your side, though.

  • Complete ncurses equivalent. You can access the underlying ncurses window when creating your own custom views, so you can do what you want with that, but the main library will probably only use a subset of the ncurses features.

Compatibility

First off, terminals are messy. A small set of features is standard, but beyond that, almost every terminal has its own implementation.

Output

  • Colors: the basic 8-colors palette should be broadly supported. User-defined colors is not supported in the raw linux TTY, but should work in most terminals, although it's still kinda experimental.

  • UTF-8: Currently Cursive really expects a UTF-8 locale. It may eventually get patched to support window borders on other locales, but it's not a priority. Also, Cursive currently expects every codepoint to be a one-column character, so some things may break with exotic characters...

Input

  • The key_codes example can be a useful tool to see how the library reacts to various key presses.

  • Keep in mind that if the terminal has shortcuts registered, they probably won't be transmitted to the app.

  • UTF-8 input should work fine in a unicode-enabled terminal emulator, but raw linux TTY may be more capricious.

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值