 E-Max has so much to offer you that it can be overwhelming sometimes. E-Max, the sky's the limit to what you can do within E-Max. Even the stuff that's built into E-Max is just overwhelming. Forget about what you can do by extending E-Max. Let's talk about some of the built-in features of E-Max. Let's talk about the shell integration and some of the terminal emulators that are built into E-Max. Just talking about the shells and the terminal emulators, that's confusing to most new E-Max users because there's so many shells available to you. Which one should you be using and which situation? What's the difference between the various shells inside E-Max? That's our topic for the day. So let me switch over to the desktop here and I'm gonna launch E-Max. Of course, you guys know I use Doom E-Max. The first shell you want to discover is what they call the inferior shell. So if you do meta-X, so Alt-X on the keyboard and type just the word shell. So this is the standard shell mode inside E-Max and they call this the inferior shell. You can see the description actually says run an inferior shell. Hit Enter. And by default what this is, it is a wrapper around your default system shell. So if your default system shell is bash, it's gonna be the bash shell. And that's basically it, you can change what the shell is. Though it doesn't have to necessarily be your system's default shell. In your E-Max config, you can specify, hey, in shell mode, I want ZSH or Fish or some other shell that doesn't necessarily always have to be the system's default shell. Now, shell is not the greatest shell in E-Max. It has some severe limitations to the point most people probably actually don't use this shell. This is probably the one that the least amount of people probably use. Because all it does is redirect input and output to E-Max. And it means a lot of interactive terminal programs, things like top and SSH, your terminal file managers, like Ranger and Midnight Commander and VIFM and things like that. They may or may not work properly, they probably won't. If they require a whole lot of interactive stuff going on, it's probably not going to be a good experience in MetaX shell. Because again, it's an inferior shell. But we do have other options though. So if I hit escape here to get into normal mode and I do control WC to close that split here in Doom E-Max, let me show you some of the other shells that are available to you. Or a better terminal emulator inside E-Max. Because shell mode, just the standard MetaX shell, it's not really a terminal emulator, it's just a wrapper around your shell. If you want a proper terminal emulator, what you probably want to use is something like ANSI shell. So do MetaX and then type NC-term. And this will ask you, hey, what shell do you want to run? At the bottom it's asking me, do I want to default to slash bin slash fish? Or would I rather change it to slash bin slash ZSH? Or I could change it to slash bin slash bash. I'll do bash because it is the default system shell. Although I do notice that some of my color scripts did not display correctly here inside the ANSI-term and I also noticed my prompt, my bash prompt does not display correctly inside the ANSI-term. We'll just go with it for now, but ANSI-term I found also does sometimes have some limitations, sometimes interactive programs like H-top, for example. They don't look that great inside the ANSI-term. So ANSI-term also has some severe limitations, although it is a proper terminal emulator. It's similar to things like X-term and RX-VT and your traditional terminal emulators. There's a better one out there. And it may or may not be installed in Emacs by default or your distribution of Emacs. If you use Doom Emacs or SpaceMax, you may have to install it. But the one I have found to be the best terminal emulator is V-term. So if I do MetaX and then type V-term, this will just default to a real prompt here. This is actually the fish prompt here inside V-term. And if I do LS and H-top, and H-top looks perfectly fine there. If I wanted to do something like, do I have VIFM here on the system? I do. Let me do a colon Q to quit out of that. Actually, I got into VM there. So let me colon Q a couple of times to get out of that. Now, everything kind of works in V-term. I found very little in V-term that doesn't work. So if you just want a standard terminal emulator to run your shells in V-term is the one, but you're not stuck with just your standard terminal emulators and your standard shells, there are other shells available to you inside Emacs shells that may or may not be available to you in a standalone terminal emulator. The obvious one we should talk about is the E-shell. So let me close this V-term here. So let me escape to get into normal mode and then control W, C to close that split. And you know what? I'm gonna kill this buffer as well. So let me escape to get into normal mode and kill that buffer. It's asking me, do I want to kill that buffer? All right, now I'm gonna do meta X and let's launch the E-shell. Now what the E-shell is, is this is the interactive Emacs shell. It is written entirely in Emacs lisp, elisp. And it's a very powerful feature rich kind of replacement for your typical shell, things like bash because now you can create elisp functions inside your shell, right? It's also kind of a REPL, right? And it's an Emacs lisp REPL. Now before we talk about how great E-shell is, we do need to talk about some of the limitations with E-shell. First of all, E-shell is not a terminal emulator. It's a shell, but it's not a terminal emulator. So it does not talk to a shell, it is the shell. So you need to understand that also because of the way E-shell talks to other processes, especially asynchronous processes, there may be issues with the way it buffers text and how it interrupts work. So not everything, when you run interactive terminal kind of programs inside E-shell, some of them may not work as expected. Also E-shell does not support interactive programs. So things like TOB, HTOB. Matter of fact, let me try HTOB here and let's see. HTOB does display correctly. Of course, I'm not actually running any commands on it. I'm not trying to kill any processes or anything like that right now, but at least it displays correctly where it did not display correctly at all and some of the other shells thus far. E-shell will not run exactly like Bash or ZSH or even other ancient shells like the C-shell or anything like that. E-shell is its own thing. You have to learn a completely new shell that's completely alien and in a lot of ways because it's kind of extensible in E-Lisp through Emacs, through configuring it. You can really configure E-shell to be whatever it is you want it to be. You know, it has a lot of customization available for you if you want to take advantage of that. Not everybody of course needs that, but those of you, especially those of you that are really into E-Lisp. E-shell is probably the shell you eventually want to deep dive into. One of the neat things about E-shell is a lot of your standard shell commands have been rewritten basically in E-Lisp just for E-shell. So a lot of the standard shell commands you typically do in things like Bash, Cat, CP, LS, CD, you know, those kinds of commands, those commands are not the standard Unix versions of those commands. They have been rewritten in E-Lisp for the E-shell. The E-shell also has a lot of custom commands that are not available in any other shells. For example, if I wanted to show you this command here, DearEd is a E-shell command. It launches DearEd, the directory editor, the file manager inside Emacs. It launches that on whatever directory I give as an argument. So maybe I want to open, I don't know, how about my wallpapers directory? Will it actually tab complete? No, it won't, but I am not in my home directory either. Let me CD into the home directory. And then let me do DearEd and wallpapers will tab complete when you hit tab. And this will open the DearEd file manager in my wallpapers directory. So let me do a Q to quit out of that. And I'm back into the E-shell. Another command that's really interesting is VC-DIR, so version control directory. It's basically, hey, give me, I guess like a version control status, like a git status on this directory. And once again, I'll run it on my wallpapers directory because my wallpapers directory is a git repository. So if I do VC-DIR space wallpapers, you know, it basically gives me the git status inside maggot, inside Emacs, Q to quit. Another built in E-shell command is the find-file command, which is really cool. It just searches for a file. If I wanted to search for a file in this directory that I'm in, maybe I want to search for dot bash RC. Not only does it find it, it automatically opens it up inside an Emacs, but for, of course, I'm not really wanting to work on my bash RC, so let me colon Q to get out of that. And of course, I actually closed the window. Let me relaunch an E-shell. So I actually have it hotkeyed for me just to automatically get back into the E-shell when I launch Emacs. Now, one thing that people, when they first get into E-shell, immediately have a problem with is, if you use aliases a lot, and I'm a big time bash alias user, how do I get aliases inside E-shell? Because remember, E-shell is its own shell. It's gonna have its own aliases. Well, maybe I don't like how long the find-file command is, because that's such a great command. You'll use it all the time, but I don't want to type nine characters for find-file. Well, I could alias it. I could do alias, space, ff, space, and then inside single quotes, find-file, space, dollar symbol one. And that creates the alias for find-file, well, from here on out, just beat ff. So if I do ff, and maybe I want to search for my ZSHRC this time, you know, and again, it'll launch it. And let me quit out of that. Actually, if I quit out of that, it's actually going to close the window. Let me just switch back into the E-shell buffer here. Now, the problem with what I just did, aliasing find-file to ff, this is a one-time deal, right? So how do we actually put that in like a aliases file so it's permanently available to us? Well, let me open up my config file for Doom Emacs. So let me open up my config.org here. And if I go down to this section where I have written some stuff about the shells, first of all, with the inferior shell, with any shell that uses one of the standard shells on your system. So if it can use Bash or ZSH or Fish. So that will be things like MetaX shell, MetaX term, MetaX ANSI-term, all of those are gonna use a external shell like Bash, ZSH or whatever, they don't have their own shells. And I set them to always use Fish is what I did in this command. Let me zoom in so you guys can see that. So I've added this to my config setQ space, shell-file-name is bin slash fish. So Bash is my system's default shell. That's what they would automatically default to is Bash. I want them to actually launch the Fish shell though. But for E-shell aliases, here is the thing I added setQ space E-shell-aliases-file. And then I created a file in my .doom.d directory called aliases. And that is where I put all my E-shell aliases. So if I do space FR here in Doomy Max and I search for aliases for recent files here, this is my aliases file. And you'll see the syntax is a little different than what it is in Bash or ZSH or Fish. So instead of aliase LS equals and then in quotes the alias, there's no equals and there's no quotes. And I've aliased LS to be EXA. So when I relaunch the E-shell here, if I do a LS inside the E-shell here, this is actually the EXA command with the various flags I gave it. So that's how I did that. I also aliased my gitbear repository. I will delete this though. This actually did not work properly for me. So I don't actually want to show you guys that on camera, the E-shell does not like the alias for my home directory being a gitbear repository. It actually freezes up the E-shell. So I need to get rid of that. That way I don't accidentally launch that command one day because all it does is it just completely locks up the E-shell. So again, you know, the various shells, all of them have little niggles, things that work properly within them, some things that don't work properly, you know. So not every shell is perfect. That's why it's good to have, you know, the four or five shells that are already in Emacs, you probably are gonna use more than one of them anyway. You'll probably find use cases, maybe for all of them. One other shell we should talk about. I know a lot of you guys are really big into Python development. And of course, IPython is available. So if you need a Python REPL, of course that is available to you. And you know, you can use this, you know, however you want. You can type actual Python commands here. You do math, of course, inside a Python shell. One plus one actually returns to like it should. You could, you know, do a print and then in quotes here, I could do, you know, hello world and they will actually print that out for us. So that is your standard IPython REPL. By the way, because the E shell is a REPL, I could also do math with it. I could do plus one, one. That's how it has to be written in Elisp. It's not one plus one, it's plus one and one. And then that returns to, and let me clear the screen here. The clear command work, it does. Since we did a hello world in Python, I guess I should try to do a hello world here in Elisp. I believe it's message. And then if I wrap in quotes here, hello world. Yeah, and that actually works. Now I had to think about that a little bit because one thing to notice here is that, you know, when you're using one of these interactive programming shells, these REPLs, especially the E shell, you know, Elisp is full of parentheses. You don't have to use a lot of those parentheses when you're just doing things interactively in the shell. So this actually, you know, if you were writing this in a script, it would have to be wrapped in parentheses. The same thing with the math command that I did earlier, that plus one and one, that needs to be wrapped in parentheses. And depending on how complicated the math expression, the equation you're writing, you may have to have a lot of parentheses in that thing. So just something to keep in mind that it's written slightly differently in the E shell itself than how it would be if you were writing it in an actual Elisp script. So that's just a very cursory overview of some of the various shells and terminals inside Emacs. We talked about just MetaX shell, which is the inferior shell. We talked about ANSI-term, which is a more proper terminal emulator, but still kind of limited. We talked about V-term, which is a much better terminal emulator. That's the one probably most people would probably want to use. If you're really big into Elisp and you really make your shell a lot more extensible by writing custom Elisp functions and things like that, the E shell is probably the most powerful shell in Emacs for that sort of person. And of course, you have various repels available for you, such as the iPython repel for those of you that do Python programming. Now, before I go, I need to thank a few special people. I need to thank Michael, Gabe, Corbinian, Mitchell, Devin, Fran, Arch5530, Akami Channel, Chuck Claudio, Donnie, Dylan, George Gregory, Kell of Devils, Lewis, Paul, Scott, and Willie. They are the producers of the show. They're my highest tiered patrons over on Patreon without these guys. You wouldn't know about the various shells inside Emacs. Well, you might know about it, but still, thank you guys. I also want to thank each and every one of these ladies and gentlemen as well. All these names you're seeing on the screen. These are all my supporters over on Patreon because this channel is supported by you guys, the community. You'd like to support my work. Look for DistroTube over on Patreon. All right, guys. Peace.