diff options
Diffstat (limited to 'home')
-rw-r--r-- | home/common/modules/neovim/config/lua/pacman/plugins/toggleterm.lua | 5 | ||||
-rw-r--r-- | home/common/modules/tmux.nix | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/home/common/modules/neovim/config/lua/pacman/plugins/toggleterm.lua b/home/common/modules/neovim/config/lua/pacman/plugins/toggleterm.lua index 83a3c65..e47af46 100644 --- a/home/common/modules/neovim/config/lua/pacman/plugins/toggleterm.lua +++ b/home/common/modules/neovim/config/lua/pacman/plugins/toggleterm.lua @@ -6,7 +6,10 @@ return { direction = "float", open_mapping = [[<c-\>]], on_create = function(term) - term:send("exec tmux") + local session_name = "_nvim_toggleterm_" .. vim.fn.getcwd() .. "_$(date +%s%4N)" + term:send("exec tmux new-session -A -s " .. session_name) + term:send("tmux set-option destroy-unattached") + term:clear() end, }, } diff --git a/home/common/modules/tmux.nix b/home/common/modules/tmux.nix index 433a02c..d9a6c7e 100644 --- a/home/common/modules/tmux.nix +++ b/home/common/modules/tmux.nix @@ -6,7 +6,7 @@ programs.bash.initExtra = lib.mkOrder 2000 '' if [ -z "$TMUX" ] && { [ -n "$WAYLAND_DISPLAY" ] || [ -n "$SSH_TTY" ]; }; then - exec tmux new-session -A > /dev/null 2>&1 + exec tmux new-session -A -s _root_session_managed_by_home_manager > /dev/null 2>&1 fi ''; |