From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 28706 invoked from network); 19 Jan 2022 14:07:03 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 19 Jan 2022 14:07:03 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1642601224; b=lrpHh95fcXP/G1+Q0LFXlDvvJpoxX4jBwbaEiAnM3fo1KyWCXVU9nG3ehlThjd9gUQ9U0jvCNT /6/6atw0iAPEkNf/q3V5BirX0bCJYBjFcSrldBZBXv2FDIqnHefLx+5Bx6P16cSy2AlMDV7Cc3 /Op9eFFQ+X25h2lKSW5Lffz7FvX7MTB67616O/42vKDTn1Gd8e8wUW/oR/o0+S/9f/HQ12c6/T 38jOASxdEAhS+6BRFvxu61I4Ukro8DeudrqGjHGvhyHaYSOfDVwPhxgUVxrEKUtusmKohb7TXT gtQ0SroGnprGJlqxlWP8Gzu5qNz0tc1Lq30YaeimT4Y8Vg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (wout2-smtp.messagingengine.com) smtp.remote-ip=64.147.123.25; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1642601224; bh=WOqqXwWR13woXC++uQspYNyJ/ocCb3SylND4GxFfTgU=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:To:From:Date:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=Uxey/dIA4JAoGAyy9nRSnB3Ucgntm+QmWgx+avT15LaU9jfjyHu2Y9M0qPl8fCkmwzQfs1oEAW eAkoOnGP2hGChTi2vBLGL4puVt1qJeSz20r2ba6tqH4gKw1IJ0Ea2VZ3nKVphJYvkgOca3og9M PInY74NrrX8oId5h7WqzGF+M+U1nCxYc/QvwfJyq8/I76a8jsdOAaMfX3xhBSS/1ObHXm01yYt 8ccVai3Q6NY0I+IK3w5j7EdcF5JS0f/8nayXiIVIu+lz57Sg/8akRRVQPA2SENaOAHeFbE/hS9 qVbvNGkz/RcG/Z/giYTfWeA903Vd7KHANhXFX5KroDS23w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:To:From:Date: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=kD4M6ucZP11GcM7i7GqZoj6uujpG6b+eVasbqsElJB8=; b=sRtEzL9tLMWUIRhvxh5sXvFG8P 94Wabe4YPfjs5RSBJZDK1BDya8QZVaYcMlUsSpRvs3G+tbEPpuVtpgq6JrDpxjG33oB18W6ZoZVs9 iSxk4MxysAh9jC1LEcLrf3V0cSdSeEbGUyBoEgdJU0HPeGvZZQNU7gMXUrOHpgj8DS3yfDxLfuX2R eA9jgkzt/xIo0woT11xyLBGoXpREH1eOI/vclW94BUH5SzugcaKDo2RJVzDZ1KfnKha3TT+PK553O 0X4gHBbkW/7lBq0M+pg9k11KPFAXjh0H5Dt2X01dPcnRtQJWeIJdnbRn3dEAonrqm3rXT52DRpCsL pdwCBu1A==; Received: from authenticated user by zero.zsh.org with local id 1nABc5-000KWM-QW; Wed, 19 Jan 2022 14:07:01 +0000 Authentication-Results: zsh.org; iprev=pass (wout2-smtp.messagingengine.com) smtp.remote-ip=64.147.123.25; dkim=pass header.d=daniel.shahaf.name header.s=fm2 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm1 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:57359) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1nABbR-000KDR-M1; Wed, 19 Jan 2022 14:06:22 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E9AB132007CF; Wed, 19 Jan 2022 09:06:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 19 Jan 2022 09:06:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=date:from:to:subject:message-id:references :mime-version:content-type:content-transfer-encoding :in-reply-to; s=fm2; bh=kD4M6ucZP11GcM7i7GqZoj6uujpG6b+eVasbqsEl JB8=; b=TrV6nCByxScUmzveksbPca12hx1QsqJO+mpfEMqHs4K4wTr5sNimnYBf Apcie39QOn6yoY3sweDZa7ItVoLHFwhOEn60NMwCMFDEexod0fjG5OEbpcTS/zJZ 5cRJiZH/BzbEqcVhKIjdwpDOUIDPG5upfLIl4cm/78HNTyz8sWhIQSz6DC47USlB lMJohjrLjTzoCh43t9clmCeApmzQmtRdZ1wHOQ4rZOPdk5POAIWZrvW0hAvVGwL2 6681NuKupEfbALeShOw7lhL5XnByAZB7bb92yg38yyuaoxOLk9ISPZLiZgAw9tCP LqEcTrtkyeOWgBv8yw7EdLZVZUDGGw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding: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=fm1; bh=kD4M6ucZP11GcM7i7GqZoj6uujpG6b+eVasbqsElJ B8=; b=fVKuk0M8RstaCOlctr/oR7pOSespLTfinDnk0ktnz2PMXtEdKDysoKta0 aqSEWT8BSFxXx2TTcXjOypPumSGUTKbBQES/oV9oGjKeEnESOFrNQ94oKHcFoWu4 S4jUoKtsnWtzGUlzHvxuMvifs0LoKcl/5kvr5KQ2WZ8pD3nLrT+elIL6JplBQncO HUKYpBIGh6BxJc9GtJ0U1CnyA4T7L9J2P98It1ucJvRTGcj6QhABCMtX6sT5Thd4 JUsp5oFUnsGmFu3RJKLh1AJCKdbPTTP/Vzow4iCraDwN/A2KudmVJZ5zhos6WqCt y2es/4HVRzl1QEBBmr2GP/JVx0Pdg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudeigddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfhfgggtugfgjggfsehtke dttddtredunecuhfhrohhmpeffrghnihgvlhcuufhhrghhrghfuceougdrshesuggrnhhi vghlrdhshhgrhhgrfhdrnhgrmhgvqeenucggtffrrghtthgvrhhnpefgleehtdffuefhge euleefffejgedttdelhedvvdeuiefhvefgvdfghfevvdekteenucevlhhushhtvghrufhi iigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurdhssegurghnihgvlhdrshhhrg hhrghfrdhnrghmvg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Wed, 19 Jan 2022 09:06:19 -0500 (EST) Received: by tarpaulin.shahaf.local2 (Postfix, from userid 1005) id 4Jf6r93Kykz33N; Wed, 19 Jan 2022 14:06:17 +0000 (UTC) Date: Wed, 19 Jan 2022 14:06:17 +0000 From: Daniel Shahaf To: Zsh hackers list Subject: Re: PATCH: Allow using STTY= to save terminal state Message-ID: <20220119140617.GC4371@tarpaulin.shahaf.local2> References: <20220118222414.2507-1-mikachu@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Seq: 49698 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Mikael Magnusson wrote on Wed, Jan 19, 2022 at 00:17:10 +0100: > That said, running ttyctl -f and ttyctl -u around a command is a bit > more work than simply prepending STTY= So perhaps we need some syntactic sugar for "wrap a command with a well-known pair of before/after modifiers". I'm thinking of something similar to Python context managers, where . with open("foo.txt") as fd: ... . is syntactic sugar for . try: fd = open("foo.txt") ... finally: # equivalent to «always» in zsh close(fd) . .