Building a new Laravel dev runner (as a TUI)
Building a new command runner for local development
Everything I said
Ding. Okay. I think it, I think it's working. Oh, let's take that. I'm gonna delete that. Let's see, last night I watched...
Oh, no. I've, I feel like I've successfully muted my way out of Hawk Tuah, but yet, here we are. Um, Tuis in Laravel, and I'm going to try to build a new Tui to run...
Let's see. Building Tuis in Laravel. I'm going to try to build a new Tui to run, uh, all local... Hey, Duncan.
All local dev commands at once. Is that clear? That doesn't feel clear. I'm gonna try, I'm going to... I'm not gonna try to, I'm gonna do it. I'm going to build a new command Tui to run all local dev commands.
That's clear enough. Hi, Kelvin. All right. I, uh, so I watched this last night. Um, let's see.
Keep going. CLI experiments. I watched this last night, almost all of them. I didn't do dancing bears. It says dancing bars. I didn't do dancing bars. Um, but I watched all of these last night. They're incredibly good. It's so freaking good.
So I don't know if y'all have watched this series yet, um, but you should, 'cause it's incredible. Um, very, very good stuff. So I'm gonna try to use all of that good stuff to build out a new command here, um, because I don't love, I don't love the new, uh...
Composer. I don't even know if I have it in this one. Yeah, I don't love the NPX concurrently thing. I think we can do better than that. Hey, Ryan. Hey, Tim. Hey, Icarus. I rec- Icarus, I recognize your, uh, handle from Twitter. Um, I just don't love this. This doesn't move me.
I'm unmoved by this. I think we can do something, something cooler. So, we're going to. Um, so the plan is... Uh, I don't... Ignore that. Um, yeah, concurrently doesn't-- I don't know, it doesn't feel great.
And so the plan is, um, not streaming template. Um, where would this be? Not try hard. I think it's just in Life OS. Yeah, I think it's in there. Hey, Vikas. Um, Steve did all the logo stuff for me.
So in fact, if we go back to, um, try hard, streaming, open that in PHP Storm, and we go to app view. Here are the logos, Tersus and Tree Fly, and... Like it's got an animation.
This is just a view app. There you go. That's it. No, I'm not gonna sell coffee through the terminal. All due respect, all due respect to the terminal team, that sounds crazy. All right.
Um, all right, let's just start. So what I have here, I think I have Chewy. So this is Joe Tenenbaum's little helper, uh, little helper class. Oh, hey, Andreas. It is, it is morning in Dallas. It's actually a raining morning. The, the one time I regret covering the windows is when it's a rainy morning.
I love a rainy morning. All right. So we have Chewy here, which is Joe Tenenbaum's little helper, uh, package. It's a little bit out of date because it requires some pretty old Laravel prompts, but I bet I can convince him to update that. So, we're gonna use Chewy, we're gonna use Laravel prompts.
Do I have prompts? I do have prompts. And so the goal is to be able to run this dev command, and let's see. Um, we'll run Pail probably. I don't actually want to run PHP Artisan serve. I don't wanna do that. Um, but I understand a lot of people might.
Uh, what's the other one? PHP artisan queue work. Let's just copy for now. We're gonna just copy Pale timeout. Oh, that's interesting, timeout zero. So we're gonna run Pale timeout zero and queue listen tries one.
I think queue listen is the one that restarts itself. I'd have to look. Um, and NPM run dev. So we're gonna run all of those. Uh, yeah. It was disastrous, wasn't it? Um, and I think one of Taylor's great skills is being able to separate, uh, content from
presentation. Uh, a view component library. Yeah, I think in this one I actually used Shadcn, but this is just like a, this is kind of an experimental repo. Um, listen reloads automatically. Okay, cool.
That's what I thought. Um, yeah, there's Shadcn View, which is quite good. Um, okay, so the goal is, here's the goal. Um, let's do this. We're going to create tabs for each command, be able to switch, switch tabs to show command output.
Um, let's see. Future, um, pause output scrolling. I mean, honestly, it'd be nice to, like, scroll back. That seems tough. Um, register new commands.
So like packages can say, "Hey, when you run this dev command, in fact, I, I have a command you need to run." Um, which feels kind of important. Um, I haven't used Prime View. Not, not yet, at least.
The interesting thing about, um, what I do now is that Steve primarily handles all of the front-end stuff, which is great. I'm a little off-center, aren't I? I need to be over here. Ooh. I have a, uh, piece of tape on my desk to show me where I should sit to make sure I'm centered. So create tabs for each command.
Be able to switch tabs to show command output. That's where we're gonna start. Um, and so I have-- Don't look at all this. This is all secret. Don't look at that. Uh, yeah. Chewy. We're gonna create a new-- Uh, Chewy is a text user interface.
Does that seem... Terminal. There you go. Uh, JetBrains Mono. Yes, it is. Um, we're gonna create a new, we'll just call it dashboard. Not a great name, kinda like calling something data, but it's good enough for now. And then I think we need-- So I'm, I'll warn you, I'm very rusty on this. Uh, not rusty. That's incorrect.
I'm very ignorant on this, because I've only just learned a bunch of this last night. Literally, I was laying in bed. I was-- A wild life. I was laying in bed watching, uh, Laracasts. Dashboard renderer. Um, okay. And I think dashboard needs to extend prompt.
That seems right. We're actually not going to return. We're not, like, we're not, like, picking a value or something. Um, my glasses are on. Sorry, I, sorry I took them off and freaked you out. We're not picking a value, so we're not actually gonna return null or return anything here. So now what we're gonna do is we're gonna go look at what Joe did.
So this is his Laracasts course. This is Twitter. That's not what I wanted. This is Pale. This is Chewy, and this is, uh, this is-- Man, anytime someone telegrams me while I'm streaming, uh, Andy Newhouse just telegrammed me, and I thought they were saying, "Hey, you just leaked everything," so I got nervous.
So we're gonna go steal Joe's tabs here. Um, so we want registers, renderers, and creates alt screen. So I'm gonna start by setting up a tab structure. So we're gonna say, use registers, renderers, creates alt screen. I only literally just learned what an alt screen is last night.
Very cool. Um, these tabs are fine. We can take those. We'll take that as well. So we're just starting off by stealing a bunch of stuff. Um, uh, yes, you can create dusk for scraping. In fact, I have a lot of, uh, browser experiments right here.
Provides browser. Provide a local browser for remote automation. There's much to do. Much to do, but we're not doing that right now. So coming back, we're gonna steal some more stuff. Yeah, let's just steal all of this. And so this should set us up with a good tab structure.
We're gonna call this dashboard renderer. Create an alt screen. I'll maybe explain that. I don't fully, ooh, don't fully know what that is, but I'll maybe explain it the best I can here in a second. Now, if we come back to, let's come to the dashboard renderer, and let's take a look at his tabs renderer and see what that looks like Uh, tabs renderer.
So I think the basic principle here is, um, the prompt class keeps track of, like, state and stuff. Uh, does this extend anything? It does extend. Extends a renderer. Chewy or prompts renderer. Prompts themes default renderer. Um, I think the basic premise is that, um, um, the prompt class keeps track of a bunch of state and
perhaps, like, interaction and stuff. Um, and the renderer takes that prompt class and renders it out. Let's... Will this give you the composer run dev command doesn't? Man, I don't know. I don't, I don't know. Uh, we're just having fun, man.
Oh, ngrok, that's too bad. Uh... Oh, Joe says he's happy to hop on. How do we do that, Joe? Um, how do we do that? Yeah, nobody steal ngrok while I'm...
I guess I'll just go roll the key. Did I really expose an ngrok key? What was it? Provide browser? I don't see a key there. I see a random... Yeah, that's a random key. It should just be random, but I hard-coded it. That's not like the, uh, API key.
That's something, that's something random. Yeah, we're just having fun. We're just gonna do some stuff. Not everything has to have a great i- a great purpose behind it. Sometimes you just wanna live, you know? Um, all right, what do we have in the... We've got all of that. So let's hop over to the dashboard renderer, and we're gonna just paste all that. And I think we need to use a few things.
I think we need to use aligns. Joe says, "I have no idea." I asked him, "How would we, how would we have you join?" And he said, "I don't know. I don't know." Um, man, I wish there was a way... I'm not set up to do that right now, Joe. I th-- if I had thought ahead-- Hey, Jamie. If I had thought ahead, I would've set that up, but I didn't wanna bother you.
So what if we do this again, uh, in a few days, and we have Joe come on and show us how to? So I'll do it bad, I'll do it poorly, and then we'll have Joe on, and he can do it correctly. Um, so let's do dashboard. Jamie, have you recovered from, uh, launch week? Let's...
Yes, please. All right, so Joe's in the chat somewhere. All right, so we are gonna use aligns, and we're gonna use draw hotkeys, which is just, like, Chewy is awesome. Uh, it'll take a few more weeks. Um, if y'all didn't follow Turso's launch week... There he is. There's Joe.
If y'all didn't follow Turso's launch week, you need to, because it went very well. And I have lots of ideas for Turso Laravel that we're gonna get to. All right, I think we might have stolen everything we need to, um, creatively borrowed everything we need to. So now if we come to, we're gonna call this command dev.
And I think all we need to do is say new dashboard. And then I think for now we'll say prompt. We're gonna move into loopables here in a second. Uh, not streaming template. So here we are, AR app dev. Ha ha! I'm a genius. I mean, one could argue that Joe did all of this, but it works.
So the goal is-- Yeah, it took, like, two seconds. Joe, I don't know if you were here when I was explaining that I watched all of this in bed last night, and I was like, "Ah, I'll just go to bed." And then I thought, "I've got this idea, but I wonder how to do it." And then I remembered you had a course on it, and I just stayed up and watched it all. I think I skipped dancing bars and stopwatch, but I watched the rest of it.
Super good. Super, super good. All right, so instead of about me, skills, projects, contacts, that's gonna say, uh, queue, logs, uh, NPM, et cetera. Oh, I two x'd it for sure. All right, now, um, we're gonna take this incrementally.
Uh, so we've created a tab. Um, what we're gonna do is there's a lesson in his course or in his series, I don't know, do you call them courses on Laracast? Um, where you can create a loopable. So what we're gonna do is, uh, we're gonna have one called, I don't know. W- Don't, don't judge my names quite yet. Gather, gathers output.
We'll just call this gathers output, and then I am gonna look at, there's a loopable in here for dashboard Halpulse. Implements loopable uses ticks. So what I am gonna do is say implements loopable. And so to my knowledge, this lets us have basically, like, components that kinda live on their own, uh, timeline.
Sorry, Joe, I don't really know what I'm talking about. All right, and then we're gonna say use ticks. And if we come in here, and then we say, uh, I think there's an on tick. Yeah. And let's do a construct as well And let's just say, um, ooh doo doo doo doo, uh, public carbon date, and then we'll say this date equals now, and on tick we'll do the same thing.
And then I think you have to do, like, I think we have to switch it to run. So we're kind of exiting the, uh, prompt's happy land, and we're going to our own little space here. So I think in dashboard, um, did we already register the renderer? Oh, I think we stole that from Joe, so I think we probably did.
Yes, we did. And then what we need to do is register some loopables. So this is what tells Chewy, um... This is what-- So we need to use loops and sets up and resets. Since we're kind of like exiting the blessed path, we have to do a few of our own things.
Sets up and resets and loops. And so now we're kind of off on our own here. Um, loopables, we're not gonna do all of that. We're gonna have one loopable just called, uh, public, l- gathers output. Output is fine. Um, what did I do wrong here?
Uh, I don't know yet. Uh, this gathers... Just call it output. Oh, that's illegal. Uh, we'll just call this, uh, I don't know, logs. Wrong name.
Interfered. Uh, logs equals new, gathers output. This isn't gonna do anything yet, but it'll at least show us if we're looping. Yeah, it's on YouTube. Yeah, it's on YouTube, Aaron D.
Francis. It's on LinkedIn. It's on Twitch. It's on Kick, whatever that is. We're recreating the new composer dev script, but way more awesome. That's it. Just having a, just having a bit of a lull this morning. Um, an L-O-L, not an L-U-L-L.
Uh, okay, so we registered the loopables, but then we have to do something else. We have to create a run method. So we're gonna create a run, and this setup comes from Chewy, which is just the best freaking name I've ever heard. Chewy, we're gonna take yoink. That's mine.
You're mine here. Key pressner, key press listener, listen for quit, render once. I think we're gonna null that out for fifty thousand. Um, all right, and then we need to bring our key listener down here. All we've done so far is copy what Joe has done. If you haven't watched the Laracast series, I highly, uh, in fact, I require that you watch it.
Please say, "Ryan, hello." Um, Ryan, hello. Did I do it? All right. Did we do everything we're supposed to? There's like a fifty percent chance this is gonna work.
Um, however, we have not output. Uh, so prompt comes in. I don't want content here. I want, um... In fact, I will just take that and I'll say prompt logs, which is not really logs, but that's fine. Date format Y-M-D-H-I-S.
Boy, of all the things I have memorized, that's one that I wish I didn't. Um, okay. Change from prompt method to run in dashboard. I think I did. That.
This is PHP Storm. Oh, I don't have a Discord, I'm sorry. S- s- s- s... Okay. So the alt screen thing, you notice how, like, when I quit out of this, my whole, everything comes back, and when I go into it, it goes away?
That's the alt screen. No idea how that works, um, but it's cool. Yeah, I'm just publishing. I'm just using Restream right now. Um, but in due time, I have a FFmpeg script that I will start using. Okay, um, neat. So have we done anything interesting?
I don't think so, but it's kinda cool. Um, all right, if we come, ♪ doo doo doo doo doo ♪ we come back here, let us in fact, to gather input, let's pass an invoked process of process. Um, we can just make this a public read-only process.
Um, on tick, we need, let's see, uh, we do need to gather the output. So we're gonna say public array output equals nothing. But when it starts, we want this output to equal process Uh, get output, output.
And then down here... Why are you complaining? Oh, um, we need to explode, which is super metal, uh, PHP EOL. So we're gonna s- gonna put these in, each line is gonna be an array entry. We'll take you, we'll come down here and take you, but this is actually now latest output.
Uh, so we'll call this latest, and then we'll say, if there is latest, uh, in fact, if there is not, we'll just bail. Then this output equals array merge, this output and latest.
So on a tick, we're gonna inspect the process and see if there's any latest output. Um, we have to stash this to a temp variable because this increments the output that you've seen, and if you call it twice, you'll get nothing, um, the second time. Then we're going to merge, ch-ch-ch-ch-ch-ch-ch-ch.
Okay, so this should stash. We're gonna have a-- We're gonna just explode the memory here 'cause we never clear out the output. But in due time, at to do, um, truncate, no, only allow X entries.
S-s-s-s-s... Latest output. Very cool. All right, so if we come back to the, uh... Let's come back to the dashboard, and now it's complaining, rightly so. And so we're gonna say that, um, let's just start with tail. Tail equals process, Laravel's process, command, PHP, artisan, tail.
What is their-- They have like a timeout zero on there, I think. Um, start, and we're gonna pass. That should return an invoked process. Start the process in the background, which is what we want. How is that different than just run? Run the process. Does that do it in the background? Boy, those look the same.
Something's different. We're just gonna go with start. We'll see. Is run better? Is run better here? I don't know. Doesn't matter. It works. All right, so we're gonna start the process. We're gonna pass it through. That's gonna gather up the output.
Then we can come to the dashboard renderer, and instead of all of that, what we're gonna do is what? We are going to, um, let's do collect this prompt. Is it this prompt or did we just pass it in? Nope, just local prompt output logs.
I don't like that. That's a terrible name. Um, collect the output. It's insane, that naming. Take... I don't know how many this is gonna be. We'll take twenty lines, and then we'll say, um, we'll each over them and say this line and use that fancy stuff. Um, okay.
So do I have not test.json? Not test.json. All right. While true, info a random string, sleep for, um, I don't know. I don't, I don't know if I'm gonna use tail or tail.
Don't know yet. The good thing about tail is it's really pretty. Um, it's a little bit, in my opinion, uh, uh, not, it's not information dense enough. Could be a little denser, in my opinion. So here we're gonna run random. So if I open a new one and run ART, let's just say, just to make sure we're running.
Okay, so that should be filling up the logs with a random string every five hundred milliseconds. Now, if we run AR app dev, we get an error that's hard to see. Um, what if I get rid of the alt screen? Does that show it to me? Not really.
Dashboard renderer forty-four. Uh, I actually don't want that at all. Hey, look at that. That kinda works. I do use PHP Storm.
No alt screen equals one. Interesting. Okay, that worked. Um, I don't know what Nvim is. Uh, probably never, Ronnie, if I had to guess.
Is Nvim Neovim? If so, I'm not gonna use that. Oh, oh, oh, oh, I can run no alt screen equals one. That's cool. All right, so if I hit Q, it's gonna quit. Yeah, nice. So now- Let's do this.
Um, we gotta start making this a little bit cleaner. So how are we gonna do this? Um, we need two commands at least. Actually, I don't care if run is better. This works just fine. Let's do, um... Should we do NPM?
NPM run dev. Is that what the composer one does? NPM run dev, yeah. Okay, so here's how I think we're gonna change this. Um, let's start slow.
We're gonna get rid of all the content here. Oh, let's just, you know... Okay. Um, all right, we're gonna change this to, uh, logs, and we're gonna change this to NPM, and even though this doesn't exist yet, we're gonna change this to queues, and
I don't know, reverb? Let's try that. Um, this is not the final form, but this is how we're gonna start. Uh, horizon, that, that'll be queue. So now, how...
What's the best... I'm gonna need a proper class for this eventually, but y'all, we gotta go slow and build up over time. Um, I just hate calling this output, but that's fine. This feels goofy.
I don't know if I love this. Um, yeah, I don't use PHP Artisan Serve because I like having the custom domain, so I use Herd. Um, but it, it, you, it'll be configurable. You can add it. That's fine. All right, so now we're just gonna hard code it, logs and NPM. So we're gonna say this, um, tabs is zero.
Let's say that the process equals... Don't worry, this is not the final form. Y'all don't freak out. Um, first make it work, right? Isn't that something? So we're gonna yoink that. That's mine. Yep, yep, yep, yep.
No Herd for Linux? I think so. Oh, that's a good joke. That's a good joke. I hate it, but it's a good joke. All right. Um, this is super manual, and I don't love it, but that's fine.
So we're gonna say that, uh, do, do, do, do, do, a new gathers output from... Not pretty. It's not pretty. Um, but it's closer. In fact, let's just...
We don't need y'all for now. Uh, uh, uh, oh, interesting. The loopables are gonna be, um, goodness, uh, collect this tabs pluck, uh, output.
This is ugly. It's fine. It's fine. Um, all, and we'll spread that. Totally fine. Y'all don't worry about it. Um, okay, so that should... And the good news is, um, since we do have control over this process, we can also register hotkeys like, uh, kill the process or restart the process, that sort of thing, which is gonna be nice.
So you can, like, go into your NPM process and just hit R, and it'll refresh. Like, it'll kill it and bring it back to life, which will be, should be kinda nice. So now this is wrong. Um, in fact, much of this is wrong. So we have, uh, yep, logs and NPM.
Those should both start. Yep. This is, this should all be right. We should only have the two, um, oh. Then don't complain about it. Um, okay. That we have too many colors for... In fact, this is, yes, that is correct.
It's only used here. It's fine. I don't know about that. Um, so where are we? We need, um, I need to know what tab I am on. So I do it here.
Well, Joe did it here. I think it's a modified, um- Atom One light theme. Maybe? I don't know.
I feel like there's a theme for the, the UI and then a theme for the code. Appearance. Appearance & behavior, color scheme, Neo light, Neo light custom. So there are some things I changed about it, but it's Neo light. Um, I'm just gonna say, we're just gonna do it a little quick and dirty here.
I just wanna see if it works. So, um, I don't need to do that. What do I, what do I get here? How do I select... This is no good. Prompt selected tab. Oh, I just have the index.
Great. Yeah, I just, I just straight up have the index. That's perfect. All right. So, um, down here, what I need to do is I need to do this again, but collect prompt tabs. This-- Is it this? No, it's probably prompt selected tab.
Um, selected tab. What did we call it? Oh, goodness. It's so messy. Output. That really should be called, like, component or something. So then you go into gathers output, which is, I'm just getting real messy here.
Output, output. This is very stupid. Um, this is gonna become lines. Okay, so that's lines. So we're gonna go output, dashboard render, output, and then that's actually lines.
It's very stupid. Um. Ah. It works.
It totally works. It works. This is cool. This
is, this is super cool. Um, so I'm super hooked. Um, the height, the width, I kept hearing him say give it some padding, so that's fine. Um, content width, I actually want, I actually want content width to be full.
So I'm gonna kill content width, and I'm gonna change this to width. Is content width used anywhere else? No. Yeah, Joe, is it possible to maintain colors?
Interesting. We, uh, we've got a little, got a little word wrap going on, or a little... Hmm, I wonder why that is. Width plus four, that's why. There we go.
This is cool. I'm asking Joe if it's possible to maintain colors, 'cause I know that, I know that pale, like if you run, so that's logs there. If you run AR pale, you get some colors. I don't know about the whole box thing. I kinda like it. Like, it's nice, but it's not, I don't know, it's not dense enough.
I want, I want it all on one line, kind of. Joe's looking how to maintain colors. We do love the colors, don't we? Arrow ASCII. Simon, uh, you're gonna have to be more specific.
Where do I put arrow ASCII? Gotta remember who you're talking to. I don't know anything about this. Um, okay, so I feel like that next previous should be pinned at the bottom. I don't know why it's not See, it pinned to the bottom. Um, all right.
So now we need to make this... We need to do a lot of things, TBH with you. Um, well, let's see what we've done. Uh, we did that. We did that. So now we're already on to future. Um, I think we need to clean this up a little bit. It's not, it's not beautiful.
Um, CI, CLI color force equals one. That's esoteric. AR app dev. No. Um, Simon says something about the invoked process.
Oh, so if we go into... Yeah, there's output. Color, ASCII, ANSI. Boy, this stuff is way over my head.
In the script where? Oh, CLI color force equals one in the script itself. Let's try that. And if this doesn't work, we're just gonna bail on it. No.
No good. That's all right. We'll keep going. We'll figure out colors later. Yeah, I think you're right, but I don't know how to do that. I don't know how to get the output with...
Uh, I mean, should we just go look? Um, ANSI color output. Y'all, this is way down here. I don't think we're gonna find it.
If someone extremely smart wants to find out exactly how to get the colors from the Symfony process, I would allow it. Um, this is a light theme because it's daytime. Ooh, set TTY.
Uh. Let's find where set TTY is. Pending process to Symfony
process. I don't see where set TTY or TTY is set to true, though. Value, right. There we go. TTY on what? On the pending process. Okay. So does command return a pending process? It does. And so we can just say TT, TTY.
Let's see if that does anything. All right, this is our last shot. Um, I have a, have a hard time DDing stuff here. Oh. TTY is right, but it's really messing up.
Look, it's messing everything up because look, the, uh, the thing that should be at the bottom is now at the top, and our tabs are gone. So there's something about TTY that is, uh... That's over, that's above my pay grade.
Um, so we're gonna yoink that and let Joe figure that out. Okay. Here's the thing. I don't know what TTY is, so, um, don't know. Never heard of it in my life. All right.
So that works. Um, we need... There's a little bit of formatting wonkiness, um, and we need to make it a little bit cleaner. Hellotyped Y. I don't know what that means either. Y'all would be shocked at how little I know.
Shocked, I tell you. Um, okay. So here's what I wanna do. Um, I need like a... I need like a, like a manager class or something where I can, where I can register these.
Um- Let's do it over here because I don't think the dashboard should... The Laravel dash- Laravel Prompt's dashboard should not be responsible for knowing... S- s- s- s- s- um, let's just make a little...
I'm gonna have to extract this into a package pretty soon. Still don't know what Teletype is. Um, all right, let's ignore the bad naming for now and just call this Dev Manager, and we'll say public static function add command, static commands
equals nothing. We're really cooking now. Um, what should we, uh... We should just have, we should have another class. Okay. We're gonna have a dev command class.
You must pass a dev command, and then we will... Uh, that's fine.
So then over here, we'll just pretend I'm doing this somewhere else. We'll say Dev Manager. Is that what we called it? That is what we called it. Manager. Why don't you like that? Back. Add command, and we're gonna have, um, new dev command, and we'll just say
that it is that. Um, let's do it this way. Let's say that the command is that, and the name is logs. Um, so long Joe. Uh.
Okay, so we're getting a little bit more structure. Oh, thanks. I like this hat too. Um, yeah, I can, but with static, it's weird, isn't it? Add command, uh, pale. So if we go to, uh, dev command, and we make a constructor, we can do public readonly string name,
and we'll just make the command a string as well, 'cause then I think we can probably... Oh, man. I wonder if I should encapsulate all the log stuff in here. Who can say?
So then if we pass pale... So this would happen, you know, this would happen in some service provider somewhere, um, which is fine. And let's just do, uh, let's just make them both. So we'll do NPM, and we'll hop over to dashboard, and it's just NPM run dev.
Uh, okay. Uh, so static commands and then commands.
No, it's not long enough to be on two lines. So add commands, pale, and NPM. Don't worry about these names. I know the names are terrible.
Um, okay, so then if we come back to dashboard, ooh, doo, doo, doo, doo, doo. Um, let's rethink this a little bit. So we'll have create alt screen.
So this all kind of goes away. I don't know where to put stuff. That's a good question. Where do I put stuff? Dev command. Um, okay, so Dev Manager commands collect each...
Eh, let's just, eh, eh, let's map them. Um, so each of these should be a dev command, command. We can actually just say this tabs equals that. And then we gotta say at the end, we want all of them, and we need to return.
For right now, we're just gonna return name. Is that what we called it in the renderer? Tab, it's just called tab. We'll fix that later. Command, name. So right now, we're just matching the old process, and then we'll make it, or the old structure, and then we'll make it better.
So the output is, I think it's a new gathers output for the command. Uh, this is actually not right. Command, command. That needs to be, uh, let's go over here, dev command. Public function, uh, ch-ch-ch-ch-ch-ch-ch-ch-ch.
Um, I mean, that's fine. I don't see why not. Return process, command this command, run. No, start. We can put you down here. I don't, ooh, ooh, ooh, do I love it?
I don't love it. Invoked process. So now I want a command run. That's an invoked process. And then I don't think I actually ... I don't use you anymore.
I don't use process ever. So I think I just need tab and output. Ah, hello. I think your real name is Levi. Is that right? You'll have to, you'll have to tell me. Um, ts-ts-ts-ts-ts-ts-ts-ts-ts-ts.
All right, so if we do this, um, did it just work the first time? It sure did. Levi got it. Look at that. It just worked the first time. And so now, theoretically, I'm in my app service provider.
Um, I'm in my app service provider, which we're pretending is here, and I'm gonna change this to JavaScript, and I'm gonna run this again. Logs and JavaScript. Which means I can also, I can also do this.
Um, I can also do rand, and I can say rand PHP artisan, PHP artisan T, which is just my test command. And I'll come over to my test command, and I will info string random, rand equals that, string random info
to write it to the logs. And, rand, and we'll make it 700, we'll make it, uh, 1,000 milliseconds, which some people may say is a second. Um, hmm, hmm, hmm. So now in my fake service provider, I can add a new command for rand. In fact, what I would probably do is I'm over here in user land, and I can say, or I'm, you know, like I've made a package or whatever.
I can say dev manager, add a new command of rand. While these may live in the service provider, this may live in a package. And so then app dev, logs, JavaScript, rand.
Look at freaking that. I think the problem, uh, with the colors is I'm not getting them from that Symphony output thing, but I don't...
Thing works to BH. Um, a little wonky there, isn't it? Why are you being so wonky? What's going on there? I don't know. Colors would be kind of cool.
These logs should be way denser. I might just go to straight tail. What does tail F look like? Um, boy, that's a lot tighter, isn't it? And these Ariana Grande sleeves.
Um, I don't know, I don't know what raw mode is, but that sure is a lot, that's a lot tighter. I do like that. Anyway, um, this is cool. I feel like it's a little janky, but we're getting close, we're getting closer to something that might work.
Um, so if we quit this, and then I wanna add... Where are the hotkeys? Um, so hotkey R, restart process. Uh, and then how do I-- Where, where do I do the thing?
Um, oh, this is probably just informational. So I need to come back to the dashboard and say on right, on left, on key R function, um, this tabs, this selected tab.
Oh, goodness. We gotta get a, we gotta get a little bit nicer structure here. Uh, is it command? No, it's freaking output, which is just not, just, just not what it should be. Um, yeah, this is a mess. Process.
Process. I see why I did that earlier. Process. Process. Process. Ah, I feel like that's gonna be... Hmm. I feel like that's not gonna work.
So if I were to restart a process, um... Oh, man, this is ugly. So I think what I need to do is I need to say tab process signal. So if I say...
I don't know how to hint that that is, uh... Let's do it this way so I can do the type hint thing. This is an invoked process, and I wanna say process signal sig- Let's do sigint. So we're gonna tell that process to stop.
Why are you complaining? Yeah, that's fine. I don't care. Um, and then we're actually gonna reset tab process to, uh... What are we gonna set it to? Boy, what a mess.
This is not great. Um, I actually need command as well. Okay, we're just gonna make it work. I don't even wanna look at chat 'cause this is, uh, embarrassing. Oh, okay. Nobody's, nobody's mad yet. Um, so tab command run.
I think that's what it is. So we're gonna restart the process after we've killed the first one, and then we need to-- This is so bad. Um, new gathers output of this guy again.
Got some real state management issues going on here. So process is the running process. Output is that wrapped up. Ugh, hideous. Um, so when we hit R, we're gonna find the selected tab, we're gonna grab the process, we're gonna signal it to die.
Is there, like, a way to do a... And then we're gonna start a new one. All right, I don't know. Let's see if it works. All right. So I can restart the process by hitting R.
And if I hit R, did anything happen? Oh, Shift + R. That's stupid. Interesting. That doesn't work. Um, so the first thing I need to do is I need to change this, and then I need to actually... I can't do a new one.
I need to, like, re-instantiate. Blah. Um, so I swapped out the gathers input, and it didn't work. I don't know. Can you signal a process to restart? Beats me.
Beats me, my friend. Uh, sigint. I, I don't know what any of these mean, but I don't know if any of them mean restart.
Um, so the problem is now that we've got this new gathers output, which is no freaking good. Um, so in fact, that becomes not read-only. And public function replace process with an in- with an invoked process of process.
Um, this process equals process. So that is going to... I think that's actually fine. Um, but what I do need to do is I need to flush all of the, um, I need to flush all of the lines for the new process This
lines with, uh, the new process get output. So that'll flush... So this comes in, we reset it, we flush all of the lines for the new one to the lines array. Sure, just for giggles, I don't think we'll ever need it, but we can return self.
Now, instead of this, if we did replace process with that. Okay. And I hit restart. Hey, did you see it?
It worked. This is a Laravel dev runner. You're looking at it. Um, all right. So when I hit R for restart, I should do lowercase for the little hotkey down there. Uh, I should also move the hotkey to the end. When I hit R, you're gonna see, uh...
Yeah, you don't need to know any of this to get a job in tech. This is all nonsense. When I hit R, you're gonna see, uh, there, just watch. There you go. Tailing logs. That means it was restarted. Process was restarted. So if we switch to JavaScript, and we hit R, you see that dev and Vite boots up again.
Oh, but something cannot send a signal on a non-running process. Okay, so that's bad. So you can't restart JavaScript twice. Classic JavaScript. Can we restart? Ah, okay.
Uh, much-maligned JavaScript. It was not JavaScript's fault that time. Um, so what did we decide I need to do for the renderer? We need to make this a little R and probably move you down here. There. Now, why it thinks the process is dead, but I don't think it's dead.
Um, process running. I don't, I don't think it's... I don't know data structures. So let's actually come over to my test command, and we'll say, "This line starting." So
now if I hit reload here, starting. Oh, there. It works. Starting, starting, starting, starting. Let's make it a little prettier. Look at that.
Need to assign the tab back. Oh, you're probably right. How did it ever work is the question now. There should be a swap.
No, silly boy. This, uh, Josh, I was, I, I was wearing this yesterday, wasn't I? Um, this sweater is unbelievably comfortable.
Okay. Okay. Okay. So if I restart, look at that. Restart. Restart. This freaking rules. Restart JavaScript. Restarting. Restart JavaScript. Restarting. Restart the logs.
Restarting. That's kinda cool, huh? Um, okay. It's a little bit hideous. Um, and I feel like things are scattered in places that they shouldn't be scattered. Tss, tss, tss, tss, tss.
And this structure here, uh, what do the kids say? This gives me the ick. I don't like it. So it works, which is good. That's step one. Um, I need Joe to help me, like, make it prettier.
Um, like, for example, I don't know why sometimes there, there are weird lines there. I don't know why that's happening. Um- Yeah, like a value object, a tab class.
Yeah. Mm-hmm. Yeah. Yeah. Yeah. Here's the question. Um, is everything that a tab needs... Command, command, that's part of the command. Yeah, I do feel like I could just wrap it all up in the, um...
So what if I did this? Um, what if I just check Twitter real fast, just make sure everything's cool? Ooh, I have a message. I wonder if I leaked something. Oh, no, is somebody being nice? Joe loves it. Okay.
Back to work, friends. I think, um, I don't need Chewy. I don't need that anymore. I don't need Pale right now. Still on the fence if I'm gonna use Pale or not. Um, CLI experiments I do wanna keep open. I think this dev command... I wonder if, um...
Uh, goodness. I think it's called Neo Light is the theme. Oh, hey, Matias. Oh, man, what should I... I feel like these are, um, I feel like these are components. Is that...
Oh, man. 'Cause what I kinda wanna do is say, like... I don't wanna do that. I don't know if that, I don't know if that's right, though. You know what I mean? Um, I do think, so if we're just programming by wishful thinking, I think this, I think this should be commands
instead of tabs. Um, this is what we're doing, Matias. Oh, hey, other Matias. Honestly, I feel like if I'm at the end and I hit next tab, it should go back to the beginning. Restart, boom, restarted.
Restart, boom, restart. Restart, boom, restart. Yeah, you're seeing some types. Mm-mm-mm. I'm just trying to figure out...
This sucks. Oh, my goodness. Yeah, that's a scam. I don't know. If anybody's in charge, you can kick him out. I don't know if anybody's in charge. Um, this is hideous.
So where do I put everything? Let's program by wishful thinking for a second here. Let's call this commands. So if this is commands, honestly, I feel like it should just be that. I mean, frankly, it should just be that.
Um, just pull 'em straight out of the manager. That seems, that seems fine. Um, that seems fine. So then what do I do?
Um, this does, this no longer works. I think the command itself... I feel like, all right, let's do this.
Yeah, I think that's what I'm gonna do. So we'll say, um, tss, tss, tss, tss, why don't we do this? And we'll just say public process. Sometimes, you know, sometimes you just gotta start working. Um, you'll figure it out along the way.
So if we say that this process equals that, I think this is a pending process. It is a pending process. So we're gonna say that this is either pending process or, is that how you do an or? Invoked process. Cool.
Um, so we can say if this process is running, uh, running, um... So if it's not, then we're gonna say this process start I don't think we need to
return this anymore since it's public, but that's fine. Um, I honestly, I kinda wanna do, I kinda wanna control this here. Restart. So then this... Yeah, this feels better already. I don't know where this is going, but it does feel better.
So if we restart the process, then if this process is running, kill it. Mm, mm, mm.
Okay, I wonder, this is getting closer. Can you restart? Can you start a killed process?
Uh, UUID v7 is fine 'cause UUID v7 is time sorted. I'm sorted. You're good. I don't know if you can restart a killed process.
Can you? I mean, I know that you, you can in, in real life, but from here? So if we had, um... Let's get out of here. So if we had process run... No, let's do it exactly like we're doing it. Process run, process command, PHP artisan Pale. Uh, and then we're saying...
So what we're doing over there is we're saying process, and then we're doing process run, and then we'll sleep. Um, let's just do this, sleep for 500 milliseconds. Um, process signal.
Why does it not like that? Process signal, sig term. Why do you not like that? Oh, I see. Hmm, hmm, hmm, hmm. That's interesting. That's potentially something. I think this is actually start.
That's potentially something. Okay. So then if I kill it, and then I try to start it again... Yeah. This is interesting that there's a stop method on there.
Oh, it handles the is running for me. That's nice. That feels safer. Process restart. Who? Who has the process restart? Symfony process class. Still in Illuminate.
Son of a freaking gun. Be warned that the process is cloned. Okay, so that doesn't get me super far. I don't know if that gets me super far.
So I don't think you can, you can't restart. So the interesting thing, however, is, um, if I were to... Let me clean that up. The interesting thing is I never set it there.
So in fact, this will always be pending. Do I wanna keep track of a pending and a invoked? I don't know if I do.
This is curious, isn't it? Create pending process, return. That's not what I wanted. Return process command, this command. So if this process running, yeah,
potentially, potentially, potentially. Then this process equals this, create pending process start If... Ooh.
Ooh, I don't know. So a nullable invoked process. So when I restart... What are you complaining about? Um, I do wonder if I should just pass in... No, let's just make it work again, and then we'll make it better.
Um, so this component equals new. Boy. I don't have a running process yet, do I? Um, I'll have to account for that.
Tss, tss. I'm in the wrong place. I will have to account for that, which I will. This component, public component. Com- sheesh. Component.
Just, we'll just call it gathers output for now. New gathers output. Um, how do you do-- Can you do that? If process. So we're gonna start it without actually, um, we're gonna construct it without actually doing anything.
Can I do that? So then when we, when we run it, s-s-s, if we haven't started it, then this component, replace process with this process.
It's a little icky still, but it's getting a little bit better. It's not ideal. Okay,
that's fine. All right, so now, boy, um, now what can we do? This commands equals all of that, and I feel like we wanna start perhaps... What have I done? Yeah, that's a mess.
Um, perhaps... Uh, process is public, so what I'm gonna do, in fact, is this. And so I'm going to collect all of those, each over them and run them.
So we're gonna start all of the processes, which will return a collection, and then I want all. Uh, this is a higher order each. I think it should be okay. I think. Register loopables.
I actually need to pluck the component out now. So then this becomes a lot easier, I think, because then I can say... And this should be a dev command, and I can say command restart.
And I think that'll do it. Um, no, I haven't used Fluent before. Boy,
I rarely ever know what that means. Dev command. Cannot use dev command as an array, but where?
Where, where, where? We haven't fixed the renderer yet. Okay, so if we come to prompt command selected tab, which needs to be renamed.
This is actually now component. I mean, it's close. We, uh, we dirked up the name somehow. Commands pluck name, I think.
Shh, get out of here. Get out of here. Oh, let's do the reload thing. So if I did... Shoot, come on. Get out of here. This is pretty good.
I kinda, I kinda dig this. Um, because a real one that I would add would be, um... A real one that I would add would be, um, if I did new dev command, name
is Reverb, command is, I think it's just Reverb. Do I have Reverb installed? Man, if I can get Joe to make this pretty, we
might, we might have something on our hands here. Um, s- Reverb start. I probably need to do, if this is gonna work at all. Shh.
Okay, so that command does work. So now if I did Reverb, oh goodness, PHP Artisan Reverb start, and I ran my dev command again. Reverb, and if I reload it, look at that.
Oof, that is some cold, nasty coffee. This is just-- I'm just tickled by this. I think this is awesome.
Um, so let's get rid of, shh, Horizon Next. See, the good thing about this is you can just, in your app service provider, you could set up your own just super easily by just literally doing this.
And then all your developers, then all your developers can just run app dev or, you know, whatever we end up calling it, um, all your teammates, and it'll just work, which is vv cool. Um, colors index. Oh, I see what he's doing. BG black. I want this white, BG black.
Hey, Thomas. Uh, we have r- the resident Notion expert in the house. Um, look at this. Look at that. It's freaking working. All right, so we're running a bunch of different, um, we're running a bunch of different commands concurrently, which is the name of the one in the JavaScript ecosystem, and we can change tabs.
And not only can we change tabs, we can restart a command. It'd be cool, um, it would be cool to potentially kill a command and be able to bring it back to life without having to exit the whole, the whole thing.
You know what I mean? And I think we can do that. Now that we're in a kind of a better spot, um, I think we can do that. I actually don't want this centered horizontally. What is this? That's the line So what does he do here?
Tabs implode. I don't want that centered horizontally, in fact. Each this line. Will that do it? Nope. Can't call each on a string.
Well, that is a very good point. So if I say this line, there we go. I do, I ke- I do kinda like it left-aligned, and also the space between. The space between's a little big, eh? I don't know why I became Canadian just then, but I think it's a little bit big. Um, feels a little tighter.
Honestly, I don't think we need that much space at all. I'm going for information density here. Um, so that's what I want. Ooh, two tabs next to each other? Friendo, I like the way you think. We may not get there today. I do like that, though. It would be nice to...
Like, I don't need to see Reverb, but I would like to see the queue and the logs kinda side by side. Um, in fact, let's just add the queue, just for giggles while we're here. So, let's add a new one called queue workers, and I think it's queue listen, which restarts itself.
Is that right? Uh, queue listen tries equals one. Ooh, I really should, um, I should display what the command is. That seems obvious. Um, so if I were to come up here, logs, JavaScript, random, Reverb, queue.
This, this is cool. We should tweet this. So let's, uh, let's take a little screenshot here. Actually, what, what are we gonna do? Let's do, um, Command-Shift. What is it? Four, space, screenshot of the whole thing.
Move over to JavaScript, Command-Shift four, space, screenshot of the whole thing. Then we go to Twitter. Um, we just check to see what everybody's up to. Cool, yeah. Cool, cool, cool. Sounds good, looks great. Um, hey, there's Tom Frank right there.
Tom Frankly. I think it's working. A GIF. Do I wanna do... I don't wanna record a GIF right now. We'll put the first one in and the second one in. It's not terribly pretty yet.
Hedging. Gotta hedge. Don't want people to say it's not pretty. I know it's not pretty. You know it's not pretty. Um, it's not terribly pretty yet, but we're running five, a bunch of processes at once in a single width, with a single command in a...
Yeah, that's fine. I just need @Joe... Not that one. He wouldn't know how to help me here. Uh, what's his real... Yeah, Joe Tenenbaum. I just need Joe Tenenbaum to help me make it look pretty. Emoji nail paint.
There we go. Cool. I dig. This is super-duper cool. Um, I don't see any reason why I shouldn't just package this up and release it as is.
Um, let's see. Not release it, but rather put it on GitHub. I'm not gonna go through the whole Composer, the whole Composer thing yet because I don't, it's not like, it's not good yet. Um, but what I was going to do, and see, this will be the test of the correct abstraction.
Let's do this. Um, ri-dit-dit-da-do, and we come down here, and we can say, um, on P, command pause. Is it pause? There's no such thing as pause, but we're gonna kill it. We're gonna kill it.
Um, I think somebody said it's a terminal user interface. I thought it was a text user interface. So, turns out I don't really know. Um, now we gotta come down here. See, this is weird to me. I don't know if I love that. I gotta come down here. Also don't like... I like sentence case better.
Um, pause process. Here's something. We can, we can do it thusly. Um, we need to have a little bit nicer way to do this. Uh, I'll show you in one second. Actually, let me just show you now.
It's super-duper cool. This. Look. Ah. We haven't gotten colors working yet. Um- But this-- also, it's a little too jumpy. This is what we're working on, and the interface is this. You just add a new command, queue, whatever your command is, and then you just run app dev.
Boom. Boom. It'd be cool if we could specify group when defining, so we could run a dev group name. That's interesting. Can you, Jordan, tell me why? All caps amazing. That's what I want. Um, okay.
So where were we? We were over here, and we were saying pause process, and then I said, "We need a better," and then I freaked out. So we need a better public function selected tab, which is not, you know, it's not tabs anymore. They're commands now, but that's fine. Carry on. Carry on. Um, uh, uh, uh.
Oh, this is not where I do that at all. Ah, ooh, ah. Maybe. Um, let's do prompt. In fact, let's do this. In the actual prompt itself, which is not that. Oh, it is that. Um, let us have a nice little public function current command, and this should return a
dev command, and that would be you. Not you. Come on. Copy/paste better. Is this your first time? All right. Return. Let's just rename it. Come on. Be brave. Um, selected command.
Now we're, we're getting a little bit of a naming collision here. That's fine. We'll fix this later. Current command is, um, mm-hmm. Um, okay, Jordan. Not crazy. All right.
All right. All right. You know what? You know what? You might have convinced me. You might have convinced me. Yeah, yeah, yeah, yeah, yeah, yeah, yeah, yeah. Yeah, this whole side-by-side thing we're gonna have to figure out, aren't we? That seems super cool. Um, but in the meantime, we have a little bit nicer interface, so we can do this, current command restart, which means we can get rid of that, which
means we can, uh... Will PhpStorm do it for me? Be a guy. Come on, be a guy. No. All right. That's fine. Uh, function short guy. There we go. So now, this is the real test of if your abstractions are right, is how's it feel to add a new thing?
Feels pretty good. So if I change this to P for pause, um, pause does not exist on the dev command yet. Uh, run public function pause.
Pause, I don't know. Pause is a lie. Um, if this process running, then this... I mean, frankly, it's, it's kill, which feels aggressive. Um, so we're just gonna signal it to stop.
Yeah, I mean, that's fine. Honestly, we just need, uh, this is kill. This is not pause. This is stop. Um, stop, stop renderer S for stop. Whoops. Wrong one. S for stop process.
It worked. Sig cont? Is that real? What in the world? I don't feel like enough commands are set up to be paused and resumed.
I just don't think that's a thing. Like, I feel like all these commands are set up to do infinite loops until they hear interrupt, and then they just, they bail out, like it's game over. That makes me nervous. Um, here's one thing that we can test, is I need to put out a line that says, like, process stopped. Um, but if I hit R for restart, it does.
It just totally restarts. So I can hit S to stop it. Um, yeah, this freaking rules, man. Um, so if I hit restart, it goes again. If I hit stop, it stops. I need to add, oh, ch-ch-ch-ch Pause could keep command
running but stop output. That's interesting. Is that useful? Yes, it is useful, especially when you get to the scroll. Yeah, I think y'all are right. Yeah, I think y'all are right.
Um, so let's do this. Um, we need to go in here. I need to add... I should really do this now. Um, what's the, um, array slice?
Offset and length. Can I go negative on the length? Stop that many elements from the end. I want the last 100 elements of an array. There we go. Offset negative 100. Um, this line's offset is negative 100, and I think that'll just do it.
That should just cut it. Ooh. Yeah, I think that's right. So in fact, let's... You're here, you're here, and you are here. Um, it's not.
I mean, it's-- what's 500 lines of text? Basically nothing. So did we dork anything up there? Not to our knowledge. Um. Cool. I dig. So let's move on and do this.
Let's shorten this down. We're getting a little wordy, IMO. So we don't need process, process, tab, tab. Restart. Stop. So here's what I wanna do now. Um, I, I basically wanna add a line.
Oh, I could do it from the outside. I could just freaking, just freaking do it from the outside. Stop. Um, so then this component lines equals, um, stopping process.
Um, restarting process. Actually... There it is.
I mean, it worked. So now if I hit R... Oh, it wasn't actually running, so that was a lie. So let's put that in here. Um. I just feel like how do I know when the process
is actually done? How about this? While this process running... S- is this a bad idea? Yeah,
I think I just locked it. I sure did. Why did that cause everything to break? 'Cause it sure did. Why did I... What's the, uh...
Hmm, good idea. Good idea, Josh. Good idea. Um, okay, it just really doesn't like that. What's my infinite loop? What's, what's going on here? S-s-s-s-s-s-s-s... Yeah. Why is my infinite loop no good?
Hey, Andy. I told everyone earlier that when you telegrammed me, which I haven't read yet, but I just saw the preview. Whenever I get telegrams, uh, while streaming, I always freak out 'cause I'm like, "What did I do wrong?" S-s-s-s-s-s-s... So why did this infinite loop infinite?
That doesn't seem right. While the process is running, I feel like maybe doing sleep is not... Uh, I feel like that's no good inside of this whole looping mechanism thing. Um, this is not important.
This doesn't matter. Doesn't matter Okay, so now if I hit stop, I still get a log entry after. Blegh.
Man, I don't love it. I want it to be right. If we tried this. Public... Oh, Izzy.
Public bool, uh, stopping equals false. OnTick. What if...
Boy, boy, boy, boy, boy, boy. Boy, boy, boy, boy. Um, okay. Stop. Then I would need to tell the component, this component... Let's just do it like this. Let's just do it like this. Um, we're gonna, we're gonna close up that interface just a little bit.
Not really, but just in theory. Public function stopping. Okay, so then I can put that here. This lines equals stopping process, and then I can flip this guy on. Um, stopping. Is this not right?
That's not right. Come on, Aaron, pull it together, man. Over here. Stopping, stopping. This line's stopping, stopping. True. Stopping. Um, yep, yep, yep. Then we can say on tick, if this stopping and this process is stopped one.
Running. It's only running? So if it is, if we've signaled that we're stopping and the process isn't running, then perhaps we can say, um, process stop. Is this important?
Not even a little bit. Um, that may still be backwards. Um, process stopped and flip it back off.
Hmm, do I love it? I don't know if I do. So I'm telling the component that we're stopping, and then I'm gonna stop... To add a little bit more over there.
Still didn't work. Hmm. What am I doing wrong, my dear friends? Um, I don't care. If this stopping and the process is not running, stop.
Joe was here earlier, and he offered to hop on, but I couldn't figure out how to do it. Um, so let's just do this first. If this stopping, then this lines equals stopping.
Misspelled. Stop. Stopping. Stopping. Um, stop.
So the process is still running. That's the problem. It didn't, it didn't actually stop the process. Maybe I need to do sig term. Yeah, I know.
Stop. So why is the process still running? That's interesting. Why is the process still running? Yeah, let's try that.
Maybe that's more, uh- That's more fail-safe. This is a little bit, uh, this is a-above my pay grade and below the area of the stack that I normally work, so we're in a real, we're in a real pickle here.
Stop. And we froze it all. Okay, so we just froze rendering. Boy, not totally sure what's happening.
See, it puts us, it puts us into that infinite loop, which I think is mucking about with the, um... I think that's blocking, I think that's blocking the, uh, the render loop. Man. Yeah,
it's blocking the render loop when we do stop, whereas SIGTERM just, like, fires the signal and then quits. This is interesting. Restarting still works. Stopping works, it's just, like, it blocks the whole render loop until it's done, and then it flushes it out.
So, that's interesting. Yeah, it honestly, it doesn't do very much. What is signal 15?
Yeah, they're sending term to it. Maybe, maybe it just takes a really long time for it to stop. Um, yeah, so what if I did this? Uh, signal SIGTERM, and then I came over
here. It might be working just fine. It might just be taking a long time. God, where are you going, Aaron? What are you doing? So, let's try this.
And then I hit stop. Is it honestly still running? Why is it taking so long to stop? Isn't SIGTERM like, uh, Control C?
Doesn't that, like... I guess that's SIGINT or something. Is it still running? Oh, they're all still running. We're not actually stopping anything. Those commands are not being stopped.
I wonder if it's just Pale. It is just Pale. What? It is just Pale. Oh, okay. SIGKILL. So Pale is unkillable.
Maybe it's unkillable. Um, so if I ran clear php artisan Pale, Control C to exit. Feels like it's listening. Is Control C, um... You know what? We have vendor/laravel/laravel/pale.
This should be a signalable command. Oh, it's not signalable. It doesn't listen to signals at all. That's odd, isn't it? Ensure PCNTL is available, though. Trap SIGINT and SIGTERM.
So it just eats those signals. I don't understand, um- I don't think I understand what's happening here. Um, okay, so this is the Pale command.
Render using this output, whatever. Tailing applications, Control-C to exit, whatever. More details, whatever. Traps the signals and destroys the file when it stops. Run. Process factory run. TTY false, which we've already gone over.
I don't know what that means. Yeah, there's no way to stop this based on the signal. I wonder... All right, let's just try this. What if we send, um, sig kill?
Um. I've got like a million Pale things running. Um, so if I did AR app dev, and I hit stop... Okay, you have to kill.
That's stupid. Isn't kill, like, pretty brutal? And term is like, gracefully shut down, please? I guess I have to, like...
Here's what we're gonna do. We're gonna run a sig term, which is like, please die. Um, this is what we need to do. Um, we need to do this stop, 'cause we're, we've already, uh, we're already doing all the work here.
Oh, goodness me Oh my. Um, and I cannot enter an infinite loop. I gotta kill all those Pale processes. How do I do that? Um, PS.
I mean, how do I kill all of these? Is that... Are those all the, the PIDs? That's funny. That is very surprising.
I wonder why Nuno did that. Pkill Pale. That seems nice. Um, what does pkill do? Pgrep. Is pgrep a thing that I have?
PSEF grep Pale. Jeez. Man pkill. Blah. Um.
Pgrep Pale no. Pgrep Pale no quotes. Nothing. I think that, Mohammed, I think that's what I'm gonna do. And Mior, I think you're right. Oh, these are, these are all tail commands.
If I just run pkill Pale, is that gonna, is that gonna, like... Am I gonna delete everything? What if I do that? Yeah, Josh, tell me, is this, is this allowed? I'm trusting you. Can I just run pkill Pale? Pale command line 86. Yeah.
Okay. Well, that didn't work. Pgrep tail? Ah, tail's the one I need to kill. So can I do pkill tail?
How's that feel? We're gonna YOLO. There we go. All right. So we've discovered something interesting about Pale, which I don't love, if I'm being honest.
I don't love this. Um, what is Dax saying? What's happening? Oh, that's neat. I'll have to look at that. Oh, goodness. Oh, he's doing side tabs.
Perhaps I need to do side tabs. That's interesting. Hmm. Do we like side tabs versus top tabs? I don't know, Dax.
What does, what does any of this mean? What does, what does any of that mean? Child processes that are more complex, or is it proc- oh, I don't understand. Yeah, I agree. This is cool. Oh, look at that.
That's cool. An actual Shia LaBeouf there. This is a good video. Who did this? Why did they do this? This is cool. Um, okay. I think we're gonna stay with top tabs. I'll have... Like, like usual, I have no idea what Dax was talking about. Um, I'm sure it's very smart, but I do not understand it.
So what we need to do, goodness, is we need to enter into this event loop and somehow force kill. Stooping? Um... Ah. Ooh.
Eeh. Um, so we have the ticks down here, and this is what I would need to take advantage of so that I don't dork up the renderer life cycle. Um, what do I pass into here? Just the invoked process.
Dang, I feel like... Dang. Oh, guys. Sorry, friends. Um, I think what I wanna do is, like, hey, Adrian, I wanna, like, phone home and say this command tick.
Uh, we might as well make it match. On tick. Honestly, should I do that on every... So basically what I'm trying to say is this becomes my infinite loop. Um, this becomes my looping function, and I can't use, I can't use an infinite loop, uh, anywhere else 'cause that blocks the whole render life cycle,
which is Bad News Bears, which is why we got locked up. But what I need to do is I need to, over here, in stop, after a while, I need to run sig kill. So protected function, um, force kill.
This, I can just yoink that. Sig kill. Really don't like that Pale locks up like that. That's weird. Um, okay. Force kill. What are you complaining about? Yes, I do not care. Um, so then...
I think I need to do something a little bit wonky like this. Um, so I'm gonna do, uh, let's say public function on tick. Um, if we're just co- we're doing wishful thinking. If this.stopping, if not this.stopping, doesn't matter. If which is not set, um, uh, ugh.
Fine. Protected bool stopping equals false. I feel like that's gonna end up being public. Um, actually, we can just expose it this way. Public. Bear with me. Hang on. Public. It's all in my head. I can't look at chat.
It's all in my head. Return this, uh, stopping stop. Then I don't think I'm gonna tell you that we're stopping. Um, I think what I'm gonna do is I'm gonna say this stopping equals true. Um, in fact, I need to do that out here.
I don't think I'm gonna warn you about it, which means I'm gonna come over here. Ah. Uh, nope, nope, nope, and nope, nope, nope, nope. You're dead. Nope. I think you're dead too. I think you're dead. So then this, um, this stopping
trying stop initiated at equals now. Um, now. No, no, no. Microtime. What does microtime give you? Microtime.
What is that funkiness? That's better. So that gives me a float. Okay. Stop initiated at protected, uh, float. Is that null? How do you do that?
Is it that s- uh, stop initiated at equals null. Is that legit? Question mark float. That seems legit. Stop initiated at now. Um, if somebody does it twice, I actually don't want it to reset. Uh, stop initiated at or microtime if true.
Stopping equals true on tick if it's not stopping. Okay, so now, um, let's do, uh... Honestly, I don't need microtime. Uh, I just need seconds.
Yeah, that's fine. Um, actually, F that. Just, I'm gonna be a super normie, turbo normie, and we're gonna say... I'm just gonna do carbon. Okay, so stop initiated now on tick. If we're not trying to stop, return.
Um, in fact, if we're not trying to stop or this, uh, process running, then we can bail out. Otherwise, if this stop initiated is earlier...
Boy, this always messes me up. Um, so if we initiated a stop five seconds ago, so now, um, now sub, sub s- type it better, subseconds five.
Uh, then we're gonna just return. Otherwise, this process signal sigkill. What do we think about that? Oh, Adrian.
Adrian, Adrian, Adrian. Always, always good ideas. Always a little bit, makes me feel a little bit bad. Um, fine. Better? Sure, that seems fine, although I think copy sub...
No, I don't like that. In fact, I don't. Oh, is past. That seems cool.
Yeah, that seems cool. Oh, boy. PHP Storm choked on that one. Um, okay. So if we're not stopping or it's not running, then we don't care. If stop initiated at plus five seconds is in the past, um, yeah, I'm just gonna keep going.
Sorry, Adrian. Um, then we need to kill it. Force kill. Um, actually, we need to do, um, if this stopping and
this process running, if we're stopping and the process is not running, then this stopping, we've already stopped. So now all we need to do is somehow call on tick from over there.
And so what I think, I'm just wondering if we should do it like this. And I don't know exactly what this is gonna look like. Um, it's just absolutely impossible for there to be, um,
a process at this point, so I, I just, I just don't need that at all. Um, and I can just make this public def command I think... I, I just think I don't need this anymore.
Because over here in dev command, that reference is updated, so I don't think I need this process. Um, stop. Yeah. Where's restart? Restart.
So then this process, and then I just don't think I need... Because then over here, it's not this process, but rather it's this, um, command process. I think that just became a lot simpler. In fact, I don't think I need you, and I think I don't need you.
And I'm gonna phone home and call onTick back there. I think this is gonna work. Boy, that just got a lot simpler, isn't it? 500's fine. Uh. So if I phone home, and I learn that I'm trying to stop but
I'm not running, then in fact I have stopped, so it doesn't matter. Um. So then if I'm not trying to stop, or the process isn't running, then I don't care.
Cool. Um, if the stopInitiated plus five seconds is in the past... No, that's wrong. Is in the future. If the stopInitiated plus five seconds is in the future, it's not time to kill yet.
Um. Oh, boy. Sheesh. Sheesh, sheesh, sheesh, sheesh, sheesh, sheesh, sheesh, sheesh. Um, me oh my. This actually needs to be, um, this actually needs to be, um, after the process has successfully been stopped, only then
start a new one. Mm. Um, almost. We're about to try it. So we're just gonna... Yeah, we're just gonna try this. Um, so this...
Actually, let's come back over here. If this command is stopping, this lines equals, um, stopping. This, excuse me, command process running.
All right. Let us just stop, and then I should kill it here in a second. I don't think I killed it.
Yeah, it's still running. Am I happy doing livestreams, as in do you think it helps your business? Those are different questions. Um, I don't think it killed it. Um, I am happy doing livestreams, and I do think it helps the business, but I think those are different questions.
Um, we're just gonna, we're just gonna... Boy, we got some tightly coupled stuff here, don't we? We're just gonna write directly to the logs. Um. Yes.
Correct. So in theory... Boy, it sure just would be nice if Pale just respected the quit, you know? Um, so if I did stop. Is future false?
So it did flip to false. Um, so did we send sigkill? That's the real question.
How do you get the, the ID? There we go. Um, give me one second. So pkill tail. I'm gonna kill all those guys. So if I hit stop, future, future, future.
Oh, it did stop. Man, it just doesn't clean up the tail underneath. Pale. I think I'm gonna, I think I'm gonna kill Pale, to be honest with you.
Um, I'm also live streaming. Not sure whether it's the most efficient use of my time. Oh, hey, Peter Oelrich. I didn't realize that was you. Efficient as in, um, I don't know. That is a good question. Steve and I talked a lot yesterday about, like, top-of-funnel activities, revenue-generating activities, explore, exploit.
Like... Like, if I were to sit down right now and record a course on Redis or something, it would be more profitable. Um, I think I am just gonna tail myself. It would be more profitable for me to just create a new course. One, I don't wanna just do that all the time.
It feels tiring. Um, and two, there's some portion of, like, top-of-funnel activities that are, um, that are, like, really useful in marketing. Plus, it's fun. I do, I do really like it. Um, information the objectives.
I'm sorry, I don't understand the question. Um, okay, so we, what we have here, I think I'm gonna stop here 'cause I, I have to be at lunch in 10 minutes, and I didn't realize that. Um, so what we have done here, which I think is good, um, we have accounted for rogue processes, killing a process, um, at to-do clean up orphans.
Looking at you, Pale. Um, this is hideous. I hate reaching in there and doing that. Um, it's very fun for me. I do, I do really like live streaming. I don't know why Siri woke up for that. Um, so this, this feels a little bit better.
I think I'm gonna kill Pale 'cause I don't feel... I agree with Josh. I don't think it's doing anything for me. Um, yeah, exactly. I think we would... It just feels, I don't know, it just feels...
I don't know. Then I, then I just become Commerce guy, and I don't wanna be that, you know? Um, oh, I suppose I could.
What is that command? I think it's... There you go. This is also gonna be so much more compact. Um. I think it actually
stopped. I just don't think I have good-- I think I mucked up the logs a little bit. Um, so where would I find that? Um, if we just put this back.
Yeah, it's just fully stopped. Um, so I can do this. This command process running Yeah,
if just fully works. Yeah, it's a Pale thing. Bummer. Um. Tail. Tail works just fine with me. Um, okay.
I feel like we've gotten pretty dang far for, what has it been? Two hours and 40 minutes? Um, yeah. Somebody please go fix Pale. That was wonky, wasn't it? Um, I gotta be at lunch in five minutes, which means I'm already late. So, um, I will... Yep, yep, yep, yep, yep.
Agree, Peter. Um, I'm gonna wrap this up and publish it as a WIP. Please don't use it because as we've seen, it's still pretty wonky. But just to recap, I do feel like this is the interface that I want. This is the interface that I want. I don't wanna use concurrently.
I don't like concurrently. Um, don't you dare do that, Josh. All right, y'all, I gotta go to lunch, otherwise Matt is gonna be mad at me 'cause I'm super late. Um, theme I think is, like, Neo Light something. Um, Neo Light with some customizations.
That's the theme. Uh, yeah. If you like it, not the theme, the package. If you like the package, please respond on Twitter so everybody's like, "Oh, wow, that was really cool. I wonder what it is." And that, like, gets in their head. All right. I'm gonna go to lunch. Thanks for hanging out. This is super fun. Go tell Joe Tenenbaum he's a genius 'cause I stole everything from him.
And I-