From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from yow.a-b.xyz ([45.32.152.219]) by ewsd; Wed May 13 11:12:58 EDT 2020 Received: by yow.a-b.xyz (OpenSMTPD) with ESMTPSA id 9fc8f4e3 (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Wed, 13 May 2020 17:12:53 +0200 (CEST) Message-ID: To: 9front@9front.org Subject: Re: [9front] [PATCH] rio: add -label wctl param; improve window(1) Date: Wed, 13 May 2020 15:14:17 +0200 From: kvik@a-b.xyz 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: dependency realtime manager > Good in principle, I think, but just to note: if window(1) no longer calls > itself, users will probably have to change quoting in scripts which call > window. I may be missing something but I don't see how this would be the case. The arguments constituting a command are evaluated once by the calling shell and are passed into window(1), ending up in the $cmd list. Before or after this patch this list stays the same as it is passed along; specifically it does not get reevaluated until the final rc -c in either rio itself or in (new) window(1). Consider the example: fn nargs { echo $#* : $* } fn once { nargs $* twice $* } fn twice { nargs $* echo 'nargs '$"* rc -c 'nargs '$"* } ; once 1 '2 3' '''4 5''' 3 : 1 2 3 '4 5' 3 : 1 2 3 '4 5' nargs 1 2 3 '4 5' 4 : 1 2 3 4 5 You see that the initial argument list stays the same as it is being passed along, that is until another round of evaluation inside the rc -c subshell where the next layer of quotes is stripped. In the argument parsing sense removing the recursive call to window -x is the same as skipping the call to 'once' in the above example. > window -r 268 0 868 400 -scroll rc -c \ > '''label -f kprint; echo kprint; tail -f /tmp/kprint''' > window -r 0 0 128 128 colorclock_l > window -r 0 124 128 252 rc -c \ > '''font=/lib/font/bit/dejavusans/unicode.12.font; stats -Ime''' These commands run as expected with the patch. > Now I think of it, I don't really agree with window(1) setting the label > at all, but it's a minor point. I'm not a fan of automatic labeling either. Ideally the programs would set the label themselves if the user didn't request a name, but I don't think this is easily accomplished.