Schievels software archeology 3 – wcd

app-misc/wcd is a utility program that should make changing directories on the command line more efficient. It was written by Erwin Waterlander in 1996 for HP-UX and was ported to many different operating systems, like DOS, Windows (95 to 10), MacOSX and, of course, Linux.

Because wcd indexes the filesystem on first run, and therefore can find the directories very fast. But what I also like is that this is coming from a time where mouse support was not really a big thing, so it has keyboard centric usage and is therefore very past to use.

When you type something like wcd org you get a list of files:

a /home/pascal/.emacs.d/.local/cache/org
b /home/pascal/.emacs.d/.local/straight/build-28.1/evil-collection/modes/org
c /home/pascal/.emacs.d/.local/straight/build-28.1/org
d /home/pascal/.emacs.d/.local/straight/repos/evil-collection/modes/org
e /home/pascal/.emacs.d/.local/straight/repos/org
f /home/pascal/.emacs.d/modules/lang/org
g /home/pascal/.emacs.old/.local/cache/org
h /home/pascal/.emacs.old/.local/straight/build-28.1/evil-collection/modes/org
i /home/pascal/.emacs.old/.local/straight/build-28.1/org
j /home/pascal/.emacs.old/.local/straight/repos/evil-collection/modes/org
k /home/pascal/.emacs.old/.local/straight/repos/org
l /home/pascal/.emacs.old/modules/lang/org
m /home/pascal/nextcloud/Uni/Theoretische Informatik/JFLAP7.1/org
n /home/pascal/nextcloud/org
o /home/pascal/org
                                                                                                                                                                                   w=up x=down ?=help  Page 1/1
Perfect match for 15 directories.
Please choose one (<Enter> to abort):

Typing a letter now will change the working directory to the given path.

On top of that wcd offers a very nice file browser for the terminal. I used to use lf for that (and only that, I know lf can do much more, but for I all the file operations I just stick to the normal shell commands), which is also a good program, but the default vim-like behaviour make things in wcd even a tad better for me. You activate the file browser with wcd -g and something like this will come up:

                        ├─ org2blog ─┬─<htmlize>─── .git ─┬─ hooks
                        │            │                    ├─ info
                        │            │                    ├─ logs ─── refs ─┬─ heads
                        │            │                    │                 └─ remotes ─── origin
                        │            │                    ├─ objects ─┬─ info
                        │            │                    │           └─ pack
                        │            │                    └─ refs ─┬─ heads
                        │            │                             ├─ remotes ─── origin
                        │            │                             └─ tags
                        │            ├─ hydra ─┬─ .git ─┬─ hooks
                        │            │         │        ├─ info
                        │            │         │        ├─ logs ─── refs ─┬─ heads
                        │            │         │        │                 └─ remotes ─── origin
                        │            │         │        ├─ objects ─┬─ info
                        │            │         │        │           └─ pack
                        │            │         │        └─ refs ─┬─ heads
                        │            │         │                 ├─ remotes ─── origin
                        │            │         │                 └─ tags
                        │            │         ├─ .github
                        │            │         ├─ doc
                        │            │         └─ targets
                        │            ├─ metaweblog ─┬─ .git ─┬─ hooks
                        │            │              │        ├─ info
                        │            │              │        ├─ logs ─── refs ─┬─ heads
                        │            │              │        │                 └─ remotes ─── origin
                        │            │              │        ├─ objects ─┬─ info
                        │            │              │        │           └─ pack
                        │            │              │        └─ refs ─┬─ heads
                        │            │              │                 ├─ remotes ─── origin
                        │            │              │                 └─ tags
                        │            │              ├─ .github ─── ISSUE_TEMPLATE
                        │            │              ├─ ci ─── vale ─── styles ─── Vocab ─── Base
                        │            │              ├─ docs
                        │            │              ├─ images
                        │            │              ├─ svg
                        │            │              └─ tests
                        │            ├─ org2blog ─┬─ .git ─┬─ hooks
                        │            │            │        ├─ info
                        │            │            │        ├─ logs ─── refs ─┬─ heads
                        │            │            │        │                 └─ remotes ─── origin

