From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mimir.eigenstate.org ([206.124.132.107]) by ewsd; Sun Nov 1 14:58:47 -0500 2020 Received: from abbatoir.fios-router.home (pool-74-101-2-6.nycmny.fios.verizon.net [74.101.2.6]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 1fe43ff7 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Sun, 1 Nov 2020 11:58:37 -0800 (PST) Message-ID: To: echoline@gmail.com, 9front@9front.org Subject: Re: [9front] bug with drawterm -G then rcpu Date: Sun, 01 Nov 2020 11:58:36 -0800 From: ori@eigenstate.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: stable decentralized firewall realtime element hardware > I found that when I drawterm -G then rcpu from inside it, the default > lib/profile fails with "null list in concatenation." this seems to fix > it but I'm not sure it's the best way: > > --- /sys/lib/dist/usr/glenda/lib/profile Fri Oct 4 17:33:29 2019 > +++ lib/profile Tue Oct 27 19:20:06 2020 > @@ -19,7 +19,7 @@ > bind -q /mnt/term/dev/consctl /dev/consctl > >[2] /dev/null { > cp /dev/sysname /mnt/term/dev/label > - if(wsys=`{cat /mnt/term/env/wsys}) > + if(wsys=`{cat /mnt/term/env/wsys} && ! ~ $#wsys 0) > wsys=/mnt/term^$wsys > } > bind -a /mnt/term/dev /dev This is a hack. The issue is that wsys=`{...} creates an empty variable if the command fails. How does this look? --- a/sys/lib/dist/usr/glenda/lib/profile Sun Nov 01 11:56:26 2020 -0800 +++ b/sys/lib/dist/usr/glenda/lib/profile Sun Nov 01 11:58:15 2020 -0800 @@ -19,8 +19,8 @@ bind -q /mnt/term/dev/consctl /dev/consctl >[2] /dev/null { cp /dev/sysname /mnt/term/dev/label - if(wsys=`{cat /mnt/term/env/wsys}) - wsys=/mnt/term^$wsys + if(test -f /mnt/term/env/wsys) + wsys=/mnt/term^`{cat /mnt/term/env/wsys} } bind -a /mnt/term/dev /dev prompt=('cpu% ' ' ')