• Stars
    star
    114
  • Rank 298,435 (Top 7 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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.

More Repositories

1

nui.nvim

UI Component Library for Neovim.
Lua
1,382
star
2

minimo

Minimo - Minimalist theme for Hugo
HTML
531
star
3

prettier.nvim

Prettier plugin for Neovim's built-in LSP client.
Lua
262
star
4

nougat.nvim

🍫 Hyperextensible Statusline / Tabline / Winbar for Neovim πŸš€
Lua
185
star
5

tmux-mode-indicator

Plugin that displays prompt indicating currently active Tmux mode.
Shell
108
star
6

node-bitbucket

Bitbucket API client for Browser and Node.js
JavaScript
95
star
7

exrc.nvim

Secure Project Local Config for Neovim
Lua
56
star
8

tree-sitter-lua

Lua grammar for tree-sitter.
C
40
star
9

eslint.nvim

ESLint plugin for Neovim's built-in LSP client.
Lua
35
star
10

gatsby-theme-dox

Documentation made easy with Gatsby. πŸŽ‰
JavaScript
31
star
11

scripts.sh

Handy Shell Scripts
Shell
21
star
12

luver

Version manager for Lua, built with ❀️
Shell
21
star
13

zed

ZSH Plugin Manager
Shell
20
star
14

node-bkash

bKash API client for Browser & Node.js
JavaScript
17
star
15

nvim-treesitter-lua

Tree-sitter Lua parser integration for nvim-treesitter.
Scheme
12
star
16

oclif-plugin-completion

oclif plugin for generating shell completions
TypeScript
10
star
17

stapsher

API service for handling user-generated contents on static sites
JavaScript
9
star
18

gmail-oauth2-script

Script to get OAuth2 Access Token for Gmail.
Shell
6
star
19

express-zod-openapi

Express + Zod + OpenAPI
TypeScript
6
star
20

express-joi-openapi

Express + Joi + OpenAPI
TypeScript
6
star
21

regio

University Department Information Management Software
JavaScript
4
star
22

anontius

Personal Asking Portal (like ASK.fm)
JavaScript
4
star
23

draft-js-modules

Draft.js Modules
TypeScript
4
star
24

octoherd-script-set-pr-merge-config

An octoherd script to set pull request merge config
JavaScript
4
star
25

setup-neovim-action

πŸš€ Setup Neovim on Github Actions.
Shell
4
star
26

luver-action

πŸŒ› Set up your GitHub Actions workflow with specific versions of Lua, LuaJIT, LuaRocks using Luver ❀️
Shell
3
star
27

llhttp.lua

Lua interface for https://github.com/nodejs/llhttp
C
3
star
28

is-mobile-phone-number-bd

Mobile phone number validator for Bangladesh
TypeScript
3
star
29

lua-evdev

LuaJIT FFI Bindings for libevdev.
Lua
3
star
30

rofunicode

Unicode Character Picker for Rofi
JavaScript
2
star
31

gist-embedder

Library for Embedding GitHub Gist
JavaScript
2
star
32

lua-udev

LuaJIT FFI Bindings for libudev.
Lua
2
star
33

kee

πŸ–± ⌨ Do amazing things with Keys...
Shell
1
star
34

middleware-pipeline

Simple Middleware Pipeline
TypeScript
1
star
35

js-set-time

Sets time to Date instance.
TypeScript
1
star
36

hashicorp-vault

HashiCorp Vault API client for Node.js
JavaScript
1
star
37

unoti

Unified Notification
TypeScript
1
star
38

npm-package-template

NPM Package Template
JavaScript
1
star
39

luarocks-publish-action

πŸŒ› Publish to LuaRocks using GitHub Actions
JavaScript
1
star
40

Exercism

πŸ‘¨β€πŸ’» Exercism Solutions
Rust
1
star
41

freeCodeCamp-FrontEnd-Projects

freeCodeCamp Front End Development Projects
JavaScript
1
star
42

x-git-hooks

Git Hooks Handler
Rust
1
star
43

bitbucket-api-routes

Machine-readable, Bitbucket API routes specifications
JavaScript
1
star
44

freeCodeCamp-React-Projects

(freeCodeCamp) React Projects
JavaScript
1
star