最高第 3 名 已下榜
Rex adds rex.ui interaction
Mitchell Hashimoto宣布Rex的Lua脚本新增rex.ui,可构建需用户交互的自动化,多客户端先响应者生效。
要点
- 据 @almonk 介绍,Rex 新增 `rex.ui` 原语,用于构建需要用户交互的交互式脚本。
- @mitchellh 表示,选项提示会弹出在所有已连接的客户端上,最先响应的客户端胜出,并从其余客户端隐藏该提示。
- @mitchellh 表示,如果某个客户端已在显示提示,Rex 会返回 "busy" 错误码,由 Lua 脚本自行决定如何处理。
- @almonk 撰写了详细说明该功能运作方式的文档并附上链接。
要点和反应摘要由 AI 依据本页推文整理,请以原推为准。 我们怎么用 AI
原推
Rex has really powerful Lua scripting that our beta group has been using to huge effect. We expanded it today with `rex.ui`: a way to build automations that require user interaction.
The way this works with multiple clients: the choice pops up on all attached clients. The first client to respond wins (and hides the prompt from the rest).
If any client is already showing a prompt, we respond with a "busy" error code and let the Lua script decide what it wants to do (sleep, try again, force it, etc.). This will surely improve, but the API gives us flexibility to improve it later.
If no clients exist, another error code Lua can detect is returned noting that no user is attached, and it can decide what it wants to do.引用 @almonk: posted this into our Rex discord today... the new `𝚛𝚎𝚡.𝚞𝚒` primitives provides a new set of simple but powerful methods to build interactive scripts within Rex that require user interaction.
Now you can build the workflow of your dreams, that little action you always wanted or just a pizza topping selector.
I wrote some docs up that go into detail about how this feature works https://t.co/4UXo1z
X 上的热门回复
X 上的反应: 回复整体正面:有用户称把一个小型 TUI 改成了这套方案,还有人把 tmux sessionizer 的会话选择器移植过来,评价是"很不错""利落"。原推作者也打趣说这顺便成了 @paper 的广告。
讨论 0
注册 登录 后参与讨论
还没有人讨论,来说第一句。