mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-20 03:13:33 +01:00
Added automatic detection of OSX/iTerm2, fixed the wrapper to append -CC (iTerm2) to commands with arguments.
This commit is contained in:
parent
e55c715508
commit
26fe2d0944
1 changed files with 11 additions and 1 deletions
|
|
@ -13,6 +13,16 @@ if which tmux &> /dev/null
|
||||||
then
|
then
|
||||||
# Configuration variables
|
# Configuration variables
|
||||||
#
|
#
|
||||||
|
# Check if OSX
|
||||||
|
if [[ "$(uname)" == "Darwin" ]]
|
||||||
|
then
|
||||||
|
# Check if terminal app is iTerm2
|
||||||
|
if [[ "$TERM_PROGRAM" == "iTerm.app" ]]
|
||||||
|
then
|
||||||
|
# Set '-CC' option for iTerm2 tmux integration
|
||||||
|
[[ -n "$ZSH_TMUX_ITERM2" ]] || ZSH_TMUX_ITERM2=true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
# Automatically start tmux
|
# Automatically start tmux
|
||||||
[[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false
|
[[ -n "$ZSH_TMUX_AUTOSTART" ]] || ZSH_TMUX_AUTOSTART=false
|
||||||
# Only autostart once. If set to false, tmux will attempt to
|
# Only autostart once. If set to false, tmux will attempt to
|
||||||
|
|
@ -63,7 +73,7 @@ if which tmux &> /dev/null
|
||||||
# We have other arguments, just run them
|
# We have other arguments, just run them
|
||||||
if [[ -n "$@" ]]
|
if [[ -n "$@" ]]
|
||||||
then
|
then
|
||||||
\tmux $@
|
\tmux `[[ "$ZSH_TMUX_ITERM2" == "true" ]] && echo '-CC '` $@ || $@
|
||||||
# Try to connect to an existing session.
|
# Try to connect to an existing session.
|
||||||
elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]
|
elif [[ "$ZSH_TMUX_AUTOCONNECT" == "true" ]]
|
||||||
then
|
then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue