A Tmux plugin for working with devcontainers featuring:
- Status bar placeholders to show the status of the devcontainers for the current workspace.
- Key binding to create a new login shell in the devcontainer (via devcontainer exec).
- A menu to interact with the devcontainers in the current workspace.
tmux-devcontainers provides a status bar placeholder to show the status of the devcontainers from your docker-compose file:
set -g status-right '#{devcontainers_workspace} #{devcontainers_status}'
#{devcontainers_workspace}
: shows the name of the devcontainer workspace.#{devcontainers_status}
: shows the status of each container in the workspace.
Commands to manage devcontainers. Commands run in new windows and try to be unintrusive by automatically closing on success.
tmux-devcontainers provides a key bindings to interact with the devcontainers:
- prefix + E: creates a new tmux pane with a login shell in the devcontainer.
- prefix + (Ctrl + e): shows a menu to interact with the devcontainers in the current workspace.
The Exec command will default to running /bin/bash
in the devcontainer. This can be overridden per project by adding the following to your devcontainer.json
:
{
"customizations": {
"tmux": {
"execCommand": "/bin/sh" // or "rails console", etc.
}
},
}
Key bindings can be customized by setting the following options in your ~/.tmux.conf
file:
set-option -g @devcontainers_exec_key 'T' # default: 'E'
set-option -g @devcontainers_menu_key 'M' # default: 'Ctrl + e'
## Installation
- docker (version 28 or later)
- devcontainer CLI
- jq
Add the following line to your ~/.tmux.conf
file:
set -g @plugin 'phil/tmux-devcontainers'
tmux-devcontainers is designed to be as flexible as possible, allowing you to interact with devcontainers in your workspace directly from Tmux. It provides a simple way to manage and monitor the status of your devcontainers without leaving your terminal. Commands and status updates are scoped to the current Tmux pane, so you can easily switch between different devcontainer workspaces within Tmux sessions.
Check out how to contribute to the CLI in CONTRIBUTING.md.
This project is under an MIT license.