From 1a0ed0c5af38ef8a50edfeae902aef3bb9c8251c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Fri, 18 Dec 2020 20:12:06 +0300 Subject: tmux: don't autostart on Cygwin --- %HOME%/.bashrc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/%HOME%/.bashrc b/%HOME%/.bashrc index 7347df6..701ee1d 100644 --- a/%HOME%/.bashrc +++ b/%HOME%/.bashrc @@ -132,8 +132,23 @@ nnn() { n "$@" } +remote_terminal() { + test -n "$SSH_CLIENT" -o -n "$SSH_TTY" +} + +local_terminal() { + ! remote_terminal +} + +multiplexed() { + test -n "$STY" -o -n "$TMUX" +} + # tmux: start automatically. # https://unix.stackexchange.com/a/113768 -if command -v tmux &> /dev/null && [ -z "$STY" ] && [ -z "$TMUX" ]; then +if os_is_cygwin && local_terminal; then + # Skip, as it's too slow for some reason. + true +elif ! multiplexed && command -v tmux &> /dev/null; then exec tmux fi -- cgit v1.2.3