Per-session directory stacks for tmux, implemented as a user-space daemon plus a CLI. The CLI communicates with the server over a UNIX domain socket. No system-level services required.
FILE2025-10-0892537PM-ezgif.com-video-speed.mp4
- cargo and rust are properly installed
rustup default stabletoolchain is used
- Put to your .tmux.conf after
set -g @plugin 'tmux-plugins/tpm'beforerun '~/.tmux/plugins/tpm/tpm'
set -g @plugin 'artzhk/tmux-dirs'Ctrl+b I # to run tpm's plugin installation script
- Provide aliases to
.bashrcor.profile
alias tpushd="~/.tmux/plugins/tmux-dirs/bin/tmux-dirs-pushd"
alias tpopd=". ~/.tmux/plugins/tmux-dirs/bin/tmux-dirs-popd"
alias tpeekd=". ~/.tmux/plugins/tmux-dirs/bin/tmux-dirs-peekd"
alias tdirs=". ~/.tmux/plugins/tmux-dirs/bin/tmux-dirs-dirs"Synopsis:
tmux-dirs push <session-id> <path> # push path onto session stack
tmux-dirs pop <session-id> # print top path and pop
tmux-dirs peek <session-id> # print top path without popping
tmux-dirs dirs <session-id> # print stack as space-separated list
tmux-dirs clear <session-id> # clear stack
- Path:
/tmp/dirs.sock.
-
Transport: UNIX domain socket (stream).
-
Framing: single-request, single-reply. The client writes the request, then shuts down its write-half; the server reads until EOF, processes, writes a single textual reply, then shuts down its write-half.
-
Request format (space-separated tokens):
<cmd> <session_id> [<path>]where
<cmd>is one of:PUSH,POP,PEEK,DIRS,CLEAR. -
Reply format:
- For
PUSH:<path>\norERR <message>\n - For
POP/PEEK:<path>\n(empty if none) - For
DIRS: space-separated list of absolute paths, then\n
- For
This simple line protocol matches the “original dirs-like” UX: the CLI prints whatever the server returns.
Yes, I agree, there is might be way more easier implementation via serializing/deserilizing json. I used such an overkill with IPC+Rust only in order to learn and get familiar with IPC and Rust. It's my first project on rust though.
I'm open to any improvements or contribution activities.
Open an issue -> Fork -> Create PRI will review as soon as I have time.