| - [Videos](#videos) - [How to install](#how-to-install) - [Shell Completion](#shell-completion) - [Extensions](#extensions) - [How to use](#how-to-use) - [Recommended tmux Settings](#recommended-tmux-settings) | - [Bonus](#bonus) - [Configuration](#configuration) - [Contributing](#contributing) - [Background (the "t" script)](#background-the-t-script) - [Contributors](#contributors) - [Star History](#star-history) |
Intro from Josh Medeski (sesh's creator) |
Review from DevOps Toolbox |
## Ulauncher Extension
For Linux users using [Ulauncher](https://ulauncher.io/) there are two extensions to use sesh outside the terminal:
- [Sesh Session Manager](https://ext.ulauncher.io/-/github-jacostag-sesh-ulauncher)
- [SESHion Manager](https://ext.ulauncher.io/-/github-mrinfinidy-seshion-manager)
Here are limitations to keep in mind for Sesh Session Manager:
- tmux has to be running before you can use the extension
## Walker launcher usage (Linux)
Create an action directly on $XDG_CONFIG_HOME/config.toml
```
[[plugins]]
name = "sesh"
prefix = ";s "
src_once = "sesh list -d -c -t -T"
cmd = "sesh connect --switch %RESULT%"
keep_sort = false
recalculate_score = true
show_icon_when_single = true
switcher_only = true
```
### For the dmenu mode you can use:
#### Fish shell:
set ssession $(sesh l -t -T -d -H | walker -d -f -k -p "Sesh sessions"); sesh cn --switch $ssession
#### Bash/Zsh:
ssession=$(sesh l -t -T -d -H | walker -d -f -k -p "Sesh sessions"); sesh cn --switch $ssession
##### For dmenu launchers replace walker -dfk with dmenu or rofi)
### How to use
### tmux for sessions
[tmux](https://github.com/tmux/tmux) is a powerful terminal multiplexer that allows you to create and manage multiple terminal sessions. Sesh is designed to make managing tmux sessions easier.
### zoxide for directories
[zoxide](https://github.com/ajeetdsouza/zoxide) is a blazing fast alternative to `cd` that tracks your most used directories. Sesh uses zoxide to manage your projects. You'll have to set up zoxide first, but once you do, you can use it to quickly jump to your most used directories.
### Basic usage
Once tmux and zoxide are setup, `sesh list` will list all your tmux sessions and zoxide results, and `sesh connect {session}` will connect to a session (automatically creating it if it doesn't exist yet). It is best used by integrating it into your shell and tmux.
#### fzf
The easiest way to integrate sesh into your workflow is to use [fzf](https://github.com/junegunn/fzf). You can use it to select a session to connect to:
```sh
sesh connect $(sesh list | fzf)
```
#### tmux + fzf
In order to integrate with tmux, you can add a binding to your tmux config (`tmux.conf`). For example, the following will bind `ctrl-a T` to open a fzf prompt as a tmux popup (using `fzf-tmux`) and using different commands to list active sessions (`sesh list -t`), configured sessions (`sesh list -c`), zoxide directories (`sesh list -z`), and find directories (`fd...`).
```sh
bind-key "T" run-shell "sesh connect \"$(
sesh list --icons | fzf-tmux -p 80%,70% \
--no-sort --ansi --border-label ' sesh ' --prompt '⚡ ' \
--header ' ^a all ^t tmux ^g configs ^x zoxide ^d tmux kill ^f find' \
--bind 'tab:down,btab:up' \
--bind 'ctrl-a:change-prompt(⚡ )+reload(sesh list --icons)' \
--bind 'ctrl-t:change-prompt(🪟 )+reload(sesh list -t --icons)' \
--bind 'ctrl-g:change-prompt(⚙️ )+reload(sesh list -c --icons)' \
--bind 'ctrl-x:change-prompt(📁 )+reload(sesh list -z --icons)' \
--bind 'ctrl-f:change-prompt(🔎 )+reload(fd -H -d 2 -t d -E .Trash . ~)' \
--bind 'ctrl-d:execute(tmux kill-session -t {2..})+change-prompt(⚡ )+reload(sesh list --icons)' \
--preview-window 'right:55%' \
--preview 'sesh preview {}'
)\""
```
You can customize this however you want, see `man fzf` for more info on the different options.
#### tmux + [television](https://github.com/alexpasmantier/television)
If you prefer to use television instead of fzf, you can add a binding to your tmux config that opens the [sesh channel](https://alexpasmantier.github.io/television/community/channels-unix/#sesh) in a tmux popup.
```sh
bind-key "T" display-popup -E -w 80% -h 70% -d '#{pane_current_path}' -T 'Sesh' tv sesh
```
Use `Ctrl-s` to cycle through the sources, and `Ctrl-d` to kill the highlighted session.
### Window management
`sesh window` (alias `w`) lets you list, switch to, and create tmux windows within a session — similar to how `sesh list` and `sesh connect` work for sessions.
#### List windows in the current session
```sh
sesh window
```
#### Switch to an existing window by name
```sh
sesh window editor
```
If a window named `editor` exists in the current session, sesh will switch to it.
#### Create a new window at a directory
```sh
sesh window ~/projects/my-app
```
If no window with that name exists, sesh will create a new window named after the directory (`my-app`) with its working directory set to the given path.
#### Target a specific session
Use `--session` / `-s` to manage windows in a session other than the one you're currently attached to:
```sh
sesh window --session work
sesh window ~/projects/my-app --session work
```
#### fzf integration
You can combine `sesh window` with fzf to interactively switch windows:
```sh
sesh window $(sesh window | fzf)
```
Or as a tmux keybind:
```sh
bind-key "W" run-shell "sesh window \"$(sesh window | fzf-tmux -p 60%,50% --prompt '🪟 ')\""
```
### Create a directory and connect
`sesh mkdir` (alias `md`) combines `mkdir` and `sesh connect` into a single step: it creates the directory if it doesn't already exist, then connects to it as a session — no need to `cd` into it first or wait for zoxide to pick it up.
```sh
sesh mkdir my-new-project
```
`