Compare commits
4 commits
be4bc937b3
...
cffbfe10ef
Author | SHA1 | Date | |
---|---|---|---|
|
cffbfe10ef | ||
|
4cb811769a | ||
|
9905544608 | ||
|
f5b086c89c |
2 changed files with 20 additions and 11 deletions
22
.tmux.conf
22
.tmux.conf
|
@ -144,7 +144,7 @@ bind P choose-buffer # choose which buffer to paste from
|
||||||
# -- 8< ------------------------------------------------------------------------
|
# -- 8< ------------------------------------------------------------------------
|
||||||
|
|
||||||
%if #{==:#{TMUX_PROGRAM},}
|
%if #{==:#{TMUX_PROGRAM},}
|
||||||
run "exec sh -c 'TMUX_PROGRAM=\"\$(LSOF=\$(PATH=\"\$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\" command -v lsof); \$LSOF -b -w -a -d txt -p #{pid} -Fn 2>/dev/null | perl -n -e \"if (s/^n((?:.(?!dylib\$|so\$))+)\$/\\1/g && s/(?:\s+\\([^\\s]+?\\))?\$//g) { print; exit } } exit 1; {\" 2>/dev/null || readlink \"/proc/#{pid}/exe\" 2>/dev/null)\"; [ x\"\$(\"\$TMUX_PROGRAM\" display -p \"#{l:#{pid}}\" 2>/dev/null)\" = x\"#{pid}\" ] || TMUX_PROGRAM=\"\$(command -v tmux || printf tmux)\"; \"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_PROGRAM \"\$TMUX_PROGRAM\"'"
|
run "exec sh -c 'TMUX_PROGRAM=\"\$(LSOF=\$(PATH=\"\$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin\" command -v lsof); \$LSOF -b -w -a -d txt -p #{pid} -Fn 2>/dev/null | perl -n -e \"if (s/^n((?:.(?!dylib\$|so\$))+)\$/\\1/g && s/(?:\s+\\([^\\s]+?\\))?\$//g) { print; exit } } exit 1; {\" 2>/dev/null || readlink \"/proc/#{pid}/exe\" 2>/dev/null)\"; [ \"\$(\"\$TMUX_PROGRAM\" display -p \"#{l:#{pid}}\" 2>/dev/null)\" = \"#{pid}\" ] || TMUX_PROGRAM=\"\$(command -v tmux || printf tmux)\"; \"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_PROGRAM \"\$TMUX_PROGRAM\"'"
|
||||||
%endif
|
%endif
|
||||||
%if #{==:#{TMUX_SOCKET},}
|
%if #{==:#{TMUX_SOCKET},}
|
||||||
run "exec sh -c '\"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_SOCKET \"#{socket_path}\"'"
|
run "exec sh -c '\"\$TMUX_PROGRAM\" -S #{socket_path} set-environment -g TMUX_SOCKET \"#{socket_path}\"'"
|
||||||
|
@ -614,7 +614,7 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
|
||||||
# case "$_uname_s" in
|
# case "$_uname_s" in
|
||||||
# *CYGWIN*)
|
# *CYGWIN*)
|
||||||
# ps -al | tail -n +2 | awk -v pane_pid="$pane_pid" -v tty="$pane_tty" -v ssh="$(command -v ssh)" '
|
# ps -al | tail -n +2 | awk -v pane_pid="$pane_pid" -v tty="$pane_tty" -v ssh="$(command -v ssh)" '
|
||||||
# ((/ssh/ && !/-W/ && !/tsh proxy ssh/ &!/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ && $5 == tty {
|
# ((/ssh/ && !/-W/ && !/tsh proxy ssh/ && !/sss_ssh_knownhostsproxy/) || !/ssh/) && !/tee/ && $5 == tty {
|
||||||
# user[$1] = $6; if (!child[$2]) child[$2] = $1
|
# user[$1] = $6; if (!child[$2]) child[$2] = $1
|
||||||
# }
|
# }
|
||||||
# END {
|
# END {
|
||||||
|
@ -1500,11 +1500,11 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
|
||||||
# status_right="#(echo; nice cut -c3- '$TMUX_CONF' | sh -s _battery_status '$tmux_conf_battery_status_charging' '$tmux_conf_battery_status_discharging')$status_right"
|
# status_right="#(echo; nice cut -c3- '$TMUX_CONF' | sh -s _battery_status '$tmux_conf_battery_status_charging' '$tmux_conf_battery_status_discharging')$status_right"
|
||||||
# interval=60
|
# interval=60
|
||||||
# if [ "$_tmux_version" -eq 3500 ]; then
|
# if [ "$_tmux_version" -eq 3500 ]; then
|
||||||
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
|
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = \"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
|
||||||
# elif [ "$_tmux_version" -ge 3200 ]; then
|
# elif [ "$_tmux_version" -ge 3200 ]; then
|
||||||
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
|
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
|
||||||
# elif [ "$_tmux_version" -ge 2800 ]; then
|
# elif [ "$_tmux_version" -ge 2800 ]; then
|
||||||
# status_right="#(echo; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right"
|
# status_right="#(echo; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right"
|
||||||
# elif [ "$_tmux_version" -gt 2400 ]; then
|
# elif [ "$_tmux_version" -gt 2400 ]; then
|
||||||
# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right"
|
# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _battery_info; sleep $interval; done)$status_right"
|
||||||
# else
|
# else
|
||||||
|
@ -1557,11 +1557,11 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
|
||||||
# ;;
|
# ;;
|
||||||
# esac
|
# esac
|
||||||
# if [ "$_tmux_version" -eq 3500 ]; then
|
# if [ "$_tmux_version" -eq 3500 ]; then
|
||||||
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
|
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = \"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
|
||||||
# elif [ "$_tmux_version" -ge 3200 ]; then
|
# elif [ "$_tmux_version" -ge 3200 ]; then
|
||||||
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
|
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
|
||||||
# elif [ "$_tmux_version" -ge 2800 ]; then
|
# elif [ "$_tmux_version" -ge 2800 ]; then
|
||||||
# status_right="#(echo; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right"
|
# status_right="#(echo; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right"
|
||||||
# elif [ "$_tmux_version" -gt 2400 ]; then
|
# elif [ "$_tmux_version" -gt 2400 ]; then
|
||||||
# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right"
|
# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _uptime; sleep $interval; done)$status_right"
|
||||||
# else
|
# else
|
||||||
|
@ -1579,11 +1579,11 @@ run 'cut -c3- "$TMUX_CONF" | sh -s _apply_configuration'
|
||||||
# -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g')
|
# -e 's/#\{(\?)?loadavg/#\{\1@loadavg/g')
|
||||||
# interval=$(tmux show -gv status-interval)
|
# interval=$(tmux show -gv status-interval)
|
||||||
# if [ "$_tmux_version" -eq 3500 ]; then
|
# if [ "$_tmux_version" -eq 3500 ]; then
|
||||||
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = x\"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
|
# tmux run -b "exec sh -c 'trap \"[ -n \\\\\"\\\\\$sleep_pid\\\\\" ] && kill -9 \\\\\"\\\\\$sleep_pid\\\\\"; exit 0\" TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S \"#{socket_path}\" display -p \"#{l:#{pid}}\")\" = \"#{pid}\" ]; do nice cut -c3- \"$TMUX_CONF\" | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done'"
|
||||||
# elif [ "$_tmux_version" -ge 3200 ]; then
|
# elif [ "$_tmux_version" -ge 3200 ]; then
|
||||||
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
|
# tmux run -b "trap '[ -n \"\$sleep_pid\" ] && kill -9 \"\$sleep_pid\"; exit 0' TERM; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval & sleep_pid=\$!; wait \"\$sleep_pid\"; sleep_pid=; done"
|
||||||
# elif [ "$_tmux_version" -ge 2800 ]; then
|
# elif [ "$_tmux_version" -ge 2800 ]; then
|
||||||
# status_right="#(echo; while [ x\"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = x\"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right"
|
# status_right="#(echo; while [ \"\$(\"$TMUX_PROGRAM\" -S '#{socket_path}' display -p '#{l:#{pid}}')\" = \"#{pid}\" ]; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right"
|
||||||
# elif [ "$_tmux_version" -gt 2400 ]; then
|
# elif [ "$_tmux_version" -gt 2400 ]; then
|
||||||
# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right"
|
# status_right="#(echo; while :; do nice cut -c3- '$TMUX_CONF' | sh -s _loadavg; sleep $interval; done)$status_right"
|
||||||
# else
|
# else
|
||||||
|
|
|
@ -108,6 +108,13 @@ Troubleshooting
|
||||||
one, Powerline symbols will be broken.
|
one, Powerline symbols will be broken.
|
||||||
|
|
||||||
The alternative is to use the [Mintty terminal for WSL][wsltty].
|
The alternative is to use the [Mintty terminal for WSL][wsltty].
|
||||||
|
|
||||||
|
- **Will this work with the new [Windows Terminal]?**
|
||||||
|
|
||||||
|
Yes, yes it will. Here's a screenshot:
|
||||||
|
|
||||||
|
![image](https://user-images.githubusercontent.com/6472374/66804257-a8225d00-ef2a-11e9-901a-318a3a22151f.png)
|
||||||
|
|
||||||
|
|
||||||
[1681]: https://github.com/Microsoft/BashOnWindows/issues/1681
|
[1681]: https://github.com/Microsoft/BashOnWindows/issues/1681
|
||||||
[wsltty]: https://github.com/mintty/wsltty
|
[wsltty]: https://github.com/mintty/wsltty
|
||||||
|
@ -364,3 +371,5 @@ font.
|
||||||
![regedit](https://cloud.githubusercontent.com/assets/553208/19741304/71a2f3ae-9bc0-11e6-96aa-4c09a812c313.png)
|
![regedit](https://cloud.githubusercontent.com/assets/553208/19741304/71a2f3ae-9bc0-11e6-96aa-4c09a812c313.png)
|
||||||
|
|
||||||
[font linking]: https://msdn.microsoft.com/en-us/goglobal/bb688134.aspx
|
[font linking]: https://msdn.microsoft.com/en-us/goglobal/bb688134.aspx
|
||||||
|
|
||||||
|
[Windows Terminal]: https://github.com/microsoft/terminal
|
||||||
|
|
Loading…
Reference in a new issue