shithub: gridchat

Download patch

ref: 6e888a6b82b18cfcbcd80e5bde6edd29fd083231
parent: e5c7367c265358d21e2268c7e54f3340d1d3998b
author: grobe0ba <grobe0ba@tcp80.org>
date: Mon Jun 17 17:56:08 EDT 2024

use a clonesrv

--- a/chat
+++ b/chat
@@ -36,5 +36,5 @@
 }
 
 rfork ne
-window 0,0,620,1033 rio -b -i 'rc -c chatstart'
+window 0,0,620,1033 newsrv 'rio -b -i ''rc -c chatstart'''
 
--- /dev/null
+++ b/newsrv
@@ -1,0 +1,12 @@
+#!/bin/rc -x
+
+rfork ens
+
+<[3]/srv/clone{
+	id=`{<[0=3]read}
+	<[3=]@{ # close the clone fd
+		rfork n
+		bind -c /srv/$id /srv
+		rc -c $*
+	}
+}