<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Elsa Gonsiorowski</title>
        <description>My Personal Website</description>
        <link>http://gonsie.com/</link>
        <atom:link href="http://gonsie.com/blorg/feeds/eshell.xml" rel="self" type="application/rss+xml"/>
        <pubDate>Tue, 19 May 2026 17:45:38 +0000</pubDate>
        <lastBuildDate>Tue, 19 May 2026 17:45:38 +0000</lastBuildDate>
        <generator>Jekyll v3.10.0</generator>
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
            <item>
                <title>Don&apos;t be afraid of eshell</title>
                <author>gonsie@me.com (Elsa Gonsiorowski)</author>
                <description>&lt;p&gt;One of the reasons I decided to switch to emacs was the ability to embed a terminal window directly within my editor.
Before last week, I never got the embedded terminal working and never really gave eshell much of a try.
Initially, I tried to setup my regular shell (&lt;a href=&quot;https://fishshell.com&quot;&gt;fish&lt;/a&gt;), but that never quite worked correctly.
I also learned the power of dired and haven’t had the need to use the command line quite as much.
Then, last week, I found myself editing and re-compiling code in a tight loop.
I wanted access to the terminal, to trigger compilation, without leaving emacs.
I created a quick-and-dirty eshell setup… and then wondered why I hadn’t done this sooner.&lt;/p&gt;

&lt;h2 id=&quot;what-is-eshell&quot;&gt;What is eshell?&lt;/h2&gt;

&lt;p&gt;Emacs shell, or eshell, presents bash-like command line interface built directly on emacs.
It tries to be the best of two worlds:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;An elisp REPL wherein elisp commands can be directly executed&lt;/li&gt;
  &lt;li&gt;A command line interface similar to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;bash&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;By understanding that eshell is presenting emacs in a terminal/shell sort of way, I can choose if I want to execute a command the elisp or bash way.
More details can be found on the &lt;a href=&quot;https://www.gnu.org/software/emacs/manual/html_mono/eshell.html&quot;&gt;eshell page in the emacs manual&lt;/a&gt;.&lt;/p&gt;

&lt;h2 id=&quot;bare-minimum&quot;&gt;Bare Minimum&lt;/h2&gt;

&lt;p&gt;First things first: to launch an eshell terminal, run &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;M-x eshell&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Next, there are 2 things I need to have a basic, functioning shell environment:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Have the correct PATH&lt;/li&gt;
  &lt;li&gt;Have my most used aliases&lt;/li&gt;
&lt;/ol&gt;

&lt;h3 id=&quot;path&quot;&gt;Path&lt;/h3&gt;

&lt;p&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; variable used by eshell is exposed through the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;addpath&lt;/code&gt; command.
Without any arguments, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;addpath&lt;/code&gt; simply prints out the directories currently in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt;.
When called with one or more arguments, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;addpath&lt;/code&gt; will append these paths to your &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt;.
There is no need to include the current &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;PATH&lt;/code&gt; contents, as &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;addpath&lt;/code&gt; always appends.&lt;/p&gt;

&lt;h3 id=&quot;aliases&quot;&gt;Aliases&lt;/h3&gt;

&lt;p&gt;Eshell has a number of built in commands, which are similar to the &lt;a href=&quot;https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Shell-Builtin-Commands&quot;&gt;bash builtins&lt;/a&gt;.
The most useful command is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;alias&lt;/code&gt;, which can be used to create any commands that you are used to using in your regular shell.
The first step for me was to figure out which aliases I use most often and add them to eshell.&lt;/p&gt;

&lt;p&gt;First, I needed the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls&lt;/code&gt; alternative that I use.
Luckily, there is an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ls&lt;/code&gt; provided by eshell (shown by running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;which ls&lt;/code&gt;).
It takes the same arguments as my Mac’s builtin version.&lt;/p&gt;

&lt;p&gt;Next, I needed a way to open an emacs buffer with a specific file.
I use the command &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;em&lt;/code&gt; to launch a new emacs session within my terminal window (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;emacs -nw&lt;/code&gt;).
The alias for eshell is slightly different, since I am &lt;em&gt;already&lt;/em&gt; running an emacs session.
I simply want to start editing a particular file.
Thus, the alias makes a call to the emacs function &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find-file&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;My alias file (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;~/.emacs.d/eshell/alias&lt;/code&gt;) looks like this:&lt;/p&gt;

&lt;figure class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;language-eshell&quot; data-lang=&quot;eshell&quot;&gt;alias la ls -AFGhl $1
alias em find-file $1&lt;/code&gt;&lt;/pre&gt;&lt;/figure&gt;

&lt;h2 id=&quot;next-steps&quot;&gt;Next Steps&lt;/h2&gt;

&lt;p&gt;The bare minimum takes care of my most frequent use case.
Now, I can compile code without switching away from emacs!&lt;/p&gt;

&lt;p&gt;The next step for me is to add the aliases to &lt;a href=&quot;https://github.com/gonsie/dotfiles&quot;&gt;dotfiles&lt;/a&gt; and continue to improve my eshell setup.
A quick web search lead me to a literate config for eshell in &lt;a href=&quot;https://github.com/howardabrams/dot-files/blob/master/emacs-eshell.org&quot;&gt;howardabrams/dot-files&lt;/a&gt;.
There are several settings here that I will have to add for myself.&lt;/p&gt;
</description>
                <pubDate>Wed, 31 Jul 2019 00:00:00 +0000</pubDate>
                <link>http://gonsie.com/blorg/eshell.html</link>
                <guid isPermaLink="true">http://gonsie.com/blorg/eshell.html</guid>
                
                <category>emacs</category>
                
                <category>eshell</category>
                
                
            </item>
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
    </channel>
</rss>
