From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1728 invoked by alias); 12 Nov 2017 12:00:49 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42015 Received: (qmail 22031 invoked by uid 1010); 12 Nov 2017 12:00:49 -0000 X-Qmail-Scanner-Diagnostics: from aok120.rev.netart.pl by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(85.128.245.120):SA:0(-1.9/5.0):. Processed in 12.048486 secs); 12 Nov 2017 12:00:49 -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 autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: psprint@zdharma.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-Virus-Scanned: by amavisd-new using ClamAV (8) Date: Sun, 12 Nov 2017 13:00:28 +0100 From: Sebastian Gniazdowski To: Yuri D'Elia , zsh-workers@zsh.org Message-ID: In-Reply-To: <878tfc97d5.fsf@wavexx.thregr.org> References: <878tfc97d5.fsf@wavexx.thregr.org> Subject: Re: Automatic stdout/err redirection X-Mailer: Airmail (442) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 11 Nov 2017 at 16:12:54, Yuri D'Elia (wavexx=40thregr.org) wrote: > I've been thinking for a while about the ability to manipulate the > output of the previous command without executing it again. It's such a > common occurrence... > =20 > Imagine the following desired behavior: > =20 > - when executed interactively, each cmdline redirects the stdout to som= e > temporary =24=46ILE in =5Faddition=5F to stdout > - we want to fool the pipeline into thinking that stdout is still a TTY= > and disable buffering (I don't want any change in regular command > behavior) > - stdout though is not directly flushed to the pty, it's actually > filtered by something inbetween like =22head -25=22 that shows the firs= t > 25 lines only, and then shows a message =22truncated output=22 when thi= s > occurs, without flooding the terminal > - the full output is still available in =24=46ILE I've tried to approach this. I think it would require additional process = to accumulate the screen data, at least when adding to current Zsh. It is= somewhat doable, even with fullscreen programs, because it can currently= be done with Tmux: https://blog.plenz.com/2012-01/zsh-complete-words-from-tmux-pane.html So at least the most straightforward use cause =E2=80=93 complete words f= rom screen =E2=80=93 is doable. This hints that what would have to be bui= lt into Zsh is a terminal multiplexer. Nevertheless I've also tried with Zsh script code: https://github.com/psprint/ztrace This isn't a successful plugin because of the fullscreen issues, but it e= xplores the topic, I think. -- =20 Sebastian Gniazdowski psprint /at/ zdharma.org