Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
86b39cfa
Commit
86b39cfa
authored
Nov 08, 2019
by
StelFux
Committed by
Marc Cornellà
Nov 08, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tmux: allow to define a custom configuration path (#7606)
parent
ef96a38f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
README.md
plugins/tmux/README.md
+1
-0
tmux.extra.conf
plugins/tmux/tmux.extra.conf
+1
-1
tmux.plugin.zsh
plugins/tmux/tmux.plugin.zsh
+6
-3
No files found.
plugins/tmux/README.md
View file @
86b39cfa
...
@@ -37,3 +37,4 @@ The plugin also supports the following -
...
@@ -37,3 +37,4 @@ The plugin also supports the following -
|
`ZSH_TMUX_ITERM2`
| Sets the
`-CC`
option for iTerm2 tmux integration (default:
`false`
) |
|
`ZSH_TMUX_ITERM2`
| Sets the
`-CC`
option for iTerm2 tmux integration (default:
`false`
) |
|
`ZSH_TMUX_FIXTERM_WITHOUT_256COLOR`
|
`$TERM`
to use for non 256-color terminals (default:
`screen`
) |
|
`ZSH_TMUX_FIXTERM_WITHOUT_256COLOR`
|
`$TERM`
to use for non 256-color terminals (default:
`screen`
) |
|
`ZSH_TMUX_FIXTERM_WITH_256COLOR`
|
`$TERM`
to use for 256-color terminals (default:
`screen-256color`
|
|
`ZSH_TMUX_FIXTERM_WITH_256COLOR`
|
`$TERM`
to use for 256-color terminals (default:
`screen-256color`
|
|
`ZSH_TMUX_CONFIG`
| Set the configuration path (default:
`$HOME/.tmux.conf`
) |
\ No newline at end of file
plugins/tmux/tmux.extra.conf
View file @
86b39cfa
set
-
g
default
-
terminal
$
ZSH_TMUX_TERM
set
-
g
default
-
terminal
$
ZSH_TMUX_TERM
source
$
HOME
/.
tmux
.
conf
source
$
ZSH_TMUX_CONFIG
\ No newline at end of file
plugins/tmux/tmux.plugin.zsh
View file @
86b39cfa
...
@@ -34,6 +34,8 @@ alias tkss='tmux kill-session -t'
...
@@ -34,6 +34,8 @@ alias tkss='tmux kill-session -t'
# Tmux states this should be screen-256color, but you may need to change it on
# Tmux states this should be screen-256color, but you may need to change it on
# systems without the proper terminfo
# systems without the proper terminfo
:
${
ZSH_TMUX_FIXTERM_WITH_256COLOR
:
=screen-256color
}
:
${
ZSH_TMUX_FIXTERM_WITH_256COLOR
:
=screen-256color
}
# Set the configuration path
:
${
ZSH_TMUX_CONFIG
:
=
$HOME
/.tmux.conf
}
# Determine if the terminal supports 256 colors
# Determine if the terminal supports 256 colors
if
[[
$terminfo
[
colors]
==
256
]]
;
then
if
[[
$terminfo
[
colors]
==
256
]]
;
then
...
@@ -43,7 +45,7 @@ else
...
@@ -43,7 +45,7 @@ else
fi
fi
# Set the correct local config file to use.
# Set the correct local config file to use.
if
[[
"
$ZSH_TMUX_ITERM2
"
==
"false"
&&
-e
"
$
HOME
/.tmux.conf
"
]]
;
then
if
[[
"
$ZSH_TMUX_ITERM2
"
==
"false"
&&
-e
"
$
ZSH_TMUX_CONFIG
"
]]
;
then
export
_ZSH_TMUX_FIXED_CONFIG
=
"
${
0
:h:a
}
/tmux.extra.conf"
export
_ZSH_TMUX_FIXED_CONFIG
=
"
${
0
:h:a
}
/tmux.extra.conf"
else
else
export
_ZSH_TMUX_FIXED_CONFIG
=
"
${
0
:h:a
}
/tmux.only.conf"
export
_ZSH_TMUX_FIXED_CONFIG
=
"
${
0
:h:a
}
/tmux.only.conf"
...
@@ -65,8 +67,9 @@ function _zsh_tmux_plugin_run() {
...
@@ -65,8 +67,9 @@ function _zsh_tmux_plugin_run() {
# If failed, just run tmux, fixing the TERM variable if requested.
# If failed, just run tmux, fixing the TERM variable if requested.
if
[[
$?
-ne
0
]]
;
then
if
[[
$?
-ne
0
]]
;
then
[[
"
$ZSH_TMUX_FIXTERM
"
==
"true"
]]
&&
tmux_cmd+
=(
-f
"
$_ZSH_TMUX_FIXED_CONFIG
"
)
[[
"
$ZSH_TMUX_FIXTERM
"
==
"true"
]]
&&
tmux_cmd+
=(
-f
"
$_ZSH_TMUX_FIXED_CONFIG
"
)
||
\
$tmux_cmd
new-session
[[
-e
"
$ZSH_TMUX_CONFIG
"
]]
&&
tmux_cmd+
=(
-f
"
$ZSH_TMUX_CONFIG
"
)
$tmux_cmd
new-session
fi
fi
if
[[
"
$ZSH_TMUX_AUTOQUIT
"
==
"true"
]]
;
then
if
[[
"
$ZSH_TMUX_AUTOQUIT
"
==
"true"
]]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment