Repository navigation
Bubbletea-ify shell - #9620
Bubbletea-ify shell#9620
Conversation
|
Doing EDIT: actually, stderr says 2, but my shell says 1: |
Isn't only when something is in progress though? When I have output from a command that is bigger than the terminal height, and I'm at the prompt, that output is cropped. Holding |
c58ef46 to
64b2fe6
Compare
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
we only use this for scrolling, doesn't seem worth Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
TODO: how should concurrency be handled? Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
otherwise it can fail with concurrent runs Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Auto-selecting object fields hasn't really turned out to be a great DX: * Sometimes those fields are extremely verbose * Most of the time those fields aren't very illustrative (e.g. container doesn't show its imageRef or the command that it runs) * It's possible that selecting those fields is destructive So instead we'll just print the object type and hash. This way you still get an idea about what's returned and can tell if it's the same as another object. Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
a bit weird, but apparently this is reality Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
now toggles, and just JSON dumps the snapshot like the web version Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
there's a sneaky \b in there now Signed-off-by: Alex Suraci <[email protected]>
Signed-off-by: Alex Suraci <[email protected]>
|
For continuity: I went with a new option D:
This feels like a good balance to me: mouse actions "just work" as you would expect, scrollback behaves like a normal shell, and we don't break any behavior outside of |
Fixes #8990
Fixes #9202
Fixes #9281
This is a somewhat dramatic change to the
dagger shellUX and implementation.Previously
shellstarted the TUI and backgrounded it to show the prompt and accept user input. After accepting user input it would foreground the TUI to show progress, and then background it when its command completed. This had the downside of not being able to let progress "linger" in the scrollback.Now
shellis directly integrated into the TUI, where we show a prompt and history of commands (using the regular progress output, zoomed to the shell's span).Major change: don't print object leaf fields
Instead of auto-selecting an object's scalar/leaf fields and printing them in YAML format, this PR also changes objects to simply print as
TypeName@xxh3:....A few motivations:
Containerdoesn't show itsimageRefor the command that it runs)Open question: scroll wheel/mouse input handling
Now the entire shell session is rendered in our TUI, rather than printed plainly to the terminal scrollback. The TUI isn't able to rendering anything offscreen, so if you scroll the terminal it'll just be cut off at the top.
To handle that, currently our TUI hijacks mouse events so that it can approximate1 scrolling. There's no way to only intercept scroll events, and we don't do anything with click events, so if you try to select text nothing happens. Annoying!
The workaround for that is to just hold Shift while using the mouse, which is the universal2 technique to bypass sending mouse input to the program. But not everyone knows that.
Eating mouse input got in the way for the demo so I hastily removed it, which is a "breaking" change across the entire TUI.
The question: (when) should we eat mouse input?
There are a few options:
Shift + scroll (nav mode)
Shift + select (nav mode)
Some notes:
mainand v0.15.x.shell).Footnotes
It switches focus between spans and renders outward from the focused span, it doesn't act like a pager. ↩
By my measurement, anyway; never ran into a terminal where this didn't work. ↩