Directory navigator
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Přemysl Eric Janouch 623c4914d1
Work around an infinite loop issue
3 months ago
CMakeLists.txt Relicense to 0BSD, update mail address 2 years ago
LICENSE Update copyright years 1 year ago
Makefile Mark files that make use of POSIX ACLs 3 years ago
README.adoc README: fix integration snippets 6 months ago
sdn.cpp Work around an infinite loop issue 3 months ago
sdn.png Add screenshot to README 1 year ago



sdn is a simple directory navigator that you can invoke while editing shell commands. It enables you to:

  • take a quick peek at directory contents without running ls

  • browse the filesystem without all the mess that Midnight Commander does: there's no need to create a subshell in a new pty. The current command line can be simply forwarded if it is to be edited. What's more, it will always be obvious whether the navigator is running.

The only supported platform is Linux. I wanted to try a different, simpler approach here, and the end result is very friendly to tinkering.



Build dependencies: CMake and/or make, a C++14 compiler, pkg-config
Runtime dependencies: ncursesw, libacl

Unfortunately most LLVM libc++ versions have a bug that crashes sdn on start. Use GNU libstdc++ if you're affected.

$ git clone
$ mkdir sdn/build
$ cd sdn/build
$ make

To install the application, you can do either the usual:

# make install

Or you can try telling CMake to make a package for you. For Debian it is:

$ cpack -G DEB
# dpkg -i sdn-*.deb

There is also a Makefile you can use to quickly build a binary to be copied into the PATH of any machine you want to have sdn on.


To start using this navigator, put the following in your .zshrc:

sdn-navigate () {
  # ... possibly zle-line-init
  eval "`sdn`"
  [ -z "$cd" ] || cd "$cd"
  [ -z "$insert" ] || LBUFFER="$LBUFFER$insert "
  zle reset-prompt
  # ... possibly zle-line-finish
zle -N sdn-navigate
bindkey '\eo' sdn-navigate


Here we can't reset the prompt from within a bind -x handler but there is an acceptable workaround:

sdn-navigate () {

  eval "`sdn`"
  [[ -z "$cd" ]] || cd "$cd"
  [[ -z "$insert" ]] || {
    SDN_L="${SDN_L:0:$SDN_P}$insert ${SDN_L:$SDN_P}"
sdn-restore () {
  unset SDN_L SDN_P

bind -x '"\200": sdn-navigate'
bind -x '"\201": sdn-restore'
bind '"\eo":"\200\C-m\201"'


Here is an example of a ~/.config/sdn/look file; the format is similar to that of git, only named colors aren't supported:

cursor 231 202
bar 16 255 ul
cwd bold

Filename colors are taken from the LS_COLORS environment variable. Run dircolors to get some defaults.

Similar software

  • is an entire shell with an integrated ranger-like file manager on Ctrl-N (I find this confusing and resource-demanding, preferring to keep closer to "orthodox file managers")

Contributing and Support

Use to report any bugs, request features, or submit pull requests. git send-email is tolerated. If you want to discuss the project, feel free to join me at ircs://, channel #dev.

Bitcoin donations are accepted at: 12r5uEWEgcHC46xd64tt3hHt9EUvYYDHe9


This software is released under the terms of the 0BSD license, the text of which is included within the package along with the list of authors.