 So you may know that I have the best terminal build out there and it just got a little bit better. In fact, this is one of those things that I think you don't often think that you want, but once you know that it's out there, it's something you just got to have. So my minimal terminal build now has a feature. I don't know any other terminal that has this, but it's fantastic. Okay, just to prime your brain for what we're gonna do. You may know that, of course, I use Sucluses ST. I have a lot of my own patches and extra additions to that. But one thing that's very nice about Sucluses ST is you can patch in the ability of external pipe. And basically what that does is it takes all the content on the screen and you can pipe that to some external script to do something with it. So one thing that I think is on the Sucluses website that they have is following links. And I have this in my terminal build. This isn't the big thing. I'll show you that in just one second. But for example, if I press Alt-L, what it does is it searches everything on the screen for links to something, URLs. And you can select one of those by typing it in. You can select it in D menu, and that will bring it up in a new window or whatever else. So that's very nice. So that's Alt-L. I also have Alt-Y, which is the same thing, but it copies the URL. So I'm going to copy that. So that's a really nice feature. That's a really nice ability. And it's especially nice when, let's say you have a whole bunch of content or something like that. You can still get a lot of these links just by following them or something like that. But we don't need to. Oh, and by the way, a couple of weeks ago, someone actually added in the ability for this to work over line breaks. I think his name was Kaiser Soze. I don't actually know if that's his real name, but thank you, Kaiser. Anyway, so what's the big thing? So last night, I was on the Mumble server. And if you are on the Mumble server, you may know that Jay Walker is on there 24-7, pretty much. And he had this really brilliant idea. His idea was this. So one thing that you often have to do on the terminal, let's say you're, you know, you might cat out some commands, you know, you're doing something, ls-ing or something like that. You're doing something, maybe you're bug testing or running commands. And you often have to copy. You want to copy the output of a command somewhere else. So usually how you do that, in the same way that, you know, normally you might highlight one of these URLs, you have to go to your mouse, scroll over it, get exactly right, copy it and do whatever. Same thing with the output of a command like this, which is a big pain. I mean, if we want to copy all this, it's just an annoyance. I mean, we hate using the mouse on this channel anyway, but either way, this is a particularly annoying thing to do and get exactly right. So J. Walker's idea was basically, let's have the same thing, but same thing as, you know, following URLs, it's up for copying the output of commands. And, you know, we sort of worked together last night and a little today, and we got something that works really well. Let me show you how it works. So if I press alt and then what did I bind it to? Alt O for output. It does this. It'll give you a dmin you prompt and it'll list out the commands that it detects you have run. So let's say I want the output of LSA. Now, once you have selected that, that has been copied to your clipboard. It's copied with XClip actually. So let's say I open up a VimBuffer and I can paste that in and you will see that the output of that command, including the command itself, you know, was successfully copied. So this is extremely useful. Now first off, I will say, despite ST being the most minimalist terminal emulator ever, I don't know of any other terminal emulator that has something just like this, but this is a phenomenal ability because, you know, there's a lot of time when you have to copy output from a particular command and use it somewhere else. So we figured out a way to do this. And again, it's actually already in my ST build. If you want to go on GitHub, I just added it in. Again, it's alt O. It does require dmenu, of course. All of these link following commands require dmenu because that's the menu prompt. And it also requires XClip. You probably already have XClip installed, but that's just the thing that actually copies the text. But that's pretty much all you need. And once you have that, you can run any command. You know, you might have an error. You might have a necessary output. You need to copy to Firefox. And now you can copy all of that without using the mouse, without moving around, just, you know, choosing whatever you want to, whichever one and running with it. So that's fantastic. This is one of the things, this is another life lesson as to how an extensible terminal is much more useful. Now, just to educate you, I do want to at least show you what we're doing in the script because we had to sort of do some weird stuff. Let me go ahead and what did I name it? ST copy out. So if you install my ST build, this will install automatically. And you'll, you don't have to worry about it. It just, you automatically get the binding. Oh, and I will say, I don't know if I mentioned this in a video, but my ST build, which I have done videos on before, it's now in the AUR. So if you're an arch user, you can just install ST Luke get and that'll be it. Anyway, so how it actually works is external pipe, of course, basically what it does is it takes all the content on the screen and pipes it to a script. And this is the script that it's, it's piped to. Okay, so it makes a temp file, it takes the standard input and puts it in that temp file. Then what it does is it actually gets your PS one, it wants to estimate what your, your prompt here looks like and how it does that. What this line is, is it greps out all the lines with content on them that aren't white space, because we don't want, you know, all these lines with nothing on it. It gets the last one of those and it gets, gets the first element in there. And the reason we do that is actually because basically sometimes people's prompts will change depending on what directory they're in. So we just take the first word of those prompts because that's usually unique enough. Okay, so we take that. And then we give them a D menu prompt grepping out all of the lines on their terminal that have that match that have their prompt on it. And that's the menu we give them to select their output from. So they select that. And this is just to escape characters, we actually find, I don't know if anyone knows anything about this, but apparently, like, usually, if you want to escape characters, you can use printf with the like quotation or percentage sine Q. But for some reason, that doesn't work in the way that ST calls this. So we had to do something hacky and escape characters like this. But either way, then what it does, once you've chosen what you what which command you want, it uses oct to search for that command and take everything from that to the next command prompt. And since that to x clip. So that's how it works. So we had to we approach this from different angles. But this is the best way we got it to work. But if you have any suggestions for improvement, feel free to give it give them. So anyway, this should be pretty useful. Again, you don't have to know how this thing is actually working to do it. But I mean, notice how small the script is, with just a couple lines we added in this really great feature to be able to copy output. So I encourage you to check it out. If you have any other suggestions for the kind of things we can do with this, feel free to to, I guess, volunteer them. The there is one improvement we we talked about. So external pipe as it exists right now, it only uses I mean, if I let's say I clear the output here, it's only going to use the content that is on the screen right now, like it's not going to look for commands that, you know, may have already passed through, you've already scrolled by or something like that. So it might be nice to have external pipe look at all the previous commands, there may already be a patch out there that does that, like looks at, you know, as the ST might have ST has, you know, history of the commands run and stuff like that. So there might be a way to do that. But as it is right now, how this is working is it only shows the commands, your most recent commands that are on the screen. So just be aware of that. Otherwise, you know, that's pretty much it. So I hope you enjoy it again. I'll put the links to my GitHub repository. And I guess the the ST build on suckless, which of course, you'd have to patch all the stuff in but my build should work pretty much out the box. Anyway, that's about it. Thanks again to Jake Walker for having that brilliant idea. And yeah, that's about it. See you guys next time.