aleclearmind / nested-tmux

A simple tmux configuration for nested tmux sessions
MIT License
109 stars 10 forks source link

Looses focus on shell exit #6

Open brauliobo opened 1 year ago

brauliobo commented 1 year ago

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?

aleclearmind commented 1 year ago

I need to figure out a way to fix this. But I've a restore-tmux script that fixes the problem:

#!/bin/bash

TMUX_PARENT=$(basename "$TMUX")
TMUX_PARENT="${TMUX_PARENT%%,*}"

tmux -L "$TMUX_PARENT" source ~/.tmux.conf.d/nested-tmux/active-row.conf

Put it in PATH and launch it when things are broken.

I'll try to come up with a better solution, eventually.

brauliobo commented 1 year ago

@aleclearmind it seems pane-exited hook might work

brauliobo commented 1 year ago

added set-hook -g pane-exited "run-shell '~/.tmux.conf.d/nested-tmux/restore-tmux'" to active-row.conf that made it work :)

aleclearmind commented 1 year ago

PR?