Skip to content

Allow running inside another tmux session#2

Open
WhyNotHugo wants to merge 1 commit intospappier:masterfrom
WhyNotHugo:tmux-nesting
Open

Allow running inside another tmux session#2
WhyNotHugo wants to merge 1 commit intospappier:masterfrom
WhyNotHugo:tmux-nesting

Conversation

@WhyNotHugo
Copy link
Copy Markdown

Generally, nesting tmux session can be dangerous because of recursive attachments (e.g.: a session attached to itself, even transitively).
Since we create a new session here, this is not an issue.

This PR:

  • Keeps focus on the first split when splitting (the focused one will be killed later).
  • Kills the first split by name (otherwise, this might kill the tmux session in which we're running).
  • Unsets the TMUX env variable (so tmux will allow nesting).

Generally, nesting tmux session can be dangerous because of recursive
attachments (e.g.: a session attached to itself, even transitively).
Since we create a new session here, this is not an issue.

This changeset:
* Keeps focus on the first split when splitting (the focused one will be
  killed later).
* Kills the first split by name (otherwise, this might kill the tmux
  session in which we're running).
* Unsets the TMUX env variable (so tmux will allow nesting).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant