From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 709fdf60 for ; Tue, 8 Jan 2019 14:54:15 +0000 (UTC) Received: (qmail 15292 invoked by alias); 8 Jan 2019 14:53:58 -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: List-Unsubscribe: X-Seq: 23830 Received: (qmail 20575 invoked by uid 1010); 8 Jan 2019 14:53:58 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f51.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.221.51):SA:0(-2.0/5.0):. Processed in 1.928141 secs); 08 Jan 2019 14:53:58 -0000 X-Envelope-From: francisco.borges@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=0RkWnxs7yYEZZ5dApeMG8ZCVDLsOpN4g7iJhMY+XxaU=; b=AdInZFSn6Nt5zPobGtzEQ1ZJvxyXswb6wg2UqO4kMz2M0Dp9XqAV3lfZLjqIZqdPzJ WfvTIF+GHhZcUCgIlg817kM9iS3/gUV9kPe2kI6MlLRsZRMMvL/4rtBa8IS9hGXubsnF tIDQkAU4Aqn/wHrFksNxjPoZapcoqhIkoBRgZ7HhHskCADVoLZ6p4mbkP4H+zTTeYbRf d4tNuFb9sLm/+S83+fltGE38qS8ibJECAjPuLwDtcXtKvPmwLymbuooYL2Q3T47qXF7t jtJQozpT/K6b+VH7uvgkNRsr+JXKCYFun/nht3XE4WBrWMr//iWz6X+kNzDn0q7udpge t33Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=0RkWnxs7yYEZZ5dApeMG8ZCVDLsOpN4g7iJhMY+XxaU=; b=L5C1SP0/o1Obvu3mOoQHHo26y6YHJwQDikF+kl3v14QfcedpzfGeaUOsxU/cxfnyaw bvArl+IvAbrh+2nc8FkLt7d7s8C+X0K9n7YTLbsSu1OUppPtvr6ANMUJLc/r4MkGrsLp GqA3F1NhoL97RA0t+uV7LB3rKvdSDOpA9Z905dCD4mvHzv7VEbBiUvI7GrLXm4cTp3rk l/a45aOTq8EIwx/7/hwzpasNpNNLgIR3PDPOFLBM9JErYNSEryLGs/gx6NeQgiS1GCPa pJaT4j7ZC2x7UY+S/HV/8DwtxOsuOCfcd2XCfV5WHom92BSocQmdn82puQoOzgoNxRlE gjaw== X-Gm-Message-State: AJcUuke5H4xF/bGCsFVnkZlZUyy/OCoMhvsZPOW9eGWPk6M90Le3ijDX PtLjA9bYIto48n5nIfw8T9Re4sjpbVFcf6l0AAscZHYM X-Google-Smtp-Source: ALg8bN4hXikw4wS11ySxUVKNEQ8EdfvVDq1CxV2VmN+ufVYZjBnuFr2w6EcBih9tBVNdeax7d/9lH6XRWWQvRCB46z4= X-Received: by 2002:a5d:530a:: with SMTP id e10mr1754440wrv.151.1546959231363; Tue, 08 Jan 2019 06:53:51 -0800 (PST) MIME-Version: 1.0 From: Francisco Borges Date: Tue, 8 Jan 2019 15:53:40 +0100 Message-ID: Subject: Always save first N bytes of output from all commands? To: zsh-users@zsh.org Content-Type: multipart/alternative; boundary="00000000000077b08c057ef38389" --00000000000077b08c057ef38389 Content-Type: text/plain; charset="UTF-8" Hi, Is there an easy easy way to *always* save the (first N bytes) of the output all commands? Or least save the output of the very last command? Something like always having | tee ~/.output_history/$TTY/${HISTCMD}.out but ideally with a control over the number of bytes written. Is something like that possible? Right now I resort to insert-last-command-output function (original by pws at http://www.zsh.org/mla/users/2005/msg00550.html while answering a question of mine...). To re-execute a command and insert its output in the command line. Sometimes it is fast enough and sometimes it is slow. I know we have "keep" (./share/zsh/functions/keeper) distributed with Zsh itself, but keep much like tee has to be manually inserted into the command itself and that it becomes less awesome. I work on OSX and I bet I can write AppleScript code to... somehow fetch the output and insert in the buffer but it I'd rather a (portable) Zsh-based solution. Any ideas other than going the AppleScript route? -- Francisco --00000000000077b08c057ef38389--