Building prompts w/ Jess Archer

00:06.98
Chris Morrell
All right? Welcome back to overengineered the podcast where we asked the very important question. What's the absolute best way to do things we already have a perfectly acceptable solution for I am here today with Jess Archer and we're going to be talking ah about some. Ah, really really? ah, edge edge case details of building prompts and working in the terminal such as you want to say hi and maybe introduce yourself. Okay.

00:33.51
Jess Archer
Hey, everyone I'm Jess archer I work on the team at Laraville I've been involved in a few different projects but probably my most favorite one. My baby at Laravalle has been larabel prompts that was one that was kind of something I pushed for which was. Was kind of cool and Taylor kind of let me run with it I managed to convince him that you know terminals spending a lot of time on a terminal was cool. So yeah.

01:00.81
Chris Morrell
Um I I haven't I should have I really should have dug more into prompts before today into the internals I haven't I haven't dug into it real deep. Um I certainly have enjoyed the. Ah. The the results of your hard work and um, we've been talking a little bit about some of the some of the hardest parts about that. Um, where where this kind of conversation stemmed from I guess was I had Joe Tenenbaum on the show.

01:18.42
Jess Archer
Um.

01:31.51
Chris Morrell
And we were talking about his his kind of crazy two-y experiments. Um and I don't remember honestly if it was on the show or just when we were chatting he was just talking about how how horrible it is to have to work with all these antsy escape sequences. Um. When you're building these terminal Uis because basically every simple what should be simple operation turns into just like this horrible either. Ah keeping track of these escape codes or you know sort of this. Pulling them out with a regular expression then and popping them back in or you know just having to do all these gnarly maneuvers with them. Um, so.

02:14.24
Jess Archer
Yeah, it's pretty different from working on the web where you've kind of got a lot of these kind of nice apis that wrap around stuff so that you know you can throw a text input on a page and not even think about it. Um, and there's so much functionality that comes along with that that we kind of just get to take for granted like. Moving the cursor left and right to change where it is and then pressing delete versus backspace to delete the character in front or behind all these sorts of things that you get for free. You don't get for free when you're building something from scratch with like raw materials effectively right? like it's almost like building that part of the browser. From scratch and listening to key presses and things like that.

02:53.50
Chris Morrell
Right? And and then you also have to deal with like multi byte considerations. The difference between like ah the character length and the character Width Um, whether something is a printing.

02:59.83
Jess Archer
Yeah, so character lengthen width is really interesting like you've got multi byte where you might have a character that's a regular width but it takes up multiple bytes I think a lot of different languages use that a lot but multi width was kind of the one that. I kind of had to learn about the hard way where certain characters may be multi byte but also are like what they call full width where it really takes up like 2 columns in the terminal instead of like the one column that things would normally take up so like emojis and I think like a lot of like japanese um symbols. Ah, kind of like extra wide and all that matters when you're dealing with this like grid of columns and rows in a terminal and if you move the the cursor left or right and it's you know across one of these 2 character wide things. It needs to jump across the whole thing and not try and. Land summer in the middle which is not possible and when you deal with like text wrapping. It's like all that is becomes an extra consideration.

04:00.65
Chris Morrell
Yeah, um, how much of that did you have to like how much of that was were you prepared to deal with when you started and how much of that did you have to kind of like learn the hard way. You're like forty fifty sixty percent through an implementation then you realize. Oh no, this won't work at all because of ah you know the the width consideration or or some other weird side effect. Yeah.

04:25.26
Jess Archer
I Pretty much had to learn most of it the hard way. Um I've I'm kind of I I kind of live in the terminal mostly you know I'm all into Neo Vim all these sorts of things So I do all my text editing and in a terminal. So I kind of had some familiarity with escape sequences mostly for just.

04:33.28
Chris Morrell
Um.

04:44.74
Jess Archer
Changing the color and making things bold I've kind of used a little bit of that in some scripts I've done. Ah, but never to the sort of extent that I realized would be required for prompts and the thing that kind of the thing that kind of sparked it all was we had like the symphony. Um, console components that we were using and they're like they're really good. They get the job done and the text input in particular was seemed completely fine, but like the ones that really kind of were driving me to want to do something different was the select and multi select components.

05:04.54
Chris Morrell
Yeah, yeah.

05:22.11
Chris Morrell
Um.

05:22.30
Jess Archer
To do like a multi selection Symphony you've got to like type out and Comma separate the values and something I never really noticed or appreciated at the time was that in Symphony Everything you do happens on the very last line of the terminal.

05:33.50
Chris Morrell
Oh interesting.

05:34.85
Jess Archer
So There's no like kind of arrow Keys to move the cursor up to choose the multi-select items you're just typing on this very last line of the terminal and it turned out that was actually pretty Key. Ah for like there were some reasons they did that that I didn't appreciate at the time. But. I was looking at things like the view installer that's using node and I think like this package called like Turkl G Prompts and a thing a thing called clack and I was like man they've got really cool stuff over in node I Want to do that in php but I did not know what I was really getting myself into. Ah, so yeah, that was pretty fun.

06:13.57
Chris Morrell
Ah, yeah I mean I I've used I've used a bunch of those libraries on the Javascript side as well and and you know have always appreciated how easy they make or how they make really nice ui is pretty easy. Um. But I I never really thought about any of those really concerns either and it's it's like there's kind of 2 there's 10 kind of 2 classes of um, string manipulation on the terminal right? There's the stuff that you were talking about at first the the color and bold and like foreground background that stuff.

06:49.44
Jess Archer
Um, okay.

06:51.50
Chris Morrell
And that's that's really all I've ever dealt with I Imagine That's all that most people have ever dealt with. But then there's a whole other class of Escape Sequence. That's ah about ah moving the cursor and clearing the screen right? And that's the stuff that you had to get really deep into to make those more. Sophisticated interactions happen.

07:09.16
Jess Archer
Exactly yeah like the kind of the main thing I wanted to do at first was be able to just push the up and down arrow and have it like visually go up and down the screen over the selection itself so that I could then.

07:21.20
Chris Morrell
And.

07:24.20
Jess Archer
Just push enter to choose the one I wanted or if it was a multi-select kind of do that thing. We just push space bar to like tick and untick the various options I wanted it to feel like like the web right? like kind of like what we used to having um, but. There's kind of like this whole aspect where the the way prompts work. It effectively goes into like a while loop where it's just waiting for key presses and that was kind of fine but like by default when you listen for input. It's going to output it to the screen as you're typing and so if you want to output it. Yourself somewhere else like on the line above or something like you imagine with prompts we've kind of got these like boxes around the stuff. So anytime you're typing. It's never on that bottom line where the terminal would normally want to output your key presses. It's kind of like a few lines up and. And so there's all sorts of things we had to do to like stop the terminal from outputting what it wanted to output and being able to listen for things like control c so that we could actually handle that in the way we wanted to handle it and long story short. That's kind of the reason why prompts at the moment doesn't support like native windows without wsl because. Some limitations in php with windows on how you can tell it I don't want you to output these things and I need to get everything you press so by default with Php when you listen for key presses. It's not actually going to get into php until you push enter. But.

08:38.91
Chris Morrell
Ok.

08:48.66
Chris Morrell
Oh interesting.

08:51.91
Jess Archer
We need to actually get each key press at the moment it happens and that involves calling out to a thing called STtY where it basically tells your terminal how to behave and that doesn't exist on windows. It's technically possible. Someone did a proof of concept where they wrote like a c extension for ph p on windows.

08:53.88
Chris Morrell
Right.

09:02.99
Chris Morrell
Interesting.

09:10.29
Jess Archer
And we're able to do it but it hasn't made its way into ph p itself yet. But I'm hoping it will. So yeah, there's those 2 aspects there's listening for those key prices exactly when they happen and not outputting anything to the screen like not having the terminal. Do it so that we can control where it is and that's where then these other escape sequences other than color come into place. Which is things like manipulating the cursor position because effectively anytime you want to output something the terminal is going to output it wherever the cursor is currently positioned so where that little flashing thing normally is and normally that's at the bottom so we have to kind of control. No go up 2 lines and then go into columns. Because that's where like the text input is starting and then output the words we want to see and another kind of side effect of that was we had to disable the terminal's own built-in flashing cursor that it normally has and put in a ah fake 1.

10:01.52
Chris Morrell
Right.

10:06.61
Jess Archer
So when you are typing in prompts and you see that little square Cursor That's not actually the terminal's cursor that is a space character that's had its background inverted to be the opposite background color of what the terminal is so it's a virtual cursor effectively? um, but all those things factor into the widths of stuff and where should that be and if you get to the end of the text input.

10:18.00
Chris Morrell
So.

10:26.39
Jess Archer
Where is that um the other kind of part around like the cursor manipulation is then erasing stuff that's already on the screen. So again, if you've kind of just built like a a command in Laraval you kind of used to just outputting stuff to the screen you can put in a new line when you want to go to the the next line. But when you want to actually go know that thing that it's now been typed. The person's pressed backspace so I need to like go and remove that then there's a whole set of anci escape sequences that let you delete things that are on the screen. Um, you can move the cursor back and then anything you output will go on top of what was already there. But. If the thing they typed was long and then the new thing that they've typed is now short and you only overwrite the parts that have changed the old stuff will still be there so you kind of need to consciously like erase bits of the screen and put the new things on there and the way it works in Prompts is it almost feels like ah like a render cycle in something like view or react.

11:20.70
Chris Morrell
So yeah, so.

11:21.46
Jess Archer
Where it like has this kind of frame and it has to like do re-renders So every time a key press happens the entire prompt gets like re-rendered it kind of moves the cursor up it raises everything downwards and then re-outputs the new state of of the prompt.

11:34.27
Chris Morrell
Yeah I was wondering about that that when I was talking with Joe about it we we made that react analogy and it it sounds like that's so there's kind of like there's 2 pieces right? There's like a state machine almost that's tracking the state of the you know it really it really does feel like a Javascript component right? You've got like.

11:46.70
Jess Archer
Are.

11:51.63
Jess Archer
Um, yeah.

11:54.37
Chris Morrell
Component with state and then you've got a render and the render is like a pure function that takes the current state and outputs Um, what should be displayed on the screen right? That's kind of the fundamental basis of all of these.

12:08.17
Jess Archer
Exactly So every key press that whole cycle is happening Thankfully terminals are now fast enough that you don't really see that like kind of flickering. Um, there are times where you can potentially see like a little tiny bit of flickering which is kind of common in a lot of terminal applications.

12:15.34
Chris Morrell
Yes.

12:22.57
Chris Morrell
So.

12:24.60
Jess Archer
If your computer is under a lot of load. There might be that small little glitch. But I think that's the general kind of approach for doing those sorts of things I'm not aware of any other ways of doing it.

12:34.36
Chris Morrell
Yeah, did you I mean have you considered doing like ah you know, almost like a diff ah and some sort of like I don't even know this this seems like it could be just absolutely horrible to try to implement but like. Some sort of diffing algorithm where you're like taking the the prior frame and the next frame and just comparing the 2 and then trying to some somehow like computationally figure out what's the the least number of sequences that's necessary to get to that second state.

12:50.38
Jess Archer
Um.

13:06.51
Jess Archer
Yes, definitely So the kind of up until very recently that's exactly how it worked it would have the previous frame and then the new frame and they were both kind of broken into an array of each line and.

13:08.46
Chris Morrell
That something you explored it all.

13:15.37
Chris Morrell
Okay, okay.

13:23.73
Jess Archer
If only 1 line had changed. It would be smart enough to just move the cursor to that line erase that line and put the new contents in there when multiple lines change. There's ah, there's a few ways of doing it one would be to go to each of those individual lines and erase the whole line and put the new line in.

13:29.39
Chris Morrell
Okay.

13:40.93
Jess Archer
But that ends up being quite a lot of operations. You're moving the cursor or raisings moving the cursor again or raising and'm like putting new things in so in that particular scenario. We just go to the first line that changed and rerender from that point downwards and that ends up being less.

13:53.94
Chris Morrell
Okay.

13:58.33
Jess Archer
Like operations less cursor moves and whatnot and ends up being ah like a less flickery experience I suppose you could say even though it's kind of doing a little bit more work because you might think oh maybe I can move the cursor.

14:12.50
Jess Archer
And not even just linewise but column wise and figure out exactly what has changed and try and be really specific about it. But then you're moving the cursor flashing it all over the screen to different points to try and like erase those things so that's kind of the way that worked um, but recently we actually kind of got rid of.

14:15.11
Chris Morrell
Ryan.

14:31.14
Jess Archer
All of that sort of stuff and we just erase the whole prompt and put the new one in there because there were some other limitations we had in terms of like 1 of the big problems with terminals is the height of the terminal once something goes outside of the region where you would have to scroll back to see it.

14:41.47
Chris Morrell
Right.

14:48.21
Jess Archer
You no longer have control over like manipulating that information and which gets really kind of tricky with some of the taller prompts like the multi-select normal low. So in all those cases we're always aware of how many columns wide and how many rows tall the terminal is and we can adjust the height of the prompts.

14:51.26
Chris Morrell
Okay, that's interesting.

15:07.24
Jess Archer
To a point but there is like a minimum height for each prompt to kind of display what it needs to and if that falls outside of the window. We just had to throw an exception of like we can't deal with this. The rendering gets all crazy and out of sync because it can only if the prompt is like 8 lines tall but the terminal is only 7 lines tall. It can't go up 8 lines.

15:08.59
Chris Morrell
Sure.

15:25.21
Chris Morrell
Right? right.

15:26.91
Jess Archer
And we were trying to go up 8 lines and then render down from there and then you end up with this weird out of sync kind of rendering that kind of gets crazy and so for the longest time we were like no, we'll just throw an exception make your terminal 8 lines tall and it's not that big of an ask at least so I thought but in Ides.

15:39.49
Chris Morrell
Sure.

15:45.32
Jess Archer
With terminal draws having a short terminal is actually not as uncommon as I kind of had initially kind of thought and if you make your font size bigger. That's less lines in the terminal. So even if the terminal is the same height in pixels Pixels don't matter with the terminal. It's how many lines of text if you increase your line height.