Now, you can go around the directory tree with arrow keys or HJKL. Additionally you can search similar to vim by typing /. To go to the next occurence of the searched term, type CTRL-n. Pressing enter will exit the tree view and change the working dir of the shell to the highlighted directory.

Schievels software archeology 2 – Levee

app-editors/levee is a vi clone by David Parsons. It is from a time where vi was still closed source. Last release it saw was in 2019, it has a Github repository and also a Webpage. I do not know why but levee is also called ’Captain Video’ by David.

Well, there is not that much to say about this technically other than this is a vi clone. It does what you expect from vi: Going around with HJKL and trapping users that do not know about :q!. What struck me is that this thing is really ancient, it is from 1981 or so and was originally written in some dialect of Pascal called USCD Pascal and was ported to C in the 80s. Yet it is still maintained actively by David, or Orc on GitHub. It is also really tiny, David writes about 54k on 64bit OSX. I am considering using this on an STM32 as an editor running on the display of my keyboard project. if I get this to compile for ATmega.

The changelog of version 4.0 reads fix a 39 year old bug where changing the last line in a file wouldn’t refresh properly.

David also has some other interesting projects, including his own version of autoconf, so check out his homepage.

Schievels software archeology 1 – Boxes

A series for ancient software pearls

I recently started with fixing bugs for clang16 in Gentoos packages. By default, Clang-16 will not allow implicit integer return types, implicit function declarations etc.

Eventually GCC-14 will follow, and instead of just changing the CFLAGS to make those errors into warnings again, we try to write patches for the packages. This is because this is not only cosmetic, implicit functions can lead to runtime failures on some architectures while the program runs fine on other architectures.

This is quite a task, here you can read up about it. Currently Gentoo has more than 500 open bugs because of this.

But this post should not be mainly about fixing clang16 bugs. When fixing those bugs I mainly aim for the packages in Gentoo that have no maintainer because these are the ones that are fixed the least likely so I feel my help is needed the most here. Many of those packages are abandoned by upstream as well, last release was 10+ years ago. But every now and then I come across an ancient software pearl which has a long standing history, is still maintained or does really interesting things. Things that are done in a different (supposedly more user friendly) way today, which makes using those packages and looking at them interesting as well.

Therefore I would like to start as small series here, where I present an ancient program in every post when I come across such a pearl.


First software pearl I came across was app-misc/boxes by Thomas Jensen, they also have a GitHub repository and Webpage. This thing was founded some time around 1999 and saw it’s last release on Sep. 22, 2022!

What it does is generating ascii-art boxes, hence the name, around a given string. Like this:

/* Different all twisty a */
/* of in maze are you,    */
/* passages little.       */

or this:

     | \/   |
     | |    |               SPRING IS IN THE AIR!              jgs
     \ \    /                                                _ _
      '\\//'                                               _{ ' }_
        ||                      joan stark                { `.!.` }
        ||                  <>          ',_/Y\_,'
        ||  ,                                               {_,_}
    |\  ||  |\                                                |
    | | ||  | |              ASCII ART GALLERY:             (\|  /)
    | | || / /      <>    \| //
     \ \||/ /                                                 |//
      `\\//`   \\   \./    \\ /     //    \\./   \\   //   \\ |/ /

(The geocities link is sadly dead)
Boxes has a wide selection of ascii-art boxes to choose from. Now, the more artsy ones are nice, I have a nick for ascii-art, but not very useful to me. But the other ones are very good to split C-code into sections.
Boxes is especially great because it generates the box around an already existing string. So you don’t need to have the box in mind when writing comments, you can put them in afterwards. Secondly boxes not only generates those boxes, it also removes botched boxes and puts new ones around the string again. Say you have a nice box and you edit the text inside. The box will become broken. You can remove the broken box with boxes -r and put a new one in afterwards. This is a great feature, since removing such boxes manually is kind of tedious.

You can also integrate this into the editor of your choice. They have a dedicated page to that. There is also a boxes-modes for Emacs, of course, but I have not checked it out yet. I am quite happy with the two functions of adding a box and removing it again.