kwerty

sesh

tmux session manager with fuzzy project switching

linuxmacosratataqueGrimalDevtoolstmuxsession

Overview

sesh manages tmux sessions by scanning project directories and providing instant fuzzy switching. Combined with a tmux keybinding, it creates a project-switcher similar to IDE project selectors.

GrimalDev's Configuration

[default_startup]
command = "nvim"
 
[import]
config = true
 
[[session]]
name = "Home"
path = "~"
startup_command = "nvim ."
 
[[session]]
name = "Immozia"
path = "~/Code/Projects/immozia"
startup_command = "nvim ."
 
[[session]]
name = "Monitor Control"
path = "~/Code/Projects/monitor-control"
startup_command = "nvim ."
 
[[session]]
name = "SRVWEBSTR01"
path = "~"
startup_command = "ssh srvwebstr01"
 
[[session]]
name = "PI"
path = "~"
startup_command = "ssh pi"
 
[[session]]
name = "Nvim"
path = "~/.config/nvim"
startup_command = "nvim ."
 
[[session]]
name = "Discord"
path = "~"
startup_command = "discordo"
 
[[session]]
name = "Whatsapp"
path = "~"
startup_command = "nchat"
 
[[session]]
name = "LeetCode"
path = "~/Code/leetcode"
startup_command = "nvim ."

Startup Scripts

Sessions can use multi-window tmux layouts via startup scripts:

#!/bin/bash
# Example: project with editor + server + logs
tmux send-keys "nvim ." Enter
tmux split-window -h
tmux send-keys "npm run dev" Enter
tmux split-window -v
tmux send-keys "tail -f logs/dev.log" Enter
tmux select-pane -t 0

tmux Integration

Bound to C-space in tmux for instant project switching:

# tmux.conf
bind-key -n C-space display-popup -E "sesh connect \"$(
  sesh list | fzf-tmux -p 55%,60% \
    --no-sort --ansi \
    --border-label ' sesh ' \
    --prompt '⚡  ' \
    --header '  ^a add dir ^d delete' \
    --bind 'tab:down,btab:up' \
    --bind 'ctrl-a:change-prompt(⚡  )+reload(sesh list)' \
    --bind 'ctrl-d:execute(tmux kill-session -t {})+change-prompt(⚡  )+reload(sesh list)'
)\""

Workflow

  1. Press C-space to open sesh
  2. Fuzzy search for project
  3. sesh creates a tmux session at that directory (or attaches to existing)
  4. Each project gets its own tmux session with independent windows and panes