tmux.conf: detect running as tmate and disable non-supported features tmux versions >=2.3 support the -q option for source-file to suppress errors for nonexistent files. Even Debian/oldoldstable has tmux v2.3-4, so this works nice everwhere, *except* for when invoking tmate, which is a fork based on an old version of tmux, which then complains about: | /etc/tmux.conf:75: usage: source-file path | /etc/tmux.conf:36: usage: source-file path Try to detect tmate from within the environment, and then enable the configuration only when *not* running from within tmate. This commit relies on @mika's commit grml/grml-etc-core@71101e0 (the commit message was shamelessly copied, thx!), but two things changed: * Use "! (env | grep -q TMUX=/tmp/tmate)" instead of "env | grep -q TMUX=/tmp/tmate && false" which always results in false: $ true && false; echo $? 1 * Double escape the semicolon (;) (i.e. \\;). Because if bind-key is set up to call multiple commands, each command needs to be separated with \;. (Each command is terminated by a newline or a semicolon. Commands separated by semicolons together form a ‘command sequence’). And if bind-key is called within if-shell \; needs to be escaped one more time. (No escaping would have been needed when using braces ({}), but tmate does not seem to support braces.) See: COMMAND PARSING AND EXECUTION + PARSING SYNTAX in man page tmux(1). Replaces the PR: grml/grml-etc-core#151
zshrc: run tlog alias with --follow=name It's annoying to follow the syslog, but then tools like logroate kicking in to rename syslog to syslog.1. Then you're stuck with the "old" syslog file content, by using the --follow=name option we can fix this. Quoting from tail(1): | With --follow (-f), tail defaults to following the file descriptor, | which means that even if a tail'ed file is renamed, tail will continue | to track its end. This default behavior is not desirable when you really | want to track the actual name of the file, not the file descriptor | (e.g., log rotation). Use --follow=name in that case. That causes tail | to track the named file in a way that accommodates renaming, removal and | creation.
tmux.conf: Add bind-key J to join marked pane to active window We have "bind-key j" which joins "the last active pane to the currently active window". This is cool, if you are able to directly jump to the window where the pane should go to. Old people like me do not remember the window (number) where they came from and skim around until they find the window in question, try to remember the window number, jump back and forth from window with the needed pane and finally "join the last active pane to the currently active window". This is a bit cumbersome, but with "bind-key m" it is possible to mark the pane in question, skim around until one fine the window where the pane belongs and "join the marked pane to the currently active window".
tmux.conf: source user-specific local conf file ~/.tmux.conf.local To manage a user-specific local configuration file (like in Grml's '.vimrc.conf' + '.zshrc.conf') we need to source '~/.tmux.conf.local'. "bind-key R" (Reload Config) does now reload the 'main" config file '~/.tmux.conf' and the user-specific local configuration file '~/.tmux.conf.local'. With 'source-file -q', no error will be returned if the file does not exist.
zshrc: add `NOETCHOSTS` parameter `/etc/hosts` may be used as a denylist for undesired hosts on some systems. In such usage scenarios the file may be large in size and parsing it may severely impact shell startup time. For example, on a system with `/etc/hosts` from https://github.com/StevenBlack/hosts: ``` % cat profile.zsh #!/usr/bin/env zsh zmodload zsh/zprof source ./etc/zsh/zshrc zprof ``` ``` % ./profile.zsh | head -3 num calls time self name ----------------------------------------------------------------------------------- 1) 1 1181.93 1181.93 87.91% 1181.14 1181.14 87.85% grmlcomp ``` ``` % NOETCHOSTS=1 ./profile.zsh | head -3 num calls time self name ----------------------------------------------------------------------------------- 1) 2 79.77 39.88 47.37% 79.77 39.88 47.37% compaudit ``` Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>