15:45.77
Chris Morrell
For that right? That's yeah, that's a good point.

16:04.86
Jess Archer
I Know a lot of us like to have like a super high line height. So there's ah a gap between each line that reduces the number of of lines or rows in the terminal which reduces what we can do So Our new approach is we are actually smart enough now to figure out how much of the terminal we can render or the prompt we can render and only render from that point downwards.

16:11.62
Chris Morrell
Sure.

16:24.34
Jess Archer
And we kind of ripped out the diffing stuff in the process of that because that introduced a whole layer of complexity and to be honest, we didn't actually find that we lost any perceivable kind of rendering performance by doing that but we gaind the ability to now render partial terminals where some of it is off screen if you scroll back.

16:41.13
Chris Morrell
Her.

16:43.92
Jess Archer
You won't necessarily see like you. It'll have the previous state. But if that was just like the blank line. We put between the terminal that's fine. Worst case scenario maybe the first line of the prompt has the yellow background has happened because of a validation error and if you scroll back up that part of the border won't be yellow like the rest of it. Um.

17:00.99
Chris Morrell
Um, sure that.

17:02.17
Jess Archer
But that was a better compromise than just throwing an exception because we didn't have enough height in the terminal to render and it gets really gnarly when like if you're building something with multiple prompts. The first prompt might be a text prompt only needs 5 lines but then the next one is a multi-select that needs 7 lines minimum. Ah, so we kind of had this global thing of like no if it's if it doesn't have like 8 lines. We're going to throw an exception even if you're only using text inputs that don't need that height. We didn't want to throw an exception partway through when they've already entered something in there. So it's like it was horrible but it's better now.

17:30.95
Chris Morrell
Right? right.

17:39.27
Chris Morrell
Um, that's an interesting. No no I mean I Love I Love or I I I don't know if love is the right word I I've certainly experienced ah that.

17:39.68
Jess Archer
And that was a long answer to the diffing question.

17:53.29
Chris Morrell
Where you spend a lot of time implementing something that ought to be ah like that's that's incredibly sophisticated and should be more performant because like you're really chasing performance and then it turns out just the like totally naive.

18:08.48
Jess Archer
Um, yeah.

18:11.77
Chris Morrell
Simple approach ends up being way faster for whatever reason. Um, maybe it's not maybe it's not faster in this case but I've I've certainly had that experience where it's just like I just spent 4 hours trying to make this perfect and it turns out that like just doing in a loop would have been just fine.

18:25.65
Jess Archer
Um.

18:31.14
Chris Morrell
Yeah, yeah.

18:31.16
Jess Archer
Yeah, so I I was looking at the at the source code of some of the javascript ones and kind of looking at how they were handling it to try and get some kind of inspiration for this and they were using the diff approach. Um, so it was like well that was kind of precedent that this is an important thing to do.

18:41.53
Chris Morrell
So. Sure yeah.

18:48.39
Jess Archer
Um, but it's not something you can easily listen to what I'm aware that you can measure the performance of it. It's really just like a gut test of can I see flicker. So it's kind of like the flickery test and that's going to be dependent on.

18:58.39
Chris Morrell
Right.

19:02.46
Jess Archer
The terminal and the processor speed a lot of terminals now are like using Gpu rendering. So I think like some of those things aren't as common anymore. Um, but if you like ss hd into somewhere and running these all those escape sequences are then going like over the wire as well. So having multiple operations stacked into that.

19:16.60
Chris Morrell
So.

19:21.31
Jess Archer
It's kind of more back and forth I Guess than um, than just kind of just nuking it and repaving the whole thing.

19:21.82
Chris Morrell
Ray.

19:27.33
Chris Morrell
Yeah, yeah, that makes sense huh Yeah, that's that's actually a really good point because there's like a lot of these sequences that you don't see that are still getting you know, sent somewhere.

19:38.66
Jess Archer
Exactly and it's kind of nicer that if there is some lag at least it consistently rerends the new frame all at once rather than you kind of getting like you kind of like seeing how the sausage is made if it was like jumping around and doing things. It's like yeah I'd rather it just be so slow like have like.

19:49.30
Chris Morrell
Right? right.

19:56.33
Jess Archer
You know, still less than a second or whatever. But when you push a key if on your really slow connection that it at least rerends in a nice consistent way.

20:05.70
Chris Morrell
Yeah I guess I think I think we did this on Joe's episode as well. But just real quick for anyone who's not familiar with ah the way Ansi works. Ah, essentially you know you've got your regular text output. Um, and then there are these escape sequences they start with ah a special escape um character and then some some code so a lot of times you'll see like slash e and then.

20:20.47
Jess Archer
Um.

20:34.82
Chris Morrell
Ah, like a bracket or something like that and that's that's when you know you're kind of like in the ansy world or you might see like Slash X you know like ah the the hex version of the this escapes synchist. Yeah um.

20:43.13
Jess Archer
That like hexadecimal representation versus yeah so I think in ph p the slash e is like a shorthand for the escape sequence code which I think is actually some hexadecimal like backslash x o something or other o 3 3 I think yeah.

20:59.50
Chris Morrell
It's like third yeah, yeah, yeah, um.

21:02.50
Jess Archer
And that's like the code point for Escape and the word escape becomes kind of um has multiple meanings when you dig into this world because you've got like the specific Escape character. But then if you're working with an escape sequence and you need to escape the escape sequence then that's like The. Alternative version of the word escape where you're trying to like tell it don't interpret this and so yeah, the word Escape starts to lose a bit of meaning at some point.

21:26.24
Chris Morrell
Um, yeah, what is what is how do you escape an escape sequence I've never even thought about that and.

21:34.11
Jess Archer
That is a good question I'm trying to think now I think there's another Oh its a really great question I can't remember the top of my head. Um, but I remember having to kind of deal with some of this sort of stuff.

21:44.53
Chris Morrell
Um, I don't even know yeah I don't even know when you would want that or when that would ever really come up.

21:51.44
Jess Archer
So I I had it when I was trying to build a Slideshow about prompts and about escape sequences and so.

22:01.84
Chris Morrell
Um, okay.

22:04.20
Jess Archer
At least inside a ph p string if you want to escape the escape sequence I think it's just another backslash in front of the backslash e so that the backs. So the second backslash is now escaped. Yeah and that's becoming now. It's it knows ah this is a literal.

22:09.67
Chris Morrell
Sure right? You're escaping the slash. Yeah.

22:20.13
Jess Archer
Backslash and then so then the the E that follows it is like a literal E it's don't interpret it as a backslash E to become an escape sequence.

22:22.63
Chris Morrell
Right? right? Yeah, that makes sense that would and that seems like that would be the only that would really be the only case where you need to think about something like this is if you're kind of trying to to show or talk about about.

22:41.48
Jess Archer
Exactly? Yeah yeah, but there is a lot of stuff where you still need to be very aware of those sequences so in terms of like calculating the width of something those escape sequences are invisible. They're effectively like 0 width.

22:41.61
Chris Morrell
Ah, how the sausage is made right? like yeah Ha um.

23:00.00
Jess Archer
Right? So we kind of talked about a regular character being one column emojis and things being 2 columns an escape sequence is effectively 0 columns. However, from php perspective if you've got a bunch of those inside a string. It's going to see the backslash e as having. 1 width and then the letters that follow it like the the square bracket that signals that it is an escape sequence and then the numbers that follow it that are saying be bold or be read or whatever it might be those all count towards the the string length. And the string width funnily enough. So even though you ph p has functions to determine the string width it's not aware that an ansy escape sequence shouldn't have any width because from its perspective. It's it's a more generic width as opposed to like what is the width from a terminals perspective.

23:35.68
Chris Morrell
Interesting.

23:46.85
Chris Morrell
Um, right right? Yeah, that's that's really interesting so that like the multi Byte Width function just just happily will tell you that that's part of the Width Ah, ah.

23:59.32
Jess Archer
Exactly 100% so it'll report a width that's watch much wider than will be so when we're calculating what the real width is. We've got to strip out all those escape sequences and then we had this other interesting thing where we wanted to support symphony's um, way of styling console.

24:08.31
Chris Morrell
So.

24:16.12
Jess Archer
Um, stuff we're using like an Xml style syntax where you can kind of use Xml style tags and say fg equals green and that like you you might have used that in symphony that gets converted into an escape sequence behind the scenes before it goes to the terminal. But if we've got someone that's.

24:22.14
Chris Morrell
So.

24:34.44
Jess Archer
You know, got to multi-select and some of the options they're passing in. They want to have some of the text bold or a different color room. We do this in the in Laraville for the vendor publish command where we have the multi-selective. What do you want to publish. We put the word tag or provider in front of the 2 different things you might want to be publishing and so we made those like a lighter gray to kind of.

24:53.77
Chris Morrell
Sure.

24:54.11
Jess Archer
Differentiate them from the actual thing and so we kind of have to strip out the Symphony tags and the escape sequences I don't remember if there's a reason why I didn't render it first to escape sequences so that then I only have to deal with escape sequences and not Symphony tags as well. Ah.

25:09.71
Chris Morrell
So I was just gonna ask that? yeah.

25:11.45
Jess Archer
But yeah, it just adds to the complexity of all the stuff you're trying to keep track of and keeping track of where the cursor position is is probably 1 of the biggest challenges because if you go across? yeah like the multi width character then it needs to kind of go well the cursor position has moved 2 columns but it's only 1 character in terms of the sense of if I press backspace. It has to delete a character so then the cursor position effectively moves back 2 positions then but in the length of the string. It may have might have only been one position and there's a so many times I kind of got bitten by confusing. Um.

25:34.35
Chris Morrell
Yeah, yeah.

25:41.72
Chris Morrell
Right? right.

25:49.70
Jess Archer
Length versus Width in terms of the string and it's not a case of it's always Width Sometimes it's length and sometimes it's with depending on what you're doing and these are all the things I did not know I was getting myself into when I started this project.

26:02.59
Chris Morrell
Um, this this has ah this really feels like 1 of those things where you know there's like that. Um I don't know that saying like a lot of times we we only take things on when we don't know that they can't be done right? like the number of things that you ah. Kind of people end up accomplishing because they they are like naive enough to not know that they that it shouldn't be possible like they end up succeeding right? and I I don't know I find myself I find myself falling down that hole a lot as I as I age just being like ah.

26:31.36
Jess Archer
Yep.

26:39.38
Chris Morrell
Not even going to take this on because I know how how awful it's going to be. Do you think you think? Ah, um, if you knew then what you know that now you would have ah have taken props on the way you did or do you think you would have been discouraged from the start.

26:44.31
Jess Archer
Yep.

26:57.10
Jess Archer
Ah I think I probably would have thought that it was too big for Taylor to agree to I still would have wanted to do it myself. But I was hoping to do it. You know as part of my day job right.

27:05.21
Chris Morrell
And.

27:11.72
Jess Archer
And so I had to kind of sell it to Taylor of like is it. Okay, if I spend this time working on this thing and I definitely didn't like I did a proof of concept very early on so that I had something to show to him to kind of give him a teaser of like what was possible and the problem I was trying to solve initially the thing that I thought was going to be hard and the.

27:11.75
Chris Morrell
Um, right.

27:26.30
Chris Morrell
Um, sure. Yeah.

27:30.50
Jess Archer
The the cool feature was just moving the arrow up and down so the first proof of concept was a ah select component where you could just move the arrow up and down and hit enter on the option you wanted because that was kind of something that we didn't have in symphony you can press the arrow keys with symphony but it just kind of changes. What's in the bottom line of the.

27:41.93
Chris Morrell
Yeah, yeah.

27:48.97
Jess Archer
The thing you've typed in so you can kind of use that a little bit that part doesn't work on windows for various reasons. Um, so yeah I guess I don't know I'm I'm so happy with where it got to and what we have now with that that I would not not do it again.

27:50.39
Chris Morrell
Nothing on him.

28:06.30
Jess Archer
Um, I feel like it were yeah it was just such a cool thing to have but I definitely was not prepared for the the cursor manipulation stuff that I didn't really include in my proof of concept because I kind of assume that part would be pretty straightforward.

28:06.98
Chris Morrell
It's sure.

28:19.69
Chris Morrell
Right? right.

28:21.61
Jess Archer
And that it was really just arrow Keys and re-rendering above the bottom line that was going to be the only challenge and that ended up turning out to be probably the easiest part of it.

28:31.15
Chris Morrell
Um, right? How long did it take all altogether. Do you remember.

28:36.54
Jess Archer
I it was kind of like an on on and off sort of thing so I was working on a few other sort of projects. So this was kind of my I wouldn't say it was like a 20% time type thing because I I definitely worked on a lot more than that. But I had some other things on ah and was also working on. Ah.

28:38.92
Chris Morrell
I sure.

28:54.25
Jess Archer
Love of a pulse around the same time as well. So I was kind of switching between the two and there was a good few the ops very really easy projects. Yeah, there was definitely probably a few months of solid work into it. Um, so I'm very very grateful that i.

28:56.60
Chris Morrell
In ah.

28:59.37
Chris Morrell
2 easy projects right? yeah.

29:08.35
Chris Morrell
So.

29:12.99
Jess Archer
Was given the sort of time and it was one of those things that because I was able to kind of keep showing progress and Taylor thought that was really cool because I think we're like you know all of us we love working on the terminal. It just feels like we're hacking into the matrix or something and kind of seeing the. The promise of what we could do with prompts just internally in laraville in terms of like the laraville installer making it much nicer for our install prompts to say you know do you want breeze? Do you want jetstream and then based on that do you want to use vue react all those sorts of things. It was goingnna be a huge win for us and then we figured it was also going to be something that the community would also love to use in their own stuff. But I honestly did not I wasn't prepared for how popular it was gonna be um, how many times I had to stop for applause during the announcement talk in in Nashville I did not I kind of expected there'd be the people.

29:56.41
Chris Morrell
So.

30:03.61
Chris Morrell
Ah, it was wild. No it was that was such that was such an exciting presentation just like because I mean it's so laravell the the like vibe of.

30:06.27
Jess Archer
To just be like I Ah, that's pretty cool. Um.

30:19.70
Jess Archer
Um.

30:21.74
Chris Morrell
And it's you know it's It's exactly kind of um, it it really fits in with the theme like yes we had something that was fine right? The existing Symphony stuff was okay, it was great I mean the synphi. The Symphony implementation is I remember you know coming to lairvell and and.

30:28.49
Jess Archer
Thank you.

30:40.84
Chris Morrell
Ah, that was my ah introduction to all the Symphony components as well and just going from I can't even remember what what little control I had over terminal input before that you know it was all mostly manual stuff.

30:45.62
Jess Archer
Um.

30:55.71
Jess Archer
Yeah.

30:59.80
Chris Morrell
And so to be able to just like throw you know bracket info. Whatever you know into um the the print line function on Symphony is like oh my God This is incredible right? Um, so you know it's not to say that that isn't that isn't really, ah.

31:10.66
Jess Archer
Exactly.

31:18.90
Chris Morrell
Wasn't really a ah big. Step forward for building terminal Uis in php. But there's there is like sort of this um, just appreciation for things that are better than average, right? and beautiful and prompts really like you know, really really.

31:32.37
Jess Archer
Um, yeah.

31:38.40
Chris Morrell
Lives up to that. It's It's like let's take this thing and make it as good as it possibly can be and that's I mean that's how it feels like to me I'm I'm really impressed. It's It's fantastic.

31:50.45
Jess Archer
Well thank you yet I think nu know had like just recently gone through an exercise of like restyling the symphony ones we had um and then also just the fact that Larry was a web framework so like the command line side of things is not. It's like bread and butter.

31:57.22
Chris Morrell
So.

32:06.73
Chris Morrell
I.

32:07.98
Jess Archer
Um, so it really just made me think that 1 tailor might not be excited about it and 2 the community wouldn't be that excited about it and but yeah, it turns out I was wrong on both accounts. Thankfully I I thought it was super cool I just didn't think everyone else would because. You know I'm super in the terminal with all the neo vim and all the the hassles I go through to stay in the terminal to do all text editing. Ah, but yeah, everyone else liked it a lot more than I expected exactly.

32:35.87
Chris Morrell
Yeah, well, we're all we're all nerds. We love this stuff right? It's like it's the perfect. It's the most ah the most nerdy of the nerd stuff that we get to work on is like yeah bring up the terminal and show some ah progress bars and and.

32:43.95
Jess Archer
The terminal for sure.

32:53.17
Chris Morrell
All sorts of crazy stuff in there.

32:54.98
Jess Archer
Yeah, and then like the first version of it I just made it look like um the node version because I was just kind of like trying to see what was possible and so the very first version looked exactly the same as like the view installer I kind of like mimicked the view installer. Um.

33:01.73
Chris Morrell
I.

33:09.65
Chris Morrell
Um, okay.

33:10.49
Jess Archer
But once that was kind of like cool and now I know what's possible. What the realm is am I I want to give it like a new style like a unique style for laravale so that it doesn't just feel like it was something that was just copied um and that kind of brings us into a whole other range of interesting characters in the terminal. Which are like these block drawing characters. So there's this whole range of of characters for drawing symbols and all sorts of things but 1 of them is these kind of line shapes where you've got like little corner pieces. Ah vertical straight pieces and then like horizontal straight pieces and there's some that have got like like.

33:31.33
Chris Morrell
Um.

33:38.26
Chris Morrell
So.

33:45.39
Jess Archer
Double lines different thicknesses and so then it was like cool up good these exactly. Yeah, there's like yeah with all the little dots and stuff so that it's not like completely solid.

33:47.31
Chris Morrell
Yeah, there's all sorts of different like sets of those right? there's There's almost like a gray scale one that's like ditherd and I think yeah yeah.

34:00.36
Jess Archer
And it was just almost like playing with Lego At that point right? because it was like these are all the pieces I've got to work with I Want to draw a box and draw that and then I think one of the like biggest moments where I kind of was just so excited about it was when I added a scroll bar So when you've got like the multi select and the single select.

34:03.46
Chris Morrell
Aha.

34:15.20
Chris Morrell
So.

34:20.17
Jess Archer
Instead of it just always like going like if you've got a hundred items that it would have to like somehow draw a hundred items on the screen which as we know now is not possible with terminals to go outside of the visible area. So it's like we need to be able to scroll what would a scroll bar look like on the terminal.

34:27.36
Chris Morrell
Right? so.

34:33.49
Chris Morrell
Yeah, yeah.

34:35.47
Jess Archer
And so I kind of use like a thin line for the main scroll bar but then there was a slightly thicker one I could use for the the thumb I think they call it on the scroll bar or the handle and then changing the colors of those as well. So that like it was this nice blue color for the active bit that really made it feel like the web.

34:41.71
Chris Morrell
Right? yeah.

34:52.48
Jess Archer
And I feel like that was probably the point in the in the talk where everyone kind of was really excited about it which was so cool to see because that was like internally when I shared a gif of that Everyone was like what.

35:05.70
Chris Morrell
Ah, ah it you know that's it yeah because even even the um like the javascript stuff. Maybe maybe some of them do but in general the you know the select option the multiselects. That I've played with it's you know it has like a window right? a windowing component where you can scroll up and down and you can scroll up to get to the bottom and scroll down but I don't think I had ever seen a scroll bar in yeah, but.

35:29.75
Jess Archer
Um, yes, yeah.

35:37.92
Jess Archer
Like a visual kind of indicator of where you are and even that was just a whole small exercise on its own because let's say the multi-select is like we can show 4 options at a time but there's like a hundred options.

35:43.19
Chris Morrell
Yeah, so.

35:53.92
Jess Archer
So there's only 4 positions where that scroll bar thumb can go so that one of the kind of things I wanted to make sure was that the scroll bar thumb was never in the top position unless you were on the first item and it was never in the bottom position unless you were on the last item.

35:55.69
Chris Morrell
So.

36:06.19
Chris Morrell
Okay, okay.

36:11.16
Jess Archer
So there's this like kind of complicated thing where it's like figuring out where to draw it and so it basically says well if I'm not on the first one or not on the last I'm excluding those on a 4 line one. There's only 2 positions then where it can be and then figuring out. Well I'm in the first half of those so it's going to be in the.

36:23.44
Chris Morrell
Sure that.

36:28.71
Jess Archer
And that position versus I'm in the next half that's got to be in the next position whole lot of rounding and percentage calculations and all these crazy things that go but the whole experiment was it was particularly challenging because a lot of these things you don't know what it's going to be like until you can actually play with it like I could do a mock up.

36:43.64
Chris Morrell
I Absolutely yeah.

36:46.78
Jess Archer
And output what it might look like but until I can hit the arrow keys and watch it move and see what it felt like when I got to the bottom and then cycle background to the top. You don't know until you can actually play with it. The static kind of version of it doesn't do it justice.

36:58.97
Chris Morrell
Yeah, does I don't remember does the does the the handle length change in a relationship to um.

37:14.10
Jess Archer
Um, no, no, don't get me ideas. Um.

37:14.26
Chris Morrell
The the total height that you have now. Okay.

37:19.59
Chris Morrell
Ah, all right? Let's see here. It's may ninth. Let's see when that pr comes.

37:24.81
Jess Archer
Ah, and then like the same sort of problem happens with the vertical aspect on like a text input right? So like you're moving the cursor. But if you've typed something that's wider than the terminal. The cursor needs to kind of go to the end and then we have these little like the three dot ellipses to show that like.

37:36.12
Chris Morrell
So.

37:43.22
Jess Archer
Front of it has now been truncated. But then as you move the arrow back to the left. It has to kind of then go Oh well now I'm maybe truncating some of the start and the end of it so you've got to like reserve one character for that unless there is no trunc cancer and then we don't want to reserve that character. We want to kind of take it away.

37:50.99
Chris Morrell
Right? right. Right.

38:00.32
Jess Archer
And all the calculations to figure out like how much of the string to display something that I didn't end up putting in the time to completely make exactly perfect. But if you've used like a text area on the web and you type a whole lot of stuff when you move the cursor and go to like the left.

38:19.40
Chris Morrell
I.

38:19.26
Jess Archer
Like to go back. The string itself won't change what's truncated until the cursor gets to the first position and then the whole string will start to move along and then if you go back the other way this is really hard to explain and anyone listening to this is gonna have premie I don't think my hand gestures are even helping sell it. But. The idea is that you would I would think the way that I thought was that if I knew the cursor position then I would always know exactly how much of the string to cut off, but it actually kind of depends on the previous state of where you've come from or whether you've gone left or whether you've gone right.

38:47.20
Chris Morrell
Okay, right, right? Sure no that makes sense.

38:54.76
Jess Archer
So it's not a case of like given a cursor position always look like this and that's how it currently works and it feels nice enough when you move the cursor backwards but I would prefer it if the string didn't move until the cursor had reached the like other end before it then started scrolling.

39:07.10
Chris Morrell
Right? It took it I Okay I get what you're saying yeah it has to almost do with like the velocity of the cursor right is that a way to describe it right? It's It's like the direction where the curse is coming from determines How you're truncating this yeah that makes perfect sense to me.

39:13.66
Jess Archer
Kind of yeah yeah, yeah. Yeah, yeah, So it's not just a clean thing of like given this cursor position this text withdth. How should it look. It's like we'll know where is it kind of like where was the text and where has it kind of come from.

39:26.82
Chris Morrell
Um.

39:35.89
Chris Morrell
Right? right? right? right? yeah.

39:39.17
Jess Archer
And that's something you just get for free in the browser. Um that I Never really appreciated until I tried to build her from scratch.

39:48.14
Chris Morrell
It is I mean it's wild. How um how much we get for free like in terms of like Ux and accessibility with modern browsers that is very true. Um.

40:01.56
Jess Archer
Definitely.

40:04.57
Chris Morrell
But it also I mean it really speaks to just how much work it takes to get all those details right? You know and and the difference between um, good enough and and everything feeling perfect. You know it's the the gap between those 2 things is so wide. But.

40:10.50
Jess Archer
Yeah.

40:18.23
Jess Archer
Yes.

40:24.28
Chris Morrell
It can really be so so wonderful When do you get to the other end of it.

40:28.15
Jess Archer
Yeah, the the really hard one that I didn't tackle and Joe decided to tackle it instead thankfully was the the text area like the multiline because then you've got to deal with raping wrappings fair enough like you know you're dealing with width so it's you can figure it out but the cursor position.

40:40.78
Chris Morrell
Um.

40:47.66
Jess Archer
Especially when you're moving left and right versus up and down and when you're on a line that's like longer than the next line below it like where does the cursor end up when you go down. Everyone has a kind of expectation of where it will go based on how browsers have trained them with text areas but actually trying to implement that logic.

40:49.90
Chris Morrell
So.

40:54.78
Chris Morrell
Look right.

41:02.10
Chris Morrell
Right here.

41:06.22
Jess Archer
Gets ridiculously hard and I'm so thankful that Joe kind of I don't know that he knew what he was getting himself into. We had a lot of back and forth on like tweaking the behavior of it because again it was one of those things that you can kind of imagine how you think it should work but until you play with it in the terminal. And that doesn't feel right? That's not what I'm used to like when I move this when I push down I'm expecting the cursor to land here. Not there and for someone typing and they kind of just are doing stuff quickly. They're expecting it to happen and they're probably already starting to type their next letter because they expect it's going to do something and if it doesn't do that then.

41:23.38
Chris Morrell
So right.

41:35.16
Chris Morrell
Yeah, yeah.

41:40.93
Jess Archer
That's kind of gets janky right? So yeah, a lot of.

41:45.16
Chris Morrell
Yeah, no, did you it just occurred to me did you have to deal with um this is this is an area where I I cheat. Um and I just remapped my terminal so that it sends.

41:55.12
Jess Archer
Okay.

42:02.22
Chris Morrell
It sends the correct sequences but I just use the mac keyboard shortcuts. So I actually don't know what they are but like if I want to delete back an entire word right? like on ah on a mac that would be like option backspace right? I think that's right I don't know it's like 1 of those things where I can do it.

42:04.23
Jess Archer
Okay.

42:11.74
Jess Archer
Um.

42:17.10
Jess Archer
Um, yeah, um, yes.

42:20.27
Chris Morrell
With my hands but I don't know what keys I'm hitting and in the terminal I'm pretty sure that I term is just set up to send some sequence that is standard for delete back. 1 word. Is this something is this am I just making this up or did you have to deal with those. Yeah.

42:36.98
Jess Archer
No, no, you are. You're definitely on something with that. So on the terminal the like main interface you'll be using when you're kind of typing stuff. It's called read line and it has a ton of built in kind of shortcuts.

42:50.47
Chris Morrell
Um.

42:52.85
Jess Archer
I can never remember all of them but like I know the main ones of like go to the beginning and go to the end a lot of terminals will kind of map like the home and end keys to do those sorts of actions but they're on a second alias for I think like control a and control E maybe are the ones to go and then there's other ones to move backwards and forwards words and delete all that sort of stuff. So.

42:58.70
Chris Morrell
Um, right.

43:05.76
Chris Morrell
Okay, so.

43:12.77
Jess Archer
We didn't want to completely re-implement like all of the read line stuff so we kind of just chose the kind of expected ones and there are limitations as well. So like for the text area prompt. For example I really wanted to be able to have shift enter.

43:15.71
Chris Morrell
Yeah, yeah.

43:29.26
Jess Archer
Go to the next Li like can so a break and enter to submit it but the terminal doesn't like at least in Ph P There's no distinguishment between like there's no event when shift happens because that's not like something the terminal gets and then if you press shift combined with enter there's It's not a different.

43:31.62
Chris Morrell
But. Yeah,, there's no distinction. Yeah, right.

