9front - general discussion about 9front
 help / color / mirror / Atom feed
From: "Ethan Gardener" <eekee57@fastmail.fm>
To: 9front@9front.org
Subject: Re: [9front] rio consctl behaviour
Date: Tue, 02 Jun 2020 21:49:21 +0100	[thread overview]
Message-ID: <b035931e-2e55-4657-84cf-65e53d2699fc@www.fastmail.com> (raw)
In-Reply-To: <12C7AF31406704D51DAFFADC11433F25@prosimetrum.com>

On Tue, Jun 2, 2020, at 9:25 PM, umbraticus@prosimetrum.com wrote:
> from rio(4):
> > consctl controls interpretation of console input.  Writing
> > strings to it sets these modes: rawon turns on raw
> > mode; rawoff turns off raw mode; holdon turns on
> > hold mode; holdoff turns off hold mode.  Closing the
> > file makes the window revert to default state (raw
> > off, hold off).
> 
> I am wondering if there is a reason for the behaviour described in the
> last sentence.  It seems like it would be convenient to be able to
> just echo holdon > /dev/consctl rather than do the dance in eg.
> /rc/bin/hold to keep the fd open.  I have commented out
> /sys/src/cmd/rio/xfid.c:328,335 in my local copy and nothing seems to
> have broken...

There is a good reason applicable to raw mode. When a program exits, however it exits - crashes or whatever, you want the console restored to cooked mode. The way it is now is a simple way to do this, an open file will be closed by the OS if the program crashes. How reasonable it is to apply this same logic to hold mode is perhaps debateable.

I briefly thought failure to end hold mode would confuse users, but then I realised I only thought that because I'm used to 9pm, which has no color. ;) It doesn't indicate hold mode at all. This former lack of color might be why hold mode is tied to keeping the fd open. (9pm was ported in 2002.)


  reply	other threads:[~2020-06-02 20:49 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 20:25 umbraticus
2020-06-02 20:49 ` Ethan Gardener [this message]
2020-06-02 21:53   ` [9front] " umbraticus
2020-06-02 21:57     ` hiro
2020-06-02 22:50       ` Silas McCroskey
2020-06-03  2:01         ` umbraticus
2020-06-03  7:37         ` hiro
2020-06-03 20:00           ` Silas McCroskey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b035931e-2e55-4657-84cf-65e53d2699fc@www.fastmail.com \
    --to=eekee57@fastmail.fm \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).