mirror of
https://github.com/samoshkin/tmux-config.git
synced 2026-01-03 00:08:01 +00:00
yank.sh. Use netstat instead of ss as more compatible solution
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -u
|
set -u
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ Installation
|
|||||||
-------------
|
-------------
|
||||||
Prerequisites:
|
Prerequisites:
|
||||||
- tmux >= "v2.4"
|
- tmux >= "v2.4"
|
||||||
- OSX, Linux (tested on Ubuntu 14 and CentOS7)
|
- OSX, Linux (tested on Ubuntu 14 and CentOS7), FreeBSD (tested on 11.1)
|
||||||
|
|
||||||
Personally, I use it on OSX 10.11.5 El Capitan through iTerm2.
|
Personally, I use it on OSX 10.11.5 El Capitan through iTerm2.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
@@ -22,7 +22,9 @@ elif [ -n "${DISPLAY-}" ] && is_app_installed xsel; then
|
|||||||
copy_backend="xsel -i --clipboard"
|
copy_backend="xsel -i --clipboard"
|
||||||
elif [ -n "${DISPLAY-}" ] && is_app_installed xclip; then
|
elif [ -n "${DISPLAY-}" ] && is_app_installed xclip; then
|
||||||
copy_backend="xclip -i -f -selection primary | xclip -i -selection clipboard"
|
copy_backend="xclip -i -f -selection primary | xclip -i -selection clipboard"
|
||||||
elif [ -n "${copy_backend_remote_tunnel_port-}" ] && [ "$(ss -n -4 state listening "( sport = $copy_backend_remote_tunnel_port )" | tail -n +2 | wc -l)" -eq 1 ]; then
|
elif [ -n "${copy_backend_remote_tunnel_port-}" ] \
|
||||||
|
&& (netstat -f inet -nl 2>/dev/null || netstat -4 -nl 2>/dev/null) \
|
||||||
|
| grep -q "[.:]$copy_backend_remote_tunnel_port"; then
|
||||||
copy_backend="nc localhost $copy_backend_remote_tunnel_port"
|
copy_backend="nc localhost $copy_backend_remote_tunnel_port"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user