43:47.95
Jess Archer
Um, code that comes through there are other things where shift does change like obviously shift in the letter gives you a capital letter. Um, and there are some other things where you know obviously control plus something else. We don't get the control key has been pressed and now this other key has been pressed at control C we get through like a sequence.

43:53.51
Chris Morrell
Right.

44:02.97
Chris Morrell
Right? and.

44:06.84
Jess Archer
Or ah of like control C specifically has been pressed but there are limitations in what are available there So like alt Plus backspace would have to be something that I don't know if there's a specific like terminal representation of that sequence of events.

44:11.61
Chris Morrell
Right.

44:24.62
Jess Archer
But there probably is something in read line. That's similar that's control plus something and then it's up to a terminal to say all right I'm going to like listen for you to push this thing and then I'm going to secretly send the terminal compatible version of that. Um, but yeah, we didn't We didn't implement all of it. We did a lot of stuff to do with like moving up and down.

44:27.17
Chris Morrell
And.

44:34.74
Chris Morrell
Right.

44:44.47
Jess Archer
Um, there's like I can never remember exactly which control sequences are but I think like the emacs people know them because they I think Emacs uses a lot of read line related stuff and being a ven person I wanted you know H Jkl to go up and down in select boxes. So I built that in um, other people kind of contributed.

44:45.64
Chris Morrell
Um.

44:53.26
Chris Morrell
Okay, so.

45:01.32
Chris Morrell
Um, sure.

45:03.37
Jess Archer
More things so we have ah we have this whole class That's literally just a mapping of like friendly names to what different like key sequences we receive mean so like a delete versus a backspace versus like a left arrow a right arrow and some terminals send a different.

45:11.78
Chris Morrell
Okay, so.

45:20.36
Jess Archer
Sequence for left and right arrows and up and down arrows so we kind of have like 2 versions of that I think it stems from the difference between the up and down cursor keys versus the ones that are on the number pad if you've got like there's you know like a full size keyboard I think those actually technically send different um different characters through.

45:23.78
Chris Morrell
Ok.

45:31.74
Chris Morrell
Um, okay sure oh that's wild Shh right.

45:39.52
Jess Archer
But again it depends on the terminal. Some of them might go I'm just going to send the same one for all of them. So there's all these weird little differences and inconsistencies. So we just tried to support all the common ones we can and fix things as we as we needed to but we're also trying to make it feel like the web right? So we wanted like tab and shift tab and all those sorts of things to work thankfully shift tab.

45:50.74
Chris Morrell
Yeah.

45:59.26
Jess Archer
Was a thing. Um, so we have that and using like the space bar to select stuff. That's not really a terminal convention. That's a web convention but we wanted to kind of make it feel like the web.

46:01.25
Chris Morrell
Um.

46:08.42
Chris Morrell
Sure I mean I know for a fact, um I have ah a use. Um, ah ansible a lot for Deploys and um I could never remember all the the. Ansible Command So I I built like a little terminal interface and it's using one of those node packages and every single time I get to the I have like a screen that's like okay pick which um, which groups you want to.

46:46.22
Jess Archer
Um.

46:46.47
Chris Morrell
Run plays on and I hit spacebar to select a group and then I'm like no spacepower doesn't work in this I have to hit enter and ah, it's It's one of those things that you know I only have to do these deploys or the provisioning servers every so often. So. I Always lose that each time. So I I I run into it every single time I do a new provision. It's just like I hit spacebar and it doesn't work and then I and then I remember oh that's right, This is a place where the spacebar doesn't Work. So The fact that it does in Prompts is is so nice.

47:05.92
Jess Archer
Yeah.

47:17.24
Jess Archer
Yeah, exactly because that was like what I instinctively wanted to be able to press and I figured other people would too that even though it wasn't like a terminal convention. It was a web convention and we are a web framework So kind of bringing those things other likes.

47:25.72
Chris Morrell
Oh.

47:36.00
Jess Archer
Curious would probably argue that we're teaching people bad habits on the terminal and they should be using the the proper read line things but we want seem to feel user friendly, but also still work for those that are using the you know the quote unquote proper ways of doing things.

47:46.46
Chris Morrell
Um, right right? right? Find the best of both Worlds kind of yeah yeah, so ok I don't know I'm not sure how interesting this will will end up being as ah, ah as audio. But um, you know after that.

47:52.37
Jess Archer
Exactly yeah.

48:05.86
Chris Morrell
After that conversation with Joe I started tinkering around with this this little project that I called it ansy pants and we've been talking about it a little bit. Um I'm just going to I'm just going to outline the premise which is basically all of these issues that we have around ah differentiating between ansy escape sequences and. Character widths and character lengths and and ah dealing with word wrapping and and trimming strings and all that stuff within those contexts um, it felt to me when I listened to Joe talk about it I I was kind of like this feels like a place where if you just. Built you just wrote essentially like a ah parser for ah, antsy right Um and like tokenize all of that content into each character and the character has information about. Like what the state of that character is what's the background color. What's the foreground color. Um, you know all the different ah different properties that you can set for through those escape sequences. It felt like you could solve a lot of the hard problems. You could you know you could kind of make the hard problems. Easy.

49:19.80
Jess Archer
Yes.

49:20.99
Chris Morrell
By solving this 1 hard problem and um and I I built this little proof of concept and it's you know I'm still a little bit nervous about it because of the this the fact that now we're taking every single character and we're creating.

49:38.34
Chris Morrell
Potentially like 5 or 6 objects. You know to represent each character because each character becomes an object that has the information about the character in it and then it also contains ah an array or collection of all of the different properties that that object has on it. Um.

49:38.89
Jess Archer
Yeah.

49:57.83
Chris Morrell
But once you know once we get to that point. The cool thing is the the way it's implemented is you know with these escape sequences. You're basically just like telling the terminal from here on out render things this way. Um, so you might have like Abc and then an escape sequence that says red. And then Df and df will all be printed in red just from that one escape sequence. But if we take that out and basically just say okay Abc has no properties on it but d and e and f each have like a red flag set on them.

50:23.39
Jess Archer
Yep.

50:35.86
Jess Archer
It's almost like they inherit it from earlier in the string right.

50:36.31
Chris Morrell
Now The previous point. Yeah, yeah, yep, now we don't have to keep track of where those escape sequences are anymore because we know at each character Point. What? how it should render. Um, and so what I did was then I just. Reverse engineered it I just said okay given a sequence of characters that have different properties. What's the least number of escape sea sequences to inject back in. Um, you know to get it to print the way that you want um and it it.

51:10.42
Jess Archer
Um, yeah.

51:13.39
Chris Morrell
It's been like just sort of a fun experiment and I was just curious like you know at this point we've ah you know I I played around with um word Rap I played around with you know substrings. Um.

51:31.66
Chris Morrell
You know, the nice thing is like doing something like string ah width versus length or kind of understanding that where where characters are um in relationship to each other on different lines. Becomes kind of easy because each character whether it's at ah, 0 width or 2 width character um ends up being a single object in the array right? So you you know if I'm on the fourth character on the the first line and i.

51:58.69
Jess Archer
Yeah.

52:09.35
Chris Morrell
And I hit down like we can very easily figure out. What's the fourth character on the second line even if it's a two width character. Um, but I'm just curious like what what are these like primitive. What are the primitive operations that you ended up.

52:15.17
Jess Archer
Yeah.

52:28.22
Chris Morrell
Finding to be most difficult to to reason about I know that I know that Joe said that word rap is like the the boss the the final boss um or was.

52:39.13
Jess Archer
Word wrap is surprisingly very boss like even if you take the the cursor position out of consideration. Normally when you wrap something based on you know, like breaking at the end of like you don't want to break in the middle of a word. Um, you can have word rep functions that obviously just do hard cuts. There's the scenario where normally we don't want to break a word, but if you've got 1 word. That's the width of the full like is taking up the full width then you have to break that one but the other thing that kind of like adds on to all that is when we're rendering it in.

52:59.26
Chris Morrell
Right? right.

53:10.67
Chris Morrell
Yep.

53:16.84
Jess Archer
Prompts. We've got a border around the thing that's been wrapped and so to draw the border characters on the edge. We've then got to go and add in a bunch of space characters because like once you do the wrapping you've got this kind of like ragged edge right? Where like the not all lines are equal length. So then you've got to go and pad them all with spaces.

53:19.46
Chris Morrell
And.

53:35.15
Jess Archer
So that when we draw the the line character at the end of each line that those all line up and have the right amount of padding. You know we wanted to. We didn't want the characters to butt up against those So there's all these little things in there. That's like add this for padding all of prompts is offset from the edge of the terminal by one character as well.

53:51.44
Chris Morrell
But.

53:53.49
Jess Archer
And all these little things in isolation is like yeah, cool cool. But then when you kind of try and build up this thing that's like trying to do this all but also in a way where the code is not going to be completely horrible to come back to in you know, 3 days time. Even.

54:04.80
Chris Morrell
Right? right.

54:08.82
Jess Archer
And so having some of these kind of abstractions like that I can see like huge value in that because you can kind of have a bit more like declarative code because like the problem with a lot of this stream manipulated manipulation stuff. Is it ends up being very procedural a whole lot of like kind of temporary variables that are used multiple times.

54:27.10
Chris Morrell
Ah, ah.

54:27.68
Jess Archer
It just gets kind of really full on so those sorts of abstractions are great. Obviously as you said there is the performance cost of newing up. You know an object for every single unique character. Um I think for like you you kind of limited the amount of characters based on like the size of someone's terminal and I think in your case.

54:43.53
Chris Morrell
Right.

54:47.47
Jess Archer
Because you're not Necessari like with with antipantts you're not necessarily having to worry about what's in the renderable area. So someone could literally pass in like a million lines of text and it's fine that it scrolls off the screen because it's not trying to like rewrite over that part and so then you're potentially dealing with a lot of objects and memory issues. Um.

55:00.34
Chris Morrell
Right.

55:07.31
Jess Archer
But even just the exercise of writing a passer is incredibly fun and trying to build up like a little abstract syntax tree that represents it all and all that I've I've kind of done similar exercises. Ah, mostly to do with like trying to find where the closing parenthesis is.

55:15.91
Chris Morrell
Yeah, so.

55:25.83
Jess Archer
Because regular expressions can't actually do that very well. Ah, yeah, it's It's a very fun exercise but it also has a lot of practical benefits. Um, as with everything there's obviously the tradeoff of them of the memory usage and everything but I think.

55:27.79
Chris Morrell
Ah, yeah.

55:38.80
Chris Morrell
Um, right? Yeah, it seems to me I mean I I haven't done any benchmarking but it's you know it seems to me like it shouldn't be that big of a deal right? You're you're only showing so many characters on the screen and as long as as long as you're not keeping all this stuff in memory.

55:50.83
Jess Archer
Um, yeah.

55:56.79
Chris Morrell
It's It's fine, right? You're happy.

55:57.86
Jess Archer
Yeah, and that's ways of working around it like let's say you wanted to word wrap an entire book in the terminal and spit it out. Um doing that entire book having those individual objects you're going to lose all your memory but you can always break it down into smaller pieces.

56:09.18
Chris Morrell
Yes, right? yeah.

56:13.85
Jess Archer
And like chunk through it So there are ways around it if you are dealing with scrollback and being able to have that many characters if you're dealing with Prompts scrollback isn't really an issue. We're only dealing with what's fitting inside the window and so the memory of that's probably going to be pretty minimal.

56:28.85
Chris Morrell
Um, yeah, yeah I could see implementing some sort of like windowing function that just is like you know we're only keeping track of what's within these boundaries? Yeah, um.

56:36.31
Jess Archer
Of this little bit. Yeah, we do want to be careful with memory though because like if people are using these in their in their command line. Um applications I know those those tend to be where I use the most memory. Just doing stuff myself like I might be creating a database either that wants to seed you know millions and millions of records. So I'm kind of trying to build these up and chunk them and I need batch sizes and the bigger the batch size the faster the thing will run and if I've got a lot of memory taken up by just the tooling that's around all of that then that's you know.

56:51.44
Chris Morrell
And.

57:02.71
Chris Morrell
Yeah, yeah.

57:08.65
Jess Archer
Not amazing.

57:09.41
Chris Morrell
Yeah, yeah, that would be that would be a problem I think I think that the piece it's right now I'm using a lot of enums. Ah, which means that you know a lot of the objects are.

57:19.81
Jess Archer
Um.

57:24.38
Jess Archer
Yeah.

57:24.70
Chris Morrell
Are reused right? that each flag you know only has 1 instance in the application because it's just like the the foreground red flag only needs to exist once you can reuse that same object everywhere. Um, so I think I think that I think it's fine. Yeah, what? What are some of the other are there ah other sort of traditional string manipulation functions that you found to be just like surprisingly difficult to to get right.

57:57.38
Jess Archer
Ah I mean yeah, the the Width versus the length thing was probably like the the biggest hard pill to learn at at first. Um, a hard pill to swallow I Guess um.

58:09.19
Chris Morrell
Yeah, that is true.

58:11.86
Jess Archer
It was really anything to do with like horizontal or vertical scrolling just became the hardest to figure out like what you're displaying at this point in time where like the cursor is supposed to be and then relative to that. What am I supposed to be displaying on the screen. So there's like kind of all this state and all these extra calculations that need to happen.

58:28.14
Chris Morrell
Yeah, yeah.

58:30.56
Jess Archer
Only show the bits on the screen that you want because the the text area prompt that you're created for example, not only have you got to deal with all the word wrapping but there's also a height on that and so that scrolls internally within itself and with the normal text area. You give it all the text and it just like handles. What's not visible and what is visible.

58:42.46
Chris Morrell
Um, right.

58:49.31
Jess Archer
So We have the same thing with this one from the developers perspective they can chuck in whatever text they want but when we're rendering it. We don't like the terminal doesn't know about the the lines that are off the screen because we can't tell it all this this bit. Don't show this bit. This is you know in a text area. We have got to specifically say you're drawing these exact characters. And so we have to be very specific about what we tell it to draw and manage all of that state ourselves.

