9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] window label
@ 2024-05-30 18:02 Romano
  2024-05-30 20:19 ` qwx
  0 siblings, 1 reply; 3+ messages in thread
From: Romano @ 2024-05-30 18:02 UTC (permalink / raw)
  To: 9front

The man page for window(1) has quite a few
flags yet one that I often wish were there is not:
setting the label. There's a separate 'label'
command, so the simplest I've gotten to starting
a new window with rc and setting the label is:

	window rc -c '''label mylabel; rc'''

The inner quotes are required.[1]

Here is what is documented in window(1):

	window [ -m ] [ -r minx miny maxx maxy ] [ -dx n ] [ -dy n ]
          [ -minx n ] [ -miny n ] [ -maxx n ] [ -maxy n ] [ -cd dir ]
          [ -hide ] [ -scroll ] [ -noscroll ] [ cmd arg ... ]

There are 3 different ways to set the size of the window
(i.e., '-r', '-dx/dy', '-min/max'), and two flags to
determine scrolling. To me, it looks like this might have
been an oversight or window(1) was developed when the
UI wasn't more fully developed (i.e., before a 'label'
even existed).[2] I'll only ask one question
for now: is the lack of setting label with a flag an
oversight or intentional?[3]

- Romano

[1] I haven't investigated much, but I think
    it has to do with the parsing of arguments by window
    to the new window. For example:

		window rc -c 'echo -n mylabel > /mnt/wsys/label; rc'

    Will complain in the new window:

		Illegal flag -n
		Usage: rc [-srdiIlxebpvV] [-c arg] [-m command] [file [arg ...]]

    Maybe /bin/window needs to set $cmd to $"cmd when,
    except in the $#xflag case.

[2] Also, '-m', which never brings to mind 'namespace'
    for me but I realize it's mean to signify 'mount' as
    explained in the manual, is like 'scroll' and 'hide'
    with respect to the other flags because they're ones
    whose current values I see which doesn't appear
    accessible in /mnt/wsys/ (or /dev) (scroll can be set
    via /mnt/wsys/wctl, and 'visible' wctl signifies the
    window is not hidden, but that's the extent of it
    as far as I can tell).

[3] Lastly, '-x' does set the label to execute a
    new command, but doesn't create a new window. This
    flag isn't documented yet I see it's used when '-m'
    is used to set the label automatically to the command
    being run. It might make sense to do the same thing
    when '-m' isn't used, too, rather than the 'rc DDDDD'
    default.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] window label
  2024-05-30 18:02 [9front] window label Romano
@ 2024-05-30 20:19 ` qwx
  2024-05-31  7:56   ` umbraticus
  0 siblings, 1 reply; 3+ messages in thread
From: qwx @ 2024-05-30 20:19 UTC (permalink / raw)
  To: 9front

On Thu May 30 20:02:14 +0200 2024, me+unobe@fallglow.com wrote:
> The man page for window(1) has quite a few
> flags yet one that I often wish were there is not:
> setting the label. There's a separate 'label'
> command, so the simplest I've gotten to starting
> a new window with rc and setting the label is:
> 
> 	window rc -c '''label mylabel; rc'''
> 
> The inner quotes are required.[1]

window 'label mylabel; rc' works as well.  Things can get hairy with
plumb rules which do have to use rc -c for quoting arguments and such.


> There are 3 different ways to set the size of the window
> (i.e., '-r', '-dx/dy', '-min/max'), and two flags to
> determine scrolling. To me, it looks like this might have
> been an oversight or window(1) was developed when the
> UI wasn't more fully developed (i.e., before a 'label'
> even existed).[2] I'll only ask one question
> for now: is the lack of setting label with a flag an
> oversight or intentional?[3]
> 
> - Romano

The window command is funky; -m is funky as well.  There has already
been discussion around it on the mailing list, I suggest you look the
threads up.  I don't think a consensus was reached in the end about
how it should behave.  "patches welcome" I guess.

Cheers,
qwx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [9front] window label
  2024-05-30 20:19 ` qwx
@ 2024-05-31  7:56   ` umbraticus
  0 siblings, 0 replies; 3+ messages in thread
From: umbraticus @ 2024-05-31  7:56 UTC (permalink / raw)
  To: 9front

> window 'label mylabel; rc'

or something like this:

; cat /bin/rci
#!/bin/rc -i
# persistent rc
if(! ~ $#* 0 && ! ~ $* ''){
	echo $prompt(1)^$"*
	eval $*
}

and then window rci label blah

umbraticus

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-05-31  8:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-30 18:02 [9front] window label Romano
2024-05-30 20:19 ` qwx
2024-05-31  7:56   ` umbraticus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).