From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by ewsd; Tue Jun 2 16:49:43 EDT 2020 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 5E6A05C013C for <9front@9front.org>; Tue, 2 Jun 2020 16:49:41 -0400 (EDT) Received: from imap35 ([10.202.2.85]) by compute1.internal (MEProxy); Tue, 02 Jun 2020 16:49:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm3; bh=YUmVpxK45z2tGSOr90zpONERf181bWa EflivBqNrmw4=; b=l0xK23NTFn40uMbL7SDx94+7I5j9NQaQAsBmCucTm6IK5Va 2JRNE3ooXUhTOIyCOxofEyL3AMAyK2kFk9f3EwgFEX3vabYVCVQMieouqVsefG7m ccO4OJ19iLrXLESOMvEkMk9jGOLebiohHx4KCpSyNvmxlNbEPXADjWupXT/+Irss WoM/TK69762xdWovGQx9sewJAm1yLCDfeOw0s3zrfaObV/m2KPvei3RlzB3/uM5T gQvx+2TRPm5IwKMCS/LdE2WEaLaEcrZN226PkOF4pC/A8PhaLYPUl4ksvglK4Rv2 Icodbkorxe5ou2KfxBNHysJsl0nTEmIcInFE52w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=YUmVpx K45z2tGSOr90zpONERf181bWaEflivBqNrmw4=; b=Tg4fe0sELW26/8hDweOvbv EJaRkVR3b4IW9BlnCYb6MXcr755OpXfElMKpM4D5O/ekeL8v4Qz3qU8/NL7CRPZp op3HEopHMWwcqIHWyuBrMPii/3AQdcroNBtsPu6WnbwO9PlTMzceJvHDggbO3qKg O+UH0f1IYYecOa5A57wU9AZc/VUyeowdY2Dp4Yl+B5r3Olo1Swa99IzkobFKscAE 56IGTT/OCWXYqtUAHiiHFgxKhPIQLsMKOdTJ6NGq4rx6vIl2H6qXH9dmY+NTyIAG u4JLfnBdkbq+8QM1WJ3B6oZ6+poCrMDC018iA7sL42mAHzy7iW9HaJyjh0/9tSYg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudefjedguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesth dtredtreertdenucfhrhhomhepfdfgthhhrghnucfirghruggvnhgvrhdfuceovggvkhgv vgehjeesfhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepffdvtdehgeekfe efgfeufeejudetvdfggfffkefgjefhteekgeevjedvfeeuueeinecuvehluhhsthgvrhfu ihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepvggvkhgvvgehjeesfhgrshhtmh grihhlrdhfmh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id EABE814C00DC; Tue, 2 Jun 2020 16:49:40 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-dev0-519-g0f677ba-fm-20200601.001-g0f677ba6 Mime-Version: 1.0 Message-Id: In-Reply-To: <12C7AF31406704D51DAFFADC11433F25@prosimetrum.com> References: <12C7AF31406704D51DAFFADC11433F25@prosimetrum.com> Date: Tue, 02 Jun 2020 21:49:21 +0100 From: "Ethan Gardener" To: 9front@9front.org Subject: Re: [9front] rio consctl behaviour Content-Type: text/plain List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: encrypted table-scale full-stack component information locator 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.)