Responsive TUIs aren't hard
FULL TRANSCRIPT
Can we just talk about this for one
second?
When did anthropic engineering figure
out how to do responsive two? This is
wild. How
Five 4 3 two Oh, dang.
What is it? Uh, we'll go row.
columns.
How does that sound? Is that Is that
pretty good? Is that Is that what we
want?
Let's just see what happens. Uh
make a resi uh on resize function. I
don't know if that's even I don't even
know if that's an event. I don't even
think that's an event in node or in bun.
But let's just do let's just see what
happens because I already know what I
would do.
I know how I would implement this.
But it is very interesting to see if
this actually exists.
All right, while we wait for that
function center uh text
uh text uh term uh
uh type uh term is just going to be this
uh what is it? By the way, my uh my my
uh indenting has broken. Okay, guys. It
is I I I just just reinstalled um Yeah,
my my indenting is broken. It sucks.
Okay,
so just deal with it.
Uh print uh let's see uses S. Let's see.
Uh how how should we do this? Um clear
screen with an
put text into center of screen.
There we go. Bada bing, bada boom. Okay,
let's see. Okay, does it have is resize
a real thing? Is resize actually a real
thing? I don't know if is is it a real
thing?
Um resize
really resize this thing. Okay, well I
mean that makes it pretty easy. Okay,
there we go. We have center text uh
function init. Uh here we go.
Let's see. Uh makes the terminal into
raw mode.
That seems good. Uh, listens for resize.
Prints the uh, rows and calls in the
center of the screen.
All right, here we go, boys. Look at
that. I barely even typed. I just I just
I just did these things. Uh, Annette,
I know, guys. I'm about Dude, we're
about to do something crazy here.
Okay,
I know this might seem kind of crazy. Uh
bun. Where where was this? That was in
game. Okay. Uh source. Let's see. Game
test
run. There we go.
All right. Nice. All right. Good. Good.
Good. Good. Good. Good. Good. Good.
Good. Good. Good. Good. Why is it Why?
Let's see. Why did we uh leave? This
shouldn't have left because I thought I
had the re Oh, it's We're not actually
keeping this thing alive. Uh, let's just
go like this.
I thought that thing would keep it alive
because I have a listener. I'm
surprised. I'm surprised that the
listener doesn't uh stay alive, right? I
thought that would keep my process
alive. Do I not understand note anymore?
Maybe.
I don't know. I don't know.
Maybe I just don't understand it
anymore.
There you go. Look at how silly that is.
There we go.
That's some That's some pretty crappy
programming right there. But I'm pretty
sure that if I go like this
Oh my gosh. No way, bros. No. Oh my
gosh. He Dude, I just Dude, I just made
Dude, I just did what Anthropic did.
Brothers. Brothers. Oh my gosh. Huh?
Huh? Huh? Oh my gosh. How did we do it?
How did we do it? It's impossible. This
is actually impossible.
Oh my gosh. Rows are expansive as well.
Okay. Oh my gosh. Rows are expansive.
Impossible.
Anyways, so of course this led to my
what I would consider to be my greatest
ratio of all time, which is I can't
believe we have integer-based UIs that
can respond to ins. We h we've we've hit
new levels of technology that have never
been seen before.
UNLOCK MORE
Sign up free to access premium features
INTERACTIVE VIEWER
Watch the video with synced subtitles, adjustable overlay, and full playback control.
AI SUMMARY
Get an instant AI-generated summary of the video content, key points, and takeaways.
TRANSLATE
Translate the transcript to 100+ languages with one click. Download in any format.
MIND MAP
Visualize the transcript as an interactive mind map. Understand structure at a glance.
CHAT WITH TRANSCRIPT
Ask questions about the video content. Get answers powered by AI directly from the transcript.
GET MORE FROM YOUR TRANSCRIPTS
Sign up for free and unlock interactive viewer, AI summaries, translations, mind maps, and more. No credit card required.