All Projects → MunifTanjim → tmux-suspend

MunifTanjim / tmux-suspend

Licence: MIT license
Plugin that lets you suspend local tmux session, so that you can work with nested remote tmux session painlessly.

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to tmux-suspend

tmux-menus
Tmux plugin, Popup menus to help with managing your environment
Stars: ✭ 124 (+113.79%)
Mutual labels:  tmux, tmux-plugins, tmux-plugin
tmux-conf
📝 TMUX Configuration for nerds with tpm
Stars: ✭ 31 (-46.55%)
Mutual labels:  tmux, tmux-plugins, tmux-plugin
nested-tmux
A simple tmux configuration for nested tmux sessions
Stars: ✭ 66 (+13.79%)
Mutual labels:  tmux, tmux-plugins, tmux-plugin
tmux-base16-statusline
Tmux Base16 Statusline
Stars: ✭ 24 (-58.62%)
Mutual labels:  tmux, tmux-plugins
.tmux
🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
Stars: ✭ 15,594 (+26786.21%)
Mutual labels:  tmux, tmux-plugins
tmux super fingers
A Tmux plugin to open file links from the terminal in vim
Stars: ✭ 44 (-24.14%)
Mutual labels:  tmux, tmux-plugin
tmux-zsh-vim-titles
Unified terminal titles in tmux, zsh, and vim/nvim
Stars: ✭ 28 (-51.72%)
Mutual labels:  tmux, tmux-plugins
tmux-airline-dracula
A tmux theme for Dracula color scheme.
Stars: ✭ 33 (-43.1%)
Mutual labels:  tmux, tmux-plugin
tmux-plugin-spotify
tmux plugin displaying currently played song on Spotify (linux only)
Stars: ✭ 48 (-17.24%)
Mutual labels:  tmux, tmux-plugin
dot
Personal and professional dotfiles to setup my personal workspace on any Debian/Ubuntu system. Also available as rwxrob/workspace container.
Stars: ✭ 152 (+162.07%)
Mutual labels:  tmux
dotfiles
🗿 dotfilery, configuration, environment settings, automation, etc. 🛖
Stars: ✭ 67 (+15.52%)
Mutual labels:  tmux
dotfiles
My .files
Stars: ✭ 22 (-62.07%)
Mutual labels:  tmux
Dotfiles
KDE Plasma for twm users.
Stars: ✭ 83 (+43.1%)
Mutual labels:  tmux
FastPwn
CTF中Pwn的快速利用模板(包含awd pwn)
Stars: ✭ 18 (-68.97%)
Mutual labels:  tmux
dotfiles
💎 My vim/neovim, fish, git, and tmux configuration files
Stars: ✭ 49 (-15.52%)
Mutual labels:  tmux
dotfiles
Doom Emacs, a few-years old vim config, tmux, i3, zsh, polybar
Stars: ✭ 15 (-74.14%)
Mutual labels:  tmux
Dotfiles
Passionately crafted configs for CLI lovers 🐧❤️
Stars: ✭ 70 (+20.69%)
Mutual labels:  tmux
dotfiles
💾 ~/.*
Stars: ✭ 12 (-79.31%)
Mutual labels:  tmux
nyx
⚙️Nix[OS] Configuration
Stars: ✭ 50 (-13.79%)
Mutual labels:  tmux
dotfiles
dotfiles for the command line home
Stars: ✭ 21 (-63.79%)
Mutual labels:  tmux

Tmux Suspend

Plugin that lets you suspend local tmux session, so that you can work with nested remote tmux session painlessly.

Demo:

Tmux Suspend Demo GIF

Usage

With the default keybinding,

Press F12 to suspend your local tmux session. In suspeded state, you can only interact with the currently active pane (which will be running the remote tmux session).

Press F12 again in suspended state to resume local tmux session.

Note: If you have tmux-mode-indicator plugin installed, it'll automatically show indicator for the suspended state.

Installation

Installation with Tmux Plugin Manager

Add this repository as a TPM plugin in your .tmux.conf file:

set -g @plugin 'MunifTanjim/tmux-suspend'

Press prefix + I in Tmux environment to install it.

Manual Installation

Clone this repository:

git clone https://github.com/MunifTanjim/tmux-suspend.git ~/.tmux/plugins/tmux-suspend

Add this line in your .tmux.conf file:

run-shell ~/.tmux/plugins/tmux-suspend/suspend.tmux

Reload Tmux configuration file with:

tmux source-file ~/.tmux.conf

Configuration Options

The following configuration options are available:

@suspend_key

Key used to suspend/resume local tmux session. This is not binded to any Prefix.

set -g @suspend_key 'F12'

@suspend_suspended_options

Comma-seperated list of items denoting options to set for suspended state. These options will be automatically reverted when session is resumed.

set -g @suspend_suspended_options " \
  @mode_indicator_custom_prompt:: ---- , \
  @mode_indicator_custom_mode_style::bg=brightblack\\,fg=black, \
"

The syntax of each item is #{option_name}:#{option_flags}:#{option_value}.

Item Segment Description
#{option_name} name of the option.
#{option_flags} flags accepted by set-option, can be left empty.
#{option_value} value of the option, commas (,) inside value need to be escaped as \\,

For example:

# remove colors from status line for suspended state
set -g @suspend_suspended_options " \
  status-left-style::bg=brightblack\\,fg=black bold dim, \
  window-status-current-style:gw:bg=brightblack\\,fg=black, \
  window-status-last-style:gw:fg=brightblack, \
  window-status-style:gw:bg=black\\,fg=brightblack, \
  @mode_indicator_custom_prompt:: ---- , \
  @mode_indicator_custom_mode_style::bg=brightblack\\,fg=black, \
"

@suspend_on_suspend_command and @suspend_on_resume_command

These options can be set to arbritary commands to run when session is suspended (@suspend_on_suspend_command) or resumed (@suspend_on_resume_command).

set -g @suspend_on_resume_command ""
set -g @suspend_on_suspend_command ""

For example, you can do the same thing that the default value of @suspend_suspended_options does using these options instead:

set -g @suspend_suspended_options ""

set -g @suspend_on_resume_command "tmux \
  set-option -uq '@mode_indicator_custom_prompt' \\; \
  set-option -uq '@mode_indicator_custom_mode_style'"

set -g @suspend_on_suspend_command "tmux \
  set-option -q '@mode_indicator_custom_prompt' ' ---- ' \\; \
  set-option -q '@mode_indicator_custom_mode_style' 'bg=brightblack,fg=black'"

As you can see, it's more convenient to use @suspend_suspended_options for setting and reverting options.

License

Licensed under the MIT License. Check the LICENSE file for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].