Uh oh!
There was an error while loading. Please reload this page.
Conversation
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
i like the idea of supporting this sort of thing, but this example doesnt seem to work very well
#!/usr/bin/env ruby# typed: truerequire('cli/ui')CLI::UI.frame_style=:bracketCLI::UI::StdoutRouter.enableCLI::UI::Frame.open('Frame 2')do30.timesdoCLI::UI.write('test')endendCLI::UI::Frame.open('Frame 3')doCLI::UI.write('test' * 20)endCLI::UI::Frame.open('Frame 4')doCLI::UI.write('test' * 30)CLI::UI.write("\n")endi guess i'd expect closing out the frame to inject a newline? not sure.. we've kind of avoided this up until now because of these sorts of problems. i haven't looked at how easy that would be to do. you could consider doing this manually via CLI::UI.raw e.g.
CLI::UI::Frame.open('Frame 1')doCLI::UI::Frame.open('Frame 2')doCLI::UI.rawdo
$stdout.write(CLI::UI::Frame.prefix)
$stdout.write('test' * 30)
$stdout.write("\n")endendendand then it's the responsibility of the caller to ensure there's a trailing newline. if we provided something like CLI::UI.write ourselves i think it's our responsibility to ensure frames work sanely. maybe it'd make sense to have some api that automatically adds the newline at the end of the block? e.g.
CLI::UI.write_line do |io|
io.write('test' * 30)
end
the ruby + gem version bumps i think are unrelated to this change and should be split out if this pr continues
Uh oh!
There was an error while loading. Please reload this page.
juharris
commented
Apr 25, 2025
Thanks for the tips @joshheinrichs-shopify I'll PM you more details since this repo is public. |


Helps when writing in a frame.
Examples:

It's helpful because existing methods to write don't work well in frames because the beginning bar is missing. This still isn't great, but it's much better:

Bump to version
2.4.0.Bump Ruby version to 3.3.1.