59:15.75
Chris Morrell
Right? Yeah I was you know it's funny I was just um I was just using the the text area for the first time. Um and I I was wondering I was trying to figure out now I have it up. Let me see so if I have 3 lines. Okay and I can move my cursor I see so moving the cursor basically just means you're essentially just changing the background color of the um.

59:46.64
Jess Archer
Yeah, so that's that's I guess another thing as well is if you're partway through some text so your cursor is over an existing word then the cursor is effectively just an inverted background color on the character you're on. But if you move the cursor to the very end of the string. So you're going to be typing something new.

59:49.61
Chris Morrell
The character that's like under focus.

01:00:02.27
Chris Morrell
Yep.

01:00:06.64
Jess Archer
Then the Cursor effectively then does take up its own Width Um, because it's effectively a space character that it's inverted but the space character shouldn't be in the final output string. It's just a kind of a rendering concern.

01:00:08.13
Chris Morrell
Right? right.

01:00:19.30
Chris Morrell
Um, yeah I mean there's so it is wild. There's just so many things because like if I'm at the end and I press the up arrow a couple times if I'm on the first line and I hit the up arrow again. It takes me to the beginning of the line right.

01:00:33.16
Jess Archer
Yeah, that's another thing that goes to the very end.

01:00:35.39
Chris Morrell
And if I'm on the last line and I hit the down arrow again. It takes me to the end of the last line. Yeah, all these little things that you just take for granted. Ah.

01:00:44.59
Jess Archer
Ah, hundred percent the the text area was I would say the big boss. Um, and that yeah once again Joe was the one that thankfully solved that I kind of I mostly just helped out with testing it and finding all the edge cases that would break it. Um.

01:00:58.78
Chris Morrell
Ah, oh this is yeah.

01:01:01.50
Jess Archer
And was I was generally pretty pretty specific about how I wanted it to feel um to basically feel exactly the same as a browser. So the way that the cursor moves and like you say if you go to the bottom line but your cursor happens to be somewhere in the middle of the line that extra down press then is end of that line and that's how.

01:01:07.47
Chris Morrell
Yeah, yeah.

01:01:19.14
Jess Archer
Text areas would and browsers work and people kind of implicitly know have expectations about how those things work and so we wanted to kind of honor that as best as possible with the limitations of the terminal.

01:01:29.49
Chris Morrell
Yeah, yeah, so I also see that it grows it grows if it can and then it starts to wrap. That's another interesting. Yeah.

01:01:36.96
Jess Archer
Yes, yes, so all the prompts are kind of. We've kind of set like a minimum I think 60 characters to draw the text area. But if the terminal is narrower than that it will draw them narrower.

01:01:46.63
Chris Morrell
Okay, so.

01:01:52.66
Jess Archer
But likewise if it's 60 is kind of its default. But you start typing a whole lot of stuff we'll expand the text area to the full width of the terminal before we start scrolling so we didn't want to like arbitrarily scroll and cut off something where we could display more of it. So there's there's kind of these minimum.

01:02:04.57
Chris Morrell
Right.

01:02:09.39
Jess Archer
There's ah, there's a minimum desired Width but it can go narrow based on the terminal and then there's a hard maximum which is the width of the terminal.

01:02:17.19
Chris Morrell
Right? So What are the you said um this sort of cursor velocity thing is is something that you're you're still thinking about a little bit are there any other sort of someday I'm going to I'm going to tackle this. This piece that still bugs me or are you and.

01:02:33.47
Jess Archer
So I mean windows support is probably the number 1 thing that I wish prompts had unfortunately, it's like mostly out of my hands because it's like a Php limitation and I am not a php you know source code.

01:02:40.87
Chris Morrell
Sure.

01:02:46.89
Chris Morrell
Right? so.

01:02:52.75
Jess Archer
See developer that understands a lot of it but someone else in the community. They did these proof of concept I was mentioning. There was a version that uses ah the like ffi extension for Ph P where you can kind of like dynamically load in see via Ph P but that needs to be compiled in.

01:03:04.51
Chris Morrell
Um, oh and that's is that that's available in command line by default right? because Ffi is not available in the web context right? but.

01:03:12.37
Jess Archer
Yes, yes on the web same with like the the pnctl stuff we use p and CtL for the the spinner component. That's a whole other topic. We could talk about as well because that one's quite fascinating in a ph p perspective.

01:03:19.36
Chris Morrell
So that is.

01:03:23.39
Chris Morrell
Okay.

01:03:31.10
Chris Morrell
Um, okay yet, let's let's hear it. What's ah, what's the what's the spinner doing.

01:03:32.34
Jess Archer
Um, okay, so okay, so like in Symphony We had the progress component the progress component would be a progress bar. You tell it how many steps you think it's going to have and then after each step you can kind of like iterate the progress bar.

01:03:38.53
Chris Morrell
So.

01:03:47.83
Chris Morrell
Yep, is it all the time.

01:03:48.00
Jess Archer
It obviously has to figure out like if you've got 10000 items but the scroll bars are only 100 characters wide. It has to kind of figure out how wide like what percentage of the bar to draw but the key thing with that is that it works when you're doing an operation in Php where you're doing lots of small actions.

01:03:54.55
Chris Morrell
Yeah, yeah.

01:04:03.15
Chris Morrell
And.

01:04:05.40
Jess Archer
And so the the execution in php can continue come like there's a there's a cycle that comes back where it can then draw the next bar with the spinner. It's something that's one in like spin is a for more when something is more an unknown timef frameme of how long it's going to take so we don't have like you know we know it's going to be a hundred steps. It's like.

01:04:12.33
Chris Morrell
Um, yeah.

01:04:18.36
Chris Morrell
For sure.

01:04:23.72
Jess Archer
Something that's in progress but php and it's like Singleth threadaded nature means that when we're executing someone's callback. That's taking a long time. Let's say it's downloading something php is busy now and so we can't say we'll draw the next frame of the spinner and the spinner renders constantly. It's just drawing.

01:04:27.25
Chris Morrell
Ray.

01:04:33.23
Chris Morrell
Right? right? You have no idea.

01:04:42.43
Jess Archer
Cycling between like 4 different frames or whatever it is to draw the kind of the spinning little progress indicator. So ph p is has 2 jobs to do effectively. It's whatever the user has told them to do inside the callback but also keep rendering this thing listen for control c key prices all that sort of stuff and so in the node ecosystem.

01:04:44.87
Chris Morrell
First.

01:04:57.20
Chris Morrell
Um, right right.

01:05:01.12
Jess Archer
Not so hard to do right? You've got a lot of async stuff built in that's easy ph p normally not. You know, not something that in ph p I find is a limitation but with this it was a limitation and so the solution to this though is to use forking and so this requires having the PNCtl

01:05:02.50
Chris Morrell
But right that just happens. Yeah, so.

01:05:11.37
Chris Morrell
Great. So. And.

01:05:20.91
Jess Archer
Um, extension installed in Php which is commonly enabled on cli never enabled in web environments as far as I know probably no point but that allows us that when we get the callback and we know what we've got a render we can then fork php into two separate processes one that's doing the users.

01:05:26.30
Chris Morrell
Sure. So.

01:05:38.20
Chris Morrell
Um.

01:05:38.42
Jess Archer
Callback and one that's just sitting there rendering and there's a parent and a child and so I can never remember which job we gave to which one but it was important I think the parent in this case had to be the one that's doing the rendering and the one that's listening for control C events.

01:05:52.61
Chris Morrell
Right? It needs access to the yeah the keyboard inputs I imagine right.

01:05:58.70
Jess Archer
Because the the parent can kill the child but the child can't kill the parent and that's like a dark sentence to say in an un for her governing context. But here we are so. Yeah, so it was kind of important on that so that it could always go in and have the P Id of the child the process Id so that it can go and kill it early if it needs to and there's a whole lot of cleanup that has to happen that we haven't kind of talked about right like with prompts in General. We've done all this. We've told the terminal don't draw anything on your own like when Keys are pressed.

01:06:15.55
Chris Morrell
Right? right.

01:06:29.82
Jess Archer
Events happen when you know as they're typed rather than on enter and all these bindings for like control C we want to enter we want to accept we want to process that ourselves because the thing that's really important is we need to go and reset the terminal back to how it was before we've hidden the cursor right to draw our own cursor.

01:06:42.92
Chris Morrell
Right? right.

01:06:47.64
Jess Archer
That doesn't automatically get cleaned up when the process exits. So if you don't do that you end up with a terminal that has no cursor when you type nothing happens and control C doesn't work right? like all these things are completely broken. So the amount of times I had to like close my terminal and start a new one because I had destroyed its internal kind of state.

01:07:05.23
Chris Morrell
Wait So are you are you listening to control C in a different. It's not listening to the signal. It's listening to something else.

01:07:06.95
Jess Archer
With no way to like fix it.

01:07:16.39
Jess Archer
It's it's listening to the signal but it's listening to that again via I I think that's is that part of pc and tl there's there's 2 different behaviors for control c so there's one that when we're just doing regular prompts.

01:07:26.11
Chris Morrell
Um, I think so yeah.

01:07:33.81
Jess Archer
Think we actually get a key press event for control c because we've told the terminal via this SttY command to not interrupt when it gets a control c but instead to actually pass that through to us but the control c that happens in the spinner works a little bit differently and I think that uses pcnc.

01:07:40.94
Chris Morrell
Okay, okay, okay.

01:07:52.20
Jess Archer
Pc Nctl Whatever it is ah to handle that one for different reasons that are currently eluding me. Um that were important at the time.

01:07:54.95
Chris Morrell
Um, okay.

01:08:02.14
Chris Morrell
Yeah, that's that's one of those things where ah I don't know I've I've worked on linux boxes for decades now and I I still like I know that sig int and sig interrupt.

01:08:16.92
Jess Archer
Sick Kill yeah or loathe I like to think of them as like the the level of Politeness it's like could you please exit. It's like.

01:08:19.14
Chris Morrell
Didn't sig term and sig kill they they all are different and have specific meetings but I could tell you which is which right I.

01:08:33.51
Jess Archer
No exit and the other one's like I'm killing you because you're not exiting and there's so many others as well. There's like ones to suspend and go into the background so many that we don't normally have to deal with an out day today. But there are that do exist.

01:08:35.18
Chris Morrell
And right, right right? Well and right.

01:08:48.80
Chris Morrell
Um, right like TrolZ I guess you could probably like hook into that. Yeah.

01:08:49.47
Jess Archer
Yeah, controls a the backgrounding one? Yeah, so that's like that's a signal as well, right? So there's like tons of signals and maybe unintuitively I think on linux the main command used to send signals is the kill command so that kill dash nine is like sig kill.

01:09:04.90
Chris Morrell
Right? right? um.

01:09:06.19
Jess Archer
But kill by itself I think is just a ah sig int like an interrupt one from memory. But there's some that especially reserved for like the user has pressed control C versus like something else has wanted it to quit like the the user has hit the X button on the terminal to close it.

01:09:20.82
Chris Morrell
Right.

01:09:23.36
Jess Archer
All kind of subtly different events that we kind of need to listen for in different ways for different reasons if they've closed their terminal. We don't need to clean it up if they press control C we need to turn the cursor back on and and re-enable all these extra features of the terminal that we kind of turned off. Um.

01:09:33.86
Chris Morrell
Right? Ha That's wild. It's um.

01:09:40.28
Jess Archer
Yeah, and then we couldn't use like the Ph P Shutdown handler because you can't unbind the shutdown handler you can add like new ones on there but it becomes a memory problem when you're running a whole bunch of different prompts one after the other that they've all got these handlers that then effectively a queued up.

01:09:55.63
Chris Morrell
Oh.

01:09:59.27
Jess Archer
You can make them no ops so that they are like oh I don't need to do anything but they're still registered there. So the best way for that was actually the Destruct property of the prompt class itself. So anytime that was being destructed that kind of fired in most of the scenarios that we needed it to and could kind of handle its own cleanup in a way that.

01:10:16.64
Chris Morrell
Um.

01:10:18.97
Jess Archer
Didn't um, live longer than the life. The the life of that particular prompt instance.

01:10:26.12
Chris Morrell
Did you look at having like some shared global um like cleanup function that then the prompts could kind of register themselves with.

01:10:33.24
Jess Archer
Yeah, there is we have all of that sort of stuff I mean all of the prompts other than spin all kind of share like a common way of doing all of that and spin is just kind of this special one because it it's dealing with the forking and that's what kind of manually re-implements.

01:10:43.32
Chris Morrell
Oh.

01:10:50.82
Jess Archer
Did some pieces of that for its own special Way. So it kind of implements its own render and and and everything um and then there is like State. We want to pass around between instances as well. Um, one of the actual other big challenges was. We wanted to have a blank line between every prompt sound sounds easy right? Well ah a blank line effectively means a new line after the last line of actual content and then another new line.

01:11:08.81
Chris Morrell
Okay, okay.

01:11:22.80
Jess Archer
That's on the the line to make that line blank and then putting your output there. So it's kind of like 2 new lines is effectively one blank line but we wanted that to work regardless of whether you are outputting um stuff from within laraville using like the the internal info helpers and all the other helpers.

01:11:29.44
Chris Morrell
Um.

01:11:41.25
Jess Archer
Um, you know when you run migrations and we do a prompt that's like sure you want to run this. We're in production and then it starts outputting log entries of like the migrations. It's run those like entries aren't part of prompts but the prompt at the start is part of prompts and they all need to space each other one blank line apart from each other because that's the.

01:11:48.42
Chris Morrell
So.

01:11:59.82
Jess Archer
The rule we thought we wanted and look it looks great was way harder than we expected. So we actually keep track of the new lines that were output by the previous output at all times but because that can happen.

01:12:01.25
Chris Morrell
Yeah.

01:12:10.75
Chris Morrell
Um, okay like any previous output.

01:12:15.38
Jess Archer
As long as it happens via the the Symphony output interface that's kind of responsible for outputting to the terminal. So we kind of have a modified version of that Symphony output interface where we keep track of the trailing new lines effectively from the previous thing.

01:12:20.20
Chris Morrell
Um, sure.

01:12:28.16
Chris Morrell
I Love this so much. But.

01:12:32.50
Jess Archer
So if someone does like ah just manually calls this right and puts no trailing new lines. We know then the previous output before our thing had no trailing new line so we need to put 2 But if they did a right line that automatically adds 1 trailing new line then we're like okay, we just need to add one before our stuff or there was already a blank line so we don't need to output.

01:12:38.41
Chris Morrell
Um.

01:12:40.64
Chris Morrell
So.

01:12:50.96
Jess Archer
And so we can have this output that's interleaved between stuff from Prompts stuff from laravell itself even just stuff from like Symphony and they'll all be consistently spaced because they're all kind of sharing this output buffer with that state of how many trailing new lines were between them.

01:12:52.43
Chris Morrell
Ah.

01:13:07.19
Jess Archer
But the trailing new lines don't matter within render cycles. They only matter like once the prompt has gone into its like complete state where it's like ready for the next prompt or the next output to display. It's funny when I talk about all this stuff. There's so many micro problems that were really hard to solve and I.

01:13:12.96
Chris Morrell
Right right? This is good.

01:13:21.98
Jess Archer
I am starting to feel like this would be too overwhelming to start again from scratch.

01:13:27.50
Chris Morrell
I love that so much though that is such a people I feel like I've I've had a bunch of of people roll their eyes at me over the number of times that I've like run some some totally throw away. Cli utility and been like okay, no now have to go back in and add 1 new line here and 1 new line here because I I feel I so wholly agree with that that like I hate when there's just like.

01:13:52.10
Jess Archer
Um, ah.

01:14:00.74
Chris Morrell
Even hate just when you run the command and the output starts immediately on the next line I'm like no there needs to be needs to have a little bit of breathing room. Yeah yeah, right? sure.

01:14:06.60
Jess Archer
What's some padding right? like you want to have a have some design influence on these things right within the limitations of the terminal right? like you can't do different font sizes or anything like that. But and your padding is measured in lines rather than pixels. So it's kind of a lot or none.

01:14:21.55
Chris Morrell
Right? right.

01:14:22.89
Jess Archer
There's not kind of like a middle ground of like half a line of padding. But yeah, it's stuff that kind of is important and I think previously Laravallle was tracking a boolean of whether or not there was a new line or not prior to like prompts. It was just like whether the previous thing had done a new line to know whether or not when we do the next new line that it.

01:14:33.93
Chris Morrell
Okay.

01:14:41.91
Jess Archer
Needs to actually output one so that it so the the next output is on a new line and doesn't like get tacked on to the previous one. So the change I had to make there was not just keep track of a boolean state of was there one or not it was how many were there 0 1 or 2 ah generally that.

01:14:44.85
Chris Morrell
Even great right.

01:14:53.73
Chris Morrell
Right? right.

01:14:58.39
Jess Archer
The options that ah that are common. Yeah, and it it kind of felt sometimes it felt a bit silly of like doing all this stuff just to make 1 line of space between every bit of like distinct output but those are like also the kind of the the small details that I think are also important and make something feel polished and like someone's cared about it and.

01:15:02.36
Chris Morrell
That's yeah.

01:15:18.80
Jess Archer
But love into it and that they should love it too.

01:15:19.14
Chris Morrell
Yeah I mean that's what that's why people were so excited to see it when you first announcedun it was was all those little details like you You couldn't necessarily articulate what they were at the time but you know they added up into something. They're really.

01:15:26.26
Jess Archer
Um, mean.

01:15:32.28
Jess Archer
Um, no.

01:15:35.59
Jess Archer
And especially because we did already have an existing system for dealing with this right? So like in order to justify a new thing existing it had to go above and Beyond and not just be like a different implementation just for the sake of it existing it had to actually.

01:15:36.13
Chris Morrell
Feels much better to to work with like.

01:15:52.48
Jess Archer
Kind of have purpose and some of that purpose was somewhat artistic and a lot of it was very practical and technical and I kind of like being able to combine those all of those concerns together and make something that kind of ticks all the boxes and it's something that I'm proud to you know, put my name behind and whatnot.

01:16:09.54
Chris Morrell
Um, do you? There was a moment I wish I paid closer attention to when this happened because I I remember for a long time I used to have to do this get output new line and at some point because you know the lairvell command. Sort of decorates a bunch of the symphony methods but it didn't necessarily expose all of them and for a long time. The new line function was not exposed inside of the Larel command method. Ah the command class. Um, and so I I know I I very distinctly remember there was a long time when when.

01:16:26.22
Jess Archer
Yes.

01:16:35.43
Jess Archer
Oh interesting. Okay, oh.

01:16:45.45
Chris Morrell
First I would just like print an empty line and then at some some point I saw dove because I was like there's got to be a better way to do this and I saw that the underlying you know, output class has a new line function and so peppered throughout our code. There's a bunch of like this get output new line calls.

01:16:49.10
Jess Archer
Yeah.

01:17:00.62
Jess Archer
New line. Yeah.

01:17:04.23
Chris Morrell
And then at some point some somebody I don't know I should look to see who who prded it to the framework but someone eventually added a new line call which all all it does is just call this get output new line or or maybe I don't know Maybe it's just a decorator or whatever. But.

01:17:06.64
Jess Archer
Yeah, definitely.

01:17:15.59
Jess Archer
Yeah, and like you can even just use echo right and go echo and then the backslash and or Ph P E O but the problem with that is that's always just going to go to stand that out and not necessarily via the buffer. Um, like via the Symphony buffer. So.

01:17:31.37
Chris Morrell
So right.

01:17:33.19
Jess Archer
You lose the ability to use all of Symphony's formatting tags but you also lose the ability for it to track What new lines have been there to help you with spacing and all that sort of stuff so there are kind of like I guess benefits of not just echoing everything even though sometimes when I'm lazy I just echo instead of using the built-in stuff. Um, at least for proof of concept phases.

01:17:39.58
Chris Morrell
So.

01:17:50.34
Chris Morrell
Um, sure.

01:17:52.83
Jess Archer
The the first version of prompts was literally just a single file php script that was full of echoes and event listeners and whatnot and that was just the to test it out.

01:18:02.45
Chris Morrell
Yeah,, that's awesome. Ah, well is there anything else is there anything else that you um, you know that you bumped into with working on this that that you think is particularly interesting I feel like we've we've touched on a lot of the the. Pieces that I'm aware of um but I don't know if there's anything else you have.

01:18:20.16
Jess Archer
I Think that's most of it there was there were some things that yeah that I'd kind of almost forgotten. But as we were talking about it I was like oh that's right, That was also a hard thing because there was just one after the other of kind of challenges and. It's one of those things you got to be aware of like you know sunk cost fallacy and whatnot of like I've put this much evidence into it and it's feeling really good and then it's like oh but now there's all these extra unknowns is it still worth pursuing. Um, and I've I've had other projects even at Laraval where I've kind of.

01:18:38.40
Chris Morrell
So.

01:18:50.79
Jess Archer
Put some time into it and then eventually it's like no, there's too many things that are making this no longer viable and not being like super precious about it and figuring out the payoff versus the cost and all that sort of stuff. But I think I've kind of covered all the ones with with prompts. Definitely a lot more than I expected. But.

01:18:56.64
Chris Morrell
Um.

01:19:08.74
Jess Archer
Very much glad that we put the effort in and hugely grateful for the community for all the other stuff they've added to it since as well. Um, especially Joe but there's been a whole whole range of other people. Um, someone contributed a search multi-select so we we added a whole bunch of extra prompts that were.

01:19:25.70
Chris Morrell
Um.

01:19:27.22
Jess Archer
Outside of stuff that Symphony had so the ability to kind of run a search query that would search the database and then you could go down and choose the options that's kind of subtly different from a regular multi-select where all of the options are available and you only have the arrow Keys the search select that that I built. Let you filter by typing and then choose the one but I didn't have a search multi-selectable or multi-search as I think we called it So someone else contributed that one in that one had a lot of edge cases as well because it is one with a lot of scrolling and spacebar actions and all those things and it's got vertical scrolling in the.

01:19:57.39
Chris Morrell
Right.

01:20:03.39
Jess Archer
Options. But then horizontal scrolling in the typing area and those little things like if I have moved my cursor if I push the down arrow I'm now like kind of focused in the list of options if I type a letter now does that take me back into the search field is that what I expect it to do.

01:20:04.63
Chris Morrell
Right.

01:20:13.64
Chris Morrell
And.

01:20:19.40
Chris Morrell
Right? Or does it jump to the item in the yeah.

01:20:20.93
Jess Archer
But yes I think it is or does it. Yeah, try and do that real? Yeah, not that would be cool but I figure it was already had a filtering thing built into it so it was like trying to build 2 in would be kind of wild. Um, but yeah, it's just great that other people kind of added those extra ones that I kind of felt that i.

01:20:31.80
Chris Morrell
Right.

01:20:40.30
Jess Archer
I'd kind of spent my my Goodwill on building the thing and had kind of got it to a point where it was really amazing but I could probably not justify becoming a full-time prompts developer forever um, working at a web framework. Um, and so it's really cool. Yeah, the community kind of came in and understood how it worked.

01:20:51.85
Chris Morrell
Um.

01:20:59.94
Jess Archer
And appreciated how it worked and then started building stuff on top of it and I know people have got their own prompts that are kind of too use case specific to go into the core library but we built it in such a way that you can extend um the prompts classes and kind of build your own. The other thing I didn't even touch on and haven't. Generally not kind of talked about much is that prompts is also completely themable so you can provide your own render classes and make it look However, you want it to look. It's it's a lot of effort to go to that step but it is technically possible. So I always like the idea of someone like Staic creating their own for their installer that was all kind of like.

01:21:23.19
Chris Morrell
Um, that's pretty cool.

01:21:35.90
Chris Morrell
Yes, oh that would be so cool. Yeah.

01:21:36.46
Jess Archer
The Pinks and the the cyan and all the like the rad colors. It's a shame You can't like rotate stuff because I know they love to like put like a little three degree rotate on things. That's not that's not possible but definitely using some of those kind of radical colors would be cool to see.

01:21:49.95
Chris Morrell
Right? it that it wouldn't you could you could do a really janky like ah 35 degree rotate is like your your first right? if you were just doing character by character across multiple lines like a jagged edge.

01:22:04.71
Jess Archer
Yes, yeah I mean there are in terms of those box drawing characters. There are some that are different angles so you could have the the vertical edge of the box actually have an ah what appears to be an angle to it.

01:22:07.65
Chris Morrell
Just like the padding.

01:22:11.91
Chris Morrell
So.

01:22:19.46
Chris Morrell
Yeah, right? You're not yeah, give it a little.

01:22:20.93
Jess Archer
But probably not on the like horizontal edge. But that might be enough to kind of sell the effect but even just trying to throw like some terminal applications have shadows built in but they're really just drawing a darker color on the row below of the same sort of color.

01:22:31.42
Chris Morrell
Yep yep yep.

01:22:37.58
Jess Archer
Neom has this really cool thing where it'll actually draw shadows on um on like popups and it will draw the characters underneath that are appearing under the shadow but just change the background color and the opacity of the color so that it appears that there's like a drop shadow on top of it That's still showing you what's underneath.

01:22:43.99
Chris Morrell
Um.

01:22:49.41
Chris Morrell
And and the foreground color. That's so cool. Ah.

01:22:56.27
Jess Archer
So so much so much logic has gone into that sort of stuff that I feel is like miles harder than anything I had to do with proms.

01:23:04.26
Chris Morrell
That is incredible. Yeah I mean when I was when I was just starting to explore the like um the the antsy parsing I started to go down the rabbit hole of like you know the the bit depth of like colors in.

01:23:20.93
Jess Archer
Um, oh yeah.

01:23:22.25
Chris Morrell
In the terminal because they have different um like different formats of escape sequence. Ah, and yeah, you can get like to full 24 bit like Rgb. Ah you know and that is really interesting to me too. So you could yeah you could.

01:23:28.67
Jess Archer
Um.

01:23:34.87
Jess Archer
Yep.

01:23:41.83
Chris Morrell
Really implement some sophisticated drop shadowing if you get that that deep into it.

01:23:46.00
Jess Archer
Yeah, there's all sorts of Algorithms right? for like if you if you have the color and can break it into its pieces. You can then apply darkening and lightning and all that sort of stuff to it Once you've got that and like you said terminals now can do you know true color or whatever they call it these days. Um.

01:23:51.97
Chris Morrell
Right? right.

01:24:01.93
Jess Archer
Originally obviously black and white then like 16 colors then two fifty six colors um I think that might still be a thing in some scenarios like maybe if you're on the terminal of a server some old school server that has like an old school terminal. There might still be color limitations but I think for. The world we're in where people are kind of developing larva applications on max and linux and all those are a modern terminal. We kind of can yeah leverage full colors but I was going to say for um I was going to say that.

01:24:31.47
Chris Morrell
Um, although I would say for the most part. Oh go ahead.

01:24:37.50
Jess Archer
For prompts we ended up sticking with the standard 16 colors and the thing that's kind of cool about that is it it effectively like obeys your terminal theme then because those 16 core colors are up to the terminal to decide like what they actually look like and and so you might see screenshots of prompts where like the the colors are slightly different based on.

01:24:39.74
Chris Morrell
And.

01:24:45.42
Chris Morrell
So. And.

01:24:57.60
Jess Archer
Someone's terminal configuration for better or worse. We could consider going and having a hard opinion about it. But even just making sure that like light mode versus dark mode works when you use the built in 16 colors. You don't even have to that's no even a concern of that that we have to worry about.

01:25:06.24
Chris Morrell
Right? right.

01:25:15.37
Jess Archer
Think if we had a stronger opinion on specific colors then all of a sudden then exactly? yeah so leveraging those means that it is kind of applies to anyone's terminal regardless of like how they've got it configured most other things that give you more colors.

01:25:18.22
Chris Morrell
Right? You'd have to own the entire process then.

01:25:30.26
Chris Morrell
Yeah, yeah, that's so all I was going to say so.

01:25:34.85
Jess Archer
Like like say like a nearo vim theme. It doesn't know if you're running a dark motor or a light mode terminal. You've got to like choose an appropriate theme for how you've got like your stuff set up. We don't want people to have to choose their theme for prompts to like look good. So it's like sticking with those core 16 character as 16 colors at.

01:25:41.78
Chris Morrell
So.

01:25:54.75
Jess Archer
Tends to help a lot and there's there's a fair bit of freedom in there like you've got dark and light versions of most colors you've got like ah a gray type color I think I think it's normally called like bright white versus white but Bright white is normally more gray than regular white. There's these weird kind of conventions that have happened over time. But.

01:25:58.75
Chris Morrell
And.

01:26:04.95
Chris Morrell
Yes, typically right.

01:26:13.78
Jess Archer
The point is is that yeah in terms of the color of like the text you type. We don't have to have an opinion on that because it's the default text color for the terminal so that'll be like a white or light gray if they're on a dark background or a black or a dark grey if they're on a light background and that's all automatic.

01:26:26.44
Chris Morrell
Great. yeah yeah I mean I I think I know that the terminal can that my terminal can print any color at this point right? But I I never really venture outside of those 16 Maybe.

01:26:37.81
Jess Archer
Um.

01:26:44.43
Chris Morrell
Maybe I've like played with some output that that is like in the two fifty six range but I don't I don't think it's very common or in in my experience. It hasn't been very common to really to do much more than that even though obviously it's. Totally possible now. Yeah.

01:27:03.65
Jess Archer
Yeah I I Definitely don't really use them for my own stuff. Um I think I might have like at some point experimenter with making the lar of a logo like the exact right color Um, because it's like a brand color I definitely get to experience true colors a lot because I'm using like true color themes in.

01:27:10.84
Chris Morrell
Oh yeah, that'd be cool. So.

01:27:20.12
Jess Archer
You know, tux and neovim and all of that and I really appreciate that I can have kind of some depth to my ui where a pop-up is a little bit lighter than what's behind it. That's not possible with the standard 16 There's not enough differentiation between those steps of colors like anyone that's played with like tailwinds color stepping imagine if there was only 16 tail when color classes. You'd.

01:27:25.75
Chris Morrell
Sure.

01:27:35.75
Chris Morrell
Um, sure right? that would be cool though you could because then you know if you render you render the layer of a logo in a black box For example, like.

01:27:40.16
Jess Archer
End up building some some. Ah yeah, everyone's Ui would look the same.

01:27:51.54
Jess Archer
Um, yeah, that would still should still work. Yeah.

01:27:51.97
Chris Morrell
Whether that's on black or white. It's still going to look look nice right? Like yeah I could see that that's interesting. Ah.

01:28:00.48
Jess Archer
I've tried to draw the Larava logo in the terminal and succeeded and I think people might have seen it in my ah in some of my talks where I have this like I'm actually using braille characters so braille symbols in the terminal are really handy because they're a grid of like 2 by 8 of dots and every single combination is covered so if you can represent a drawing in a grid of dots then you can kind of draw. It. The downside is is that it's very dependent on your terminals line height. So when I design them and I've got to learn a line height of like one hundred and sixty five percent I can make it look proportionately right.

01:28:21.79
Chris Morrell
Um, right.

01:28:36.62
Jess Archer
But chuck it in someone else's terminal and the logo will be really squished down and some terminals don't necessarily render or stretch the the Braille characters either to the full height If you've got like that they'll kind of have like gaps in between so you'll kind of see this kind of banding in between so that's why we never shipped. That logo to like the installer where it would need to work for everyone's thing but I did include it in like my slides where I had complete control over the terminal.

01:28:58.92
Chris Morrell
Um, right? sure. Yeah,, that's that is that is interesting that the line height. Yeah I Wonder why that because you know I you see ascii art in like. Command Line interfaces all the time.

01:29:15.89
Jess Archer
Yeah, they'll always be influenced by the lion height and will stretch or have gaps in between lines like that's just kind of something you've got to live with with larave's kind of like isometric box logo I didn't feel like having that squish too much in any way would be great.

01:29:22.34
Chris Morrell
Right.

01:29:33.19
Chris Morrell
Right? Yeah now I get it.

01:29:35.10
Jess Archer
So I kind of was like now it's not worth it. So We we still have the like the text art version of the laraville of of just the word larave and that one is a little bit more tolerant to being squished in different ways and still kind of looks okay, um. Maybe at some point I Also don't know what the support is for the the Braille code points in every single terminal font If you're using a certain font. It may not have those rendered. Um, So there's those kinds of limitations that's kind of similar to browser limitations in some ways where you're kind of dependent on the environment that it's running in.

01:29:54.13
Chris Morrell
Sure right.

01:30:06.42
Jess Archer
And not everything is completely in your control like it is on like the server side. Um, but yeah, things always get improved and all those sorts of things and although terminals have remained generally fairly consistent over the last I don't know forty fifty sixty something years. Whatever.

01:30:24.75
Chris Morrell
It is kind of wild you know other than um.

01:30:26.30
Jess Archer
Yeah there I mean that has been small changes here and there but they're still pretty much you know recognizable from their earlier states.

01:30:33.65
Chris Morrell
Right? Yeah, yeah, it feels like maybe with warp. That's the first that's the first new terminal that feels like sort of notably different to me.

01:30:38.88
Jess Archer
Yeah, true, yeah and having like dropdowns that actually are kind of breaking outside of the the terminal rendering of of like this is you know lines and columns. It's come like we can actually have small font sizes for things which do look nice right? like.

01:30:57.78
Chris Morrell
Um, they do indeed. But.

01:30:58.22
Jess Archer
It's nice to be able to like represent represent different things like a hierarchy of stuff using different font sizes whereas in the terminal at the moment. It's kind of color bold dim. That's all you've got to kind of give visual hierarchy to things.

01:31:08.28
Chris Morrell
Right? right now were you ah like an ascii artist at and at any point did you did you only dabble in making ah the Larry Bell logo

01:31:15.93
Jess Archer
Not like not anything too crafty but it has become a little bit of like a a fun little side thing I'd like to do sometimes So I've I've done a few friends logos I Kind of have really just. Done the whole Braille um symbol version of things and I kind of have this like thing in figma where I've got like the terminal kind of set up like I've got like all the dots set up so I can overlay the image set some opacity and figure out which dots should be visible and which dots shouldn't be but again, it's very dependent on the um.

01:31:35.72
Chris Morrell
First.

01:31:44.96
Chris Morrell
Oh that's fun.

01:31:54.22
Jess Archer
Um, the terminal I did ah I did an ascii art I actually did this at laracon in Nashville for stephenn Reese Carter for he had like a little cli out called drop air and I literally drew the ascii out for that logo like at the conference because he was going to be presenting it and he'd kind of been like.

01:32:02.53
Chris Morrell
Okay.

01:32:11.48
Jess Archer
Was like a last minuteute idea of like oh it wouldd be called to have a logo and I'm like I can do this. Let's like find a cool picture of ah of a drop there which for anyone that doesn't know is like ah a thing we have in Australia is what we tell people that if you come to Australia watch out for the drop as they're like very angry koalas that will drop on your head and eat you.

01:32:15.30
Chris Morrell
That's awesome.

01:32:31.89
Jess Archer
So we found that we found a cool kind of picture to use as a base and I kind of like trace that out and yeah so I enjoy it. It's a it's a it's It's kind of like one of those processes ah to think of it like Lego where if you following the instructions. It can be this kind of meditative process where.

01:32:38.41
Chris Morrell
That's on.

01:32:48.20
Jess Archer
A lot of the hard stuff is taken away but you get to like just do this nice physical process and follow follow a very nicely laid path which is a nice break from sometimes hacking through the Bush trying to figure out what's going on. You know.

01:32:52.30
Chris Morrell
Yeah, yeah.

01:33:05.92
Chris Morrell
Yeah, for sure. No absolutely sometimes I mean I I find that ah you know a lot of times you'll just have these these these processes that just involve. Um, you know.

01:33:23.15
Chris Morrell
Manipulating a thousand lines by hand because it's just easier to do it by hand than to write a script for whatever reason or and and I love you know I definitely can get in the in the just like you know down arrow shift left.

01:33:30.65
Jess Archer
Um, yeah.

01:33:39.42
Chris Morrell
Type a number down there. You know, whatever it is like just over and over. There's something very satisfying about like just doing those. Yeah.

01:33:40.19
Jess Archer
Yeah, yeah, it's it's just calming to have a to kind of be able to turn off the the analyzing thinking part and just be just doing something that's repetitive and and calm and.

01:33:53.35
Chris Morrell
Yeah, yeah, yeah.

01:33:58.12
Jess Archer
Um, guidelines and rails. You know.

01:34:00.58
Chris Morrell
Yeah, yeah, does the um does the game Meridian Fifty nine mean anything to you now? Oh it now. No, it's the it. It was the first Ah Mmo Rpg. Ah.

01:34:03.64
Jess Archer
No, but it sounds like something that might need to mean something to me. Maybe I don't know.

01:34:17.53
Chris Morrell
You know it? That's its claim to fame and it it was just like ah um, exactly that you know very old school horrible Graphics Tons of lag you know, ah.

01:34:18.82
Jess Archer
Um, okay.

01:34:31.85
Jess Archer
Um.

01:34:33.27
Chris Morrell
And there's still it's wild. There's actually still a community that plays like they they eventually got this source code from 3 ds or whoever whoever came out with it and they run open source servers. It's it's it's kind of lovely. But um I got I got into that way way back when but I was never.

01:34:43.48
Jess Archer
On us.

01:34:52.36
Chris Morrell
Never particularly good at it. Um, so my my whole thing was like if you were right clicked on a character. It'd bring up a little like dialogue box that just showed like an about me thing and a few other stats about them and so like I would like make people's.

01:35:03.45
Jess Archer
Um.

01:35:12.30
Jess Archer
On eyes. Yeah.

01:35:12.11
Chris Morrell
Make Ascii art for people to put in their dialogue box like with their name or like their guild or whatever that was my like form of form of ah contribution was I would just like sit there and make.

01:35:21.49
Jess Archer
So did you go kind of pouring through all the different like kind of interesting symbols that exist like we kind of talked about the box drawing characters. But there's so many other interesting shapes.

01:35:28.47
Chris Morrell
Well no, it was it was it was pure ascii like in in that input you didn't there I mean there was no unicode. There was just like yeah.

01:35:38.14
Jess Archer
All you mean, like just like kind of the standard like the first hundred and Twenty Eight or whatever where it's you know a through ed upper lower case and then all the things on your keyboard like forward slash and hashes and all those sorts of things. Yeah, yeah, that's rough.

01:35:46.50
Chris Morrell
Yep, slashes and dots. And yeah, that's like yeah the good old days. Ah well this has been really fun. Um, is there anything that you want to ah to.

01:35:58.30
Jess Archer
Um, it has.

01:36:06.26
Chris Morrell
To call out something well where where do people find you I guess I I should be doing the like where where would you like to be found I guess.

01:36:12.45
Jess Archer
ah yes ah I am on twitter/x at jess archer codes I don't tweet too frequently because I don't know I'm just one of those people that I write something and then I'm like no, everyone's gonna think that's stupid and I delete it't never send it. Um, so.

01:36:29.18
Chris Morrell
Have you ever.

01:36:29.93
Jess Archer
Yeah, don't not too active on there. But I I'm very active in terms of I read a lot of stuff on there and I I try and contribute there as much as possible. That's probably Adam on of the github but who follows people on github I don't know maybe that's a thing.

01:36:35.30
Chris Morrell
I mean.

01:36:41.80
Chris Morrell
Um I I do follow people occasionally but I never then go look I don't know where you go to look at that right? it goes somewhere. There's a list somewhere that we could be looking.

01:36:47.90
Jess Archer
Yeah I follow people that yeah I've been like oh there's a button I'll do that and then that's the last I ever hear of it. Yeah.

01:37:01.64
Chris Morrell
I used I used to do the github explorer ah page all the time and then they kind of changed it. Um, but you know it used to be I don't know it was I just like to look at like what what are the trending ph p repositories. What are the trending Javascript repositories like this week this month

01:37:05.86
Jess Archer
Um, okay, um.

01:37:16.49
Jess Archer
Yeah.

01:37:21.15
Chris Morrell
Um, and I know that stuff still exists but they kind of they've made it less. Um, it's a little more algorithmic and a little less like you just can look at the raw they're all stats. Um.

01:37:31.18
Jess Archer
Yeah.

01:37:35.15
Chris Morrell
But I imagine somewhere in there probably 1 of those tabs is people you follow I would guess and is there anything I mean I know you're you're doing ah larael stuff all the time but is there anything? Um, you know they eat that you're interested in. Ah.

01:37:37.45
Jess Archer
People you've followed. Yeah.

01:37:52.66
Chris Morrell
Promoting right now anything that you're doing on the side that that ah is is fun or anything that's going on inside the layer of our world right.

01:37:57.55
Jess Archer
And nothing really on the side I've kind of I've recently gone full timelarval I was um, three days a week for the whole time I built um prompts. Although if we're being honest I was also working on prompts outside of that time because I loved it so much. Um.

01:38:05.30
Chris Morrell
Okay.

01:38:14.63
Jess Archer
But yeah I mean obviously Laraval pulse was kind of the other thing that that came out that I had a had a big hand in and I could I could do a whole deep dive on that as well in terms of all the intricacies of of doing application performance monitoring that was fun. Um, yeah, and even just ah like I've got.

01:38:18.24
Chris Morrell
Yeah.

01:38:29.40
Chris Morrell
Um, yeah I would love to hear about that someday.

01:38:33.72
Jess Archer
Online Obviously the ah conference talks of when I launched prompts and pulse If you haven't seen any of those I'm kind of assuming most people have probably either seen those or actually played with prompts if they're are they're in the audience but I don't know I mentioned so.

01:38:37.79
Chris Morrell
Um, sure those are great. Go watch those.

01:38:47.92
Chris Morrell
Yeah I Imagine Yeah yep, all right? Oh really.

01:38:52.99
Jess Archer
Yeah I think that's it really I don't I don't have I'd love to have a book to sell um or something but I don't I did a lara classs course on near vim. So. It's like four and a half hours of me teaching you how to use like Nearvim how to configure it like an ide. Ah, so yeah, if you're into more terminal stuff. Go check out that on laracasts. Um, yeah.

01:39:10.58
Chris Morrell
Um, okay, that's that's definitely one of those places where I feel like an imposter I'm like I can I can do 6 things in Vim.

01:39:25.89
Jess Archer
I Could do a whole podcast on just vial learn.

01:39:27.96
Chris Morrell
You know I you know I'm like I have a little bit more in that like I know how to delete a couple lines without having to like hit backspace a bunch of times but ah, that's the extent you know I and I always.

01:39:41.13
Jess Archer
Um, yes.

01:39:45.28
Chris Morrell
I definitely I I have been feeling. Um I've been been sort of tinkering with my keyboard a little bit and the 1 thing that I've been doing is ah I'm trying to to relearn um just using function and.

01:39:52.50
Jess Archer
Okay.

01:40:03.78
Jess Archer
I Am yanis.

01:40:03.94
Chris Morrell
AhHJKL for my arrow keys instead of um instead of using arrow keys because I I do I mean and backspace is the one that's driving me nuts right now I I all this I don't know why but all of a sudden I'm just noticing how far of a reach. It is ah.

01:40:20.93
Jess Archer
Um, okay.

01:40:21.80
Chris Morrell
For for all my life. This has not bothered me but five ten days ago all of a sudden I was just like what every time I hit backspace. It's like it's this big reach that that's true. That's true. Yeah.

01:40:28.34
Jess Archer
Yeah I mean the solution to that is to just not make any typos and then you never need to press it that is not my solution I haven't haven't achieved that yet. But that's the goal right.

01:40:44.20
Chris Morrell
Yeah, so I don't know function n function n and m that's what I'm I'm experimenting with someone on Twitter recommended that. But um, you know when you're in when you're in Vim you don't ever have to backspace right? because you've got a million ways to delete.

01:40:48.79
Jess Archer
Um, and then okay, the interesting.

01:40:58.34
Jess Archer
I've got motions to do yeah, all those sorts of things generally involving the d key which is perfect homerow position. Um I can like Dw for delete word or all sorts of stuff the I w to delete inside the word if I'm precursors halfway through it so many different motions text objects.

01:40:59.75
Chris Morrell
Yeah, first. Yeah, yeah, yeah.

01:41:14.88
Chris Morrell
Um, ah I'm I mean when you when when you watch you on stage and when you watch someone.

01:41:16.25
Jess Archer
Murder Editors are a whole thing.

01:41:24.88
Chris Morrell
Who is really comfortable in Vim like I I'm so envious of that like capacity because yeah, it's like I spend I probably waste so much of my life just like going navigating between more you know.

01:41:40.73
Jess Archer
Oh and this's like there's the there's the action of like holding control and shift and doing those kind of key chords that you know most editors rely on because obviously like in an editor if you push the D key normally people expect that to type the letter d.

01:41:44.13
Chris Morrell
And.

01:41:48.40
Chris Morrell
So.

01:41:54.64
Chris Morrell
Right? right.

01:41:56.89
Jess Archer
Thing I Really love about a Modal editor is when you're in normal mode. All of the keys on the keyboard now don't need to have a modifyer key pressed with it. They can do their own things or be composed in ways to kind of tell the editor what you want to do because most of the time you're not actually typing letters. You're kind of manipulating text at least with like programming. But even.

01:42:01.98
Chris Morrell
Right? right.

01:42:14.18
Jess Archer
Writing text and all those sorts of things. So yeah, normal mode is is where I live Insert mode is just where I occasionally go to add some new stuff.

01:42:15.22
Chris Morrell
Um, yeah for sure first.

01:42:24.88
Chris Morrell
Ahha Yeah no, it's true I mean I I recently um, have you heard of hyperkey. There's ah it's just like there's a way it's this concept of like I think it's command option shift.

01:42:30.56
Jess Archer
I Think so.

01:42:39.67
Jess Archer
Oh yeah, having 1 key bounds that effectively yeah is holding those in. Yeah.

01:42:42.35
Chris Morrell
Control right? and you just have and it's just like it's nice because it's it's you still have a modifier but like it's now you've opened up a whole new space of Keyboard shortcuts because basically no app has a shortcut bound to anything where all the modifier keys are pressed.

01:42:59.59
Jess Archer
Well, it's so unreasonable to ask someone to press all of those and then another letter and the caps lock key is such a good candidate to do something other than what it's doing because it is in prime position and its functionality is seldom needed to escape. Nice.

01:43:02.29
Chris Morrell
So right right.

01:43:11.70
Chris Morrell
Yes, yes I have caps lock mapped to so to escape which ah yeah I don't know because my keyboard doesn't happen an escape key. Oh really? Okay, yeah, do you.

01:43:19.37
Jess Archer
Minus control. Okay, yeah, there's there's another experiment I've keep wanting to try where if you hold it in its control. But if you tap it It's escape and then it can do both things.

01:43:31.91
Chris Morrell
Um, yes I I have been I had I had another key you know mapped with that like double I can't remember what it's called on on this this keyboard but like that. That setting and I I I feel like the either I'd have to retrain myself to learn what the timing of of that feels like because I definitely found that like what I think of as as a tap versus what it thinks of as a tap.

01:43:59.42
Jess Archer
Um, yeah.

01:44:06.90
Chris Morrell
Was like not quite in line with each other and so then I'd be like okay because I had yeah I had um for a little while I was playing with with like some of the home row Keys where like I could hold down d.

01:44:07.64
Jess Archer
In sync. Yeah.

01:44:23.78
Jess Archer
Are.

01:44:26.40
Chris Morrell
And then that would become a modifier right? or you know but I just kept on accidentally typing D or accidentally not ah and engaging the modifier just depending on how how quick I pressed and it was drive me nuts. So I just turned it off.

01:44:35.63
Jess Archer
Yeah, it's tricky and I kind of want all those things to be software based so that when I switch between my laptops built in Keyboard and my other keyboard I Really want to go down the whole like author linear keyboard route where the keys are staggered.

01:44:46.78
Chris Morrell
Yes, yeah.

01:44:55.53
Jess Archer
Um, vertically instead of horizontally and split Keyboards and all that cool stuff which I think would train me better to like use the correct fingers for the correct things because I'm pretty sure on that boundary between two hands. There's There's a little bit of things where I'm not doing what's technically correct. But.

01:44:57.99
Chris Morrell
Vertically yep yep.

01:45:12.59
Chris Morrell
Yeah I so I have one of these. No this is yeah no, no, it's split I switched to this when I was having a little bit of Rsi stuff going on and um.

01:45:13.00
Jess Archer
Just worry that I'm going to ruin myself for typing on a laptop on the couch which I do a lot that yeah well I mean that's still that's still staggered but it is split. Yeah.

01:45:29.42
Chris Morrell
I was I mean I I've been typing on a keyboard at that point for twenty plus years I don't know and this I've only had this keyboard for maybe 3 3 or 3 or 4 years something like that I was just kind of amazed how much better of a typist I became over the course of like. Ah, few months just like not having yeah just not having those cheats in the middle and um, something about like yeah oh yeah, it's been it's been fine um and even like what my solution has just been I have.

01:45:52.50
Jess Archer
Yeah, and that would still translate back to the laptop right? like because everything's in the same position.

01:46:07.30
Chris Morrell
Have everything mapped at the keyboard level on this keyboard. But then I have um, what's it called Caribbeaner Elements installed on my mac for the the Builtin Keyboard and I've I've made my like sort of policy I'm not going to remap anything like this has a couple of extra keys that don't.

01:46:11.52
Jess Archer
Um.

01:46:16.70
Jess Archer
Um.

01:46:26.78
Chris Morrell
Exist on the keyboard on the the Mac Keyboard I'm just like I'm not allowing myself to use those because I don't want to get into a place where I can only type on this keyboard and I'm like useless not another one? Yeah, but that's that that works like you know, then you get like the slight improvement in speed.

01:46:28.35
Jess Archer
Um, yeah.

01:46:34.30
Jess Archer
An exact. Yeah.

01:46:45.39
Chris Morrell
Like responsiveness in the keyboard itself because it's built into like the the firmware. But then if you are on your Mac Keyboard You still have all the shortcuts that are just maybe slightly? Yeah, there's like a software layer in between. Yeah.

01:46:49.50
Jess Archer
Yeah. Bit slower and the layout still means that although you can split it in half it and get yourself good habits and better comfortable Position. You still are yeah, not ruined for every other keyboard that exists in the world.

01:47:07.93
Chris Morrell
Um, yeah I I got have you seen the moonlander. It's like ah it's an expensive keyboard I.

01:47:10.54
Jess Archer
I have seen I've I've gone to the buy now page of that so many times and it's just it's too expensive and I also worry about yeah as I said ruining myself for every other keyboard.

01:47:23.74
Chris Morrell
I tried it for maybe two weeks and it just felt it was just too. It was too too far bridge. You know it was just like um it felt like I was yeah I was having to relearn how to type not just like type better.

01:47:29.63
Jess Archer
Too far. Yeah.

01:47:37.80
Jess Archer
Yeah I mean I'm sure there's a good month or so of like being worse than you currently were before it gets better and that's it's similar with like alternative keyboard layouts as well, right? like Dvorak and kolmack and all of those they sound great.

01:47:46.69
Chris Morrell
Um, yeah, yeah, I'm sure but I don't know this is it. Um.

01:47:57.39
Jess Archer
On paper but like on my phone does that mean that I'm going to be like either struggling to find those layouts on my phone and then every other keyboard in the world I interact with is now unusable to me so I kind of yeah I'm favoring staying.

01:48:07.14
Chris Morrell
So I I have I have heard a lot of people say that they type they use qwerty on the phone and komec on their their their keyboard and it's finee like it doesn't like you.

01:48:19.91
Jess Archer
Interesting. Okay.

01:48:25.25
Chris Morrell
You just make that switch and it's fine. Um I I Yeah you have so much. Yeah I mean so much qwerty experience right? like wow.

01:48:25.50
Jess Archer
And they can still kind of use another keyboard and still be qwerty because I guess they're they're not losing it if they continue to use it on their phone I Suppose. Exactly I know it's not ideal and it was designed for typewriters and so you know its limitations were technical limitations that don't exist anymore or you know all the stories you hear, but it's also fine.

01:48:43.40
Chris Morrell
Yeah, yeah. Right? right? right? is it I Yeah I Wonder I've always kind of believed the story that it's that it was designed to be slow because the typewriters couldn't like could only go so fast but I don't know if that's actually true or not.

01:48:56.13
Jess Archer
Um, yeah.

01:49:02.40
Jess Archer
I Yeah I didn't know have I don't I don't know that I heard that it was deliberately slow I thought it was to create a distribution between commonly pressed Keys um to kind of so put things out enough which I think is potentially beneficial for Keyboards as well. But I think there were some technical limitations.

01:49:13.65
Chris Morrell
Um, maybe it's just yeah.

01:49:19.77
Jess Archer
Certainly the stagger of the keys I think is entirely to do with the typewriter because they have those arms that go down and they need to kind of all fit within each other so it kind of feels silly that we still have them staggered um these days but I don't know it works.

01:49:22.69
Chris Morrell
And right? Yeah, the yeah, right? that makes sense right? Yeah I guess I don't know this the the stagger never really bothered me. Because like that angle kind of feels almost natural to me I know.

01:49:45.59
Jess Archer
Yeah I agree like they kind of all come into each other. So if your hands are like at a slight angle tilted inwards. They're kind of are following a row like ah in a certain direction. Um, but it does kind of.

01:49:52.54
Chris Morrell
Right? right? yeah.

01:49:59.30
Jess Archer
Depend on your hands then being in a very specific position which I think is one of the problems that the splits are trying to solve.

01:50:00.25
Chris Morrell
Yes, yes, yeah, yeah, it's it's true. It's definitely it feels more natural with the split because the the 2 pieces are turned a little bit to match like the angle of my arm. Yeah.

01:50:14.26
Jess Archer
Yeah, um I don't know if I want to make my fingers so lazy that they will only go forwards and backwards and not side to side you know like maybe it's good that they have to go a little in different directions.

01:50:22.65
Chris Morrell
Um, make them work a little bit I'd never thought about it that way. Ah well I Love this keyword. It's it's digma Rays if you want to look into it. It's I've been really happy with it. But.

01:50:29.32
Jess Archer
Nava.

01:50:34.40
Jess Archer
Okay, nice in between. Yeah.

01:50:38.40
Chris Morrell
Ah, it felt like a good sort of in-between yeah, ah, all right? Well this has been the keyboard corner of our show. We should that? Well all I'll have to think about. We'll do a whole whole episode on Keyboards At some point probably but.

01:50:45.00
Jess Archer
Um, yes oh.

01:50:52.53
Jess Archer
Hold on on Keyboards a whole one on near them a whole one on pulse. Yeah, so many things.

01:50:58.88
Chris Morrell
Yeah, sounds good all right? Well we'll we'll have to get those on the books this has been really fun. Thank you for hanging out. Um and up and I'll talk to you again soon? All right.

01:51:06.59
Jess Archer
Um, it has been fun.

01:51:10.18
Jess Archer
Um, yeah, definitely right.

01:51:14.64
Chris Morrell
Here We go here's the outro.

Creators and Guests

Chris Morrell
Host
Chris Morrell
Father of two. Mostly talking about PHP/Laravel/React on Twitter. He/him.
Building prompts w/ Jess Archer
Broadcast by