From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2324 invoked by alias); 3 Jun 2016 18:33:59 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21608 Received: (qmail 9657 invoked from network); 3 Jun 2016 18:33:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=7uDpN9EGsBeyTRlJ7QeCgnij2RWSiAwtYb4LoAnhrYo=; b=Y6RIWu6E2uqFPWNk3DknjIkZQ+FY95nLuVoD4YFRPtylJTZ8C4HnnMAVk2bS8Wu8dR Xil/aYdjYYHNfZco7XEEJWEvagzAT34/NOSedhYzMBlNXkhpInpXm0KsZhdKgal6dcb5 WLNqtObTSCXoX0rlHE6C55/6Far0b7FLYspRdcVS/9brj4NMoPRE1US/YfjA/avEPm+r uP+T1UStBfcEAuPGfdPMtVFsN+6VfO1VTDNqewbS3pVf6I4O6Z++CsqytllKFt98nSDc K+BMJWKZyD3k5lADayN7xg9K0nxo1byYkr3g8PcpiImbxSW12aYqWM3eaSK1y457euJX 3H7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=7uDpN9EGsBeyTRlJ7QeCgnij2RWSiAwtYb4LoAnhrYo=; b=AdDi+xVzhaqD0kAq36Jk7YjSmXtqlcX9GW/1udCvWgatbu0OpEJkgoi0AVM7CrdDGz BH0qHFOKL/5J9YKGbL6/TZaF2wt6x3cb2I03jd+yH+xSgOc4X0Hq3XQnK14XkzVNi1Vs TQG+YWG1ESro3esIf+tijbsexCvMpQeWzhNGhHB2NKbHd8giW8W4803h1L0cJVIYAgCd /xnGroP3cuofczqkzTxX784I0XofU2Nf/UqNyzMEFKg0IxgPFzNt4kykxxppUvkqDNS8 qrwBDrfFBXFyZQSl1VbLjOXhWtvf1AgIncuxdDCM3L3QgKvjtVnl4fp6c8sb5YZtKVye VhjQ== X-Gm-Message-State: ALyK8tKEGpQ7k9pXwoYIGYbQRbV/O0aOCAzMbPUcBXUBtFAkUzZSIszkUlh5UP4ulA6ePQ== X-Received: by 10.66.217.202 with SMTP id pa10mr6742071pac.29.1464978834723; Fri, 03 Jun 2016 11:33:54 -0700 (PDT) From: Bart Schaefer Message-Id: <160603113354.ZM24367@torch.brasslantern.com> Date: Fri, 3 Jun 2016 11:33:54 -0700 In-Reply-To: Comments: In reply to Sebastian Gniazdowski "Re: Mark descriptor as terminal for the -t test" (Jun 3, 6:30pm) References: <160601214528.ZM14311@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Mark descriptor as terminal for the -t test MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jun 3, 6:30pm, Sebastian Gniazdowski wrote: } } A robust program, the script. Recalls asciinema. The other way around, really: "script" has been around for decades. } Turns out the commands are not so confused. Either they assume there } is no terminal, and strip terminal control codes from output, or } ignore the fact (e.g. vim) and work well. The third thing that some programs do is to look harder for a terminal, e.g. examine all of stdin/out/err with isatty() and direct all I/O to whichever of them is found to be a terminal. (Recall the discussion of a few weeks ago regarding descriptors opened for both read and write even though in practice they are only used for one or the other.) } to strip control codes, but have no motivation to do so. The dream of } "reuse output without mouse" is better to be implemented at terminal } level. Output that is screen-oriented rather than stream-oriented is also not suitable for re-use anyway, at least not directly. You might also look at Functions/Zle/keeper for a related idea.