Create a new anonymous tmux session on new shell

This commit is contained in:
2024-10-04 14:53:09 +02:00
parent c277290a52
commit 9bc26cdd31
2 changed files with 7 additions and 4 deletions
+2 -4
View File
@@ -136,20 +136,18 @@ in {
plugins = [
"sudo"
"git"
"tmux"
"kubectl"
"copypath"
"copyfile"
];
};
# zprof.enable = true;
sessionVariables = {
YSU_MESSAGE_FORMAT = "Alias: %alias - %command";
YSU_IGNORED_ALIASES = ''("g" "-" "~" "/" ".." "..." "...." "....." "md" "rd")'';
DIRENV_LOG_FORMAT = "";
ZSH_TMUX_AUTOSTART = true;
# ZSH_TMUX_AUTONAME_SESSION = false;
# ZSH_TMUX_DEFAULT_SESSION_NAME = "home";
};
};
}
+5
View File
@@ -1,3 +1,8 @@
# Create a new tmux session (with a random name) and attach.
if [[ -z "$TMUX" ]]; then
exec tmux new-session -s "$(hexdump -n 4 -v -e '/1 "%02X"' /dev/urandom)"
fi
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi