−ifs
This commit is contained in:
parent
76cd248697
commit
15689cb0fe
1 changed files with 4 additions and 6 deletions
10
sh/tmux.sh
10
sh/tmux.sh
|
@ -25,13 +25,10 @@ rwx_tmux_server() {
|
|||
}
|
||||
rwx_tmux_servers() {
|
||||
local active=\"\$(rwx_tmux_server)\"
|
||||
local ifs=\"\${IFS}\"
|
||||
local name path text
|
||||
local paths=\"\$(lsof -U |
|
||||
awk \"/^tmux:.*\\(LISTEN\\)\$/ {print \\\$9}\")\"
|
||||
IFS=\"
|
||||
\"
|
||||
for path in \${paths}; do
|
||||
while IFS= read -r path; do
|
||||
name=\"\$(basename \"\${path}\")\"
|
||||
text=\"\${text}\\
|
||||
#[fg=default]\\
|
||||
|
@ -47,8 +44,9 @@ rwx_tmux_servers() {
|
|||
#[bg=##282828]\${name}\\
|
||||
#[bg=##181818] \\
|
||||
\"
|
||||
done
|
||||
IFS=\"\${ifs}\"
|
||||
done <<EOF
|
||||
\${paths}
|
||||
EOF
|
||||
echo \"\${text}\"
|
||||
}
|
||||
rwx_tmux_status() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue