Giter Site home page Giter Site logo

aleclearmind / nested-tmux Goto Github PK

View Code? Open in Web Editor NEW
102.0 9.0 10.0 233 KB

A simple tmux configuration for nested tmux sessions

License: MIT License

Shell 100.00%
tmux tmux-conf tmux-configs tmux-configuration tmux-config tmux-plugin tmux-plugins

nested-tmux's Introduction

Nested tmux

This is a simple tmux configuration enabling to have arbitrarily many nested tmux sessions.

Demo

Demo

Quick start

mkdir ~/.tmux.conf.d/
cd ~/.tmux.conf.d/
git clone https://github.com/aleclearmind/nested-tmux.git
mv ~/.tmux.conf ~/.tmux.conf.backup
echo "source ~/.tmux.conf.d/nested-tmux/active-row.conf" > ~/.tmux.conf
tmux

Shortcuts

  • Ctrl + a, Ctrl + c or Ctrl + t: create a new window
  • Ctrl + a, Ctrl + s: create a new nested tmux session and ask a name for it
  • Ctrl + a, Ctrl + A: switch to last window
  • Ctrl + a, A: rename current window
  • Alt + Right: move to the next window of the current row
  • Alt + Left: move to the previous window of the current row
  • Alt + Up: move to the inner tmux session
  • Alt + Down: move to the outer tmux session

FAQ

  • Q: Why do we need this?

    A: When working with many projects it's useful to have a dedicated tmux session with three windows per-project: one with a text editor, one for git and one for the build directory. This is why this project was born. However, nested tmux sessions are addictive and quickly become in-terminal workspaces that can be used for any purpose.

  • Q: Does it support multiple nested layers of tmux sessions?

    A: Yes.

  • Q: Has it been tested with other configuration X?

    A: No.

  • Q: How is this implemented?

    A: The idea is two have two configurations, active-row.conf and inactive-row.conf. The former is for the currently active row in the nested tmux tree, the second for the inactive rows. Each session know who its parent is through the TMUX_PARENT environment variable (set in the new-tmux script). When Alt + Up is pressed, the Alt + F12 combination is sent to the active window. If the active window is a nested tmux session, it will load active-row.conf and forces loading inactive-row.conf in its parent (i.e., the row that originally received the Alt + Up key combination. When Alt + Down is pressed, the current row loads inactive-row.conf and forces loading active-row.conf in its parent.

nested-tmux's People

Contributors

aleclearmind avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nested-tmux's Issues

Nested tmux session over ssh

Hi, first of all, this is pretty sweet. One question I have is about nesting over ssh. In my client, I have tmux and I want to be able to ssh over to a server, run tmux and switch between the two. Is this something that is possible? I'm not very competent with tmux to know if we can even achieve this but it would be pretty cool if we can. If not, I can live with two terminals.

Looses focus on shell exit

Hello, I'm trying nested-tmux here

Everything seems to work, but when I exit one shell it looses focus to any pane and then all shortcuts stops working!

Maybe it is related to my custom configuration?

Create a Tmux plugin => easier to install

Hello,

That seems awesome.
Have you considered making your conf as a tmux plugin, that would require only one line of code (for users) to maintain in their conf ?

Thanks.

Compatibility with tmux-ressurect

Hi, I'm also trying tmux-ressurect and noticed nested panes don't get restored. Also, the prefix C-s conflict with tmux-ressurect save shortcut.

Is there a quick fix for the first issue?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.