Revamp the tui - #315
Conversation
9dbf68b to
548f5ab
Compare
|
This is awesome. I only have one piece of feedback so far and that's that it is very frustrating that it no longer allows Ctrl-C copying from the terminal window. |
|
On a Mac, you can to alt (opt) + mouse to highlight a region. And then cmd+c to copy to clipboard. But this will include the text area boundaries. Very nice that the pasting works as expected. Separately when you hit "Shift Enter" the prompt is sent, instead of creating new lines, which was the case before. But is there a way to address that behavior with textual? The copy issue is not a deal breaker for me because everything else is enhanced. |
|
@mikegros The clipboard should work now! We use a platform-specific clipboard if possible, falling back to OSC52 (the default) if that doesn't work. If Ursa's running in an SSH session the default is OSC52, so the text ends up on the client. There's also a @luiarthur Shift+Enter inserts a newline, Enter submits the prompts. At least that's what it's doing on my system and should be doing. Am I misunderstanding the comment? One oddity is the prompt area is set to be markdown, so a message like this: Shows up as |
Thanks! I can copy to clip board on Mac in both default terminal and iterm2 using But |
|
Shift+Enter not working appears to be terminal specific. In Ghostty the new TUI works and the old doesn't. In Terminal.app (and possibly iTerm2) the reverse is true. With the caveat that in Terminal.app a multi-line prompt is submitted multiple times, so also was kinda borked. On the plus side the new TUI in the Terminal.app does support multi-line prompts being pasted in.
Copy over ssh will only work if the terminal supports OSC52. That needs to be enabled in iTerm2 to work, but is not supported by Terminal.app (Mac). I'm not aware of an alternative to OSC52 for copy-over-ssh. But if there is, and the Talking to @mikegros, support for the out-of-the-box experience (ie. Terminal.app) is important. I'm going to keep poking and see if I can get that OOTB behavior better on Terminal.app. At a minimum the keymaps reported to work, should work. |
|
Cross-terminal support should be fixed, the core issue is that getting nice keymaps in a tui only works if the terminal supports it. The fix I just pushed is this:
Either way the keymaps don't change. As an aside, Shift+Enter on a traditional terminal is sent as the same keycode as Enter. The old TUI got around this by using readline, but only sort of. |
|
Looked into the Windows CI failure ( The fix is one line in conversation.scroll_end(
animate=True,
duration=0.15,
+ immediate=True,
on_complete=lambda: self._finish_conversation_anchor(
generation
),
)With the animation running from the moment the flag is set, any later user scroll goes through The remaining Windows failures in the branch's run history (plan spinner, plan card, Ctrl-C) look like fixed |
|
Thanks @BrennanTM I've cherry-picked the commits onto this branch |
04e8a9e to
14ddb07
Compare
| ``` | ||
| ### Full-screen interface controls | ||
|
|
||
| Type `help` or `?` inside the prompt to see available interactive commands. |
There was a problem hiding this comment.
I'm not sure where to put this comment, but every now and then, ursa will say something like,
To see available URSA commands, type:
helpor?
which has been replaced by things like / commands. I know we baked this in as a system prompt somewhere... wherever this shows up, could you remove it?
|
@awadell1 In the tui, when you type
|
The config updates in this PR allowed a 'inference_provider' section of the config files. If you use a config file with that, it will populate the inference provider info into that box. If you use the current config format (like the current example in configs/example.yaml), it does not. |
scroll_end defers to the next refresh unless immediate is set, which left a gap between the transition flag and the running animation. A user scroll landing in that gap was overridden once the animation began, which is the Windows CI failure in test_user_scroll_cancels_initial_anchor_transition and a real interaction bug on slow terminals. Starting the animation synchronously lets any later user scroll force-stop it, and no callbacks fire on that stop, so the interrupted transition stays cancelled until the next prompt resets it.
|
@luiarthur I've update the
|
e9c57d0 to
a7df1a5
Compare
ba3c3bc to
0f19bc3
Compare


tl;dr Replace the Rich HITL with a Textural CLI
It's really nice...