commit 9cb3dfc6f0ad29c2b7e54824bf4a217798284fcf
parent e0024384857403d549842a51225bc36432dd384e
Author: Jan Pobříslo <ccx@te2000.cz>
Date: Sun, 4 Jul 2021 14:03:46 +0000
Allow connecting to specific ssh port from plumb message
Diffstat:
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/bin/handle-nsx11-message b/bin/handle-nsx11-message
@@ -17,6 +17,7 @@ nag() {
in_terminal() {
spawn-pty.py "$terminal_env" " $^@" "" "$terminal_cmd[@]"
}
+typeset -f -t in_terminal
adjust-brightness() {
local backlight=/sys/class/backlight/intel_backlight
@@ -80,7 +81,7 @@ abduco-run() {
socket=( /run/containers/$container/run/abduco/$USER/$session@*(=N) )
if (( $#socket == 0 )); then
if [[ -n $cmd ]]; then
- if out=$( 2>&1 s6-sudo /run/containers/$container/run/exec/exec execlineb -c "abduco -n ${(qqq)session} $cmd" ); then
+ if out=$( 2>&1 s6-sudo /run/containers/$container/run/exec/exec execlineb -c "env TERM=rxvt-unicode-256color abduco -n ${(qqq)session} $cmd" ); then
socket=( /run/containers/$container/run/abduco/$USER/$session@*(=N) )
if (( $#socket == 0 )); then
nag -m "Session spawned but no socket found."
@@ -193,6 +194,12 @@ case $data in
(x11!*)
x11-run "${data#*!}"
;;
+ (ssh!*:*)
+ local ssh_hostport="${data#*!}"
+ local ssh_host="${ssh_hostport%:*}"
+ local ssh_port="${ssh_hostport##*:}"
+ in_terminal ssh -t -p $ssh_port -- $ssh_host
+ ;;
(ssh!*)
local ssh_host="${data#*!}"
in_terminal ssh -t -- $ssh_host