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,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9698 invoked from network); 18 Dec 2020 08:45:30 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 18 Dec 2020 08:45:30 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1608281130; b=h/IZlYH9RMe9Oi1x/7wd9Qgb+9xVstnWNbSlzuvqAHUDUPfoLwqGaK0RhVpaKEBowNXyq/4Evz V07iSsy6nqDddDXzGbJ/4n0WHczzHE2XNW52VuanfeuzA5pusAuwPWzzKErExmx/KJY1jtvJWJ GUxCE7hJzAtz/toW1j1GtCd4dPtcj1QJmoYcIWtUuSAa9qHtywpn/NQUuwqVyjLQ3Ki9+zvitD FI4IG9LwJrBkcmd3f6xrl75DdZf0HUCu6Me/6zHMtauvaHqMwLeXTXlNdCBOr4YHGbeILxUsIN RszVFgzeJ2sq8huW5ErMQzaGKtkH7pHLAToEBxGc8pHZ5w==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-io1-f51.google.com) smtp.remote-ip=209.85.166.51; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1608281130; bh=2wEfB1+p6/7NP7PcT+e3eV8dyZlABI5HESYLXI2bemc=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=rvngcQd0YoQ3KF1ni27Z0jzaa4JrCtPRp9Z421soWMKhUiqy+O2Td5G23pQXmw7Z7jltfzwr30 gGuHYDe9uU+PrwJqUS0Mai6yJRq6tvMs0vHHFOA3AzTCa9pj8a8ZnBJer0Okvo3B/hOAOdZ3sh IlGb6tikRK3dNFzvQyWIN25pCmwp2UFBZlxk9w38tP2lpKii9L5UZKS6nM0mXNiCo0pPs4Ogh8 p2NerHh0AXNdW/9LlrWnervrEBKfoTP6Rzcil7kAphVNdC2tfHOhIy/pOrgF5yEottW3tlvJ10 3JfAUs/8LXPlS78wp4AhF+rW6X1WnUlnsYwMUIMF+xvqaw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=2wEfB1+p6/7NP7PcT+e3eV8dyZlABI5HESYLXI2bemc=; b=O7m0qY1zFC559dHZH2epDPBulg pXJLfSMvhzPbd3g5xoUPP/8ALxPTryJgDj7D10WcfiiX7TJldi5yqfv+5enWcZK0KZVnbRAc9t2g2 PHyQuVlI91+YOKwaATzMXvq9cTrPkpeanMNUcPv/d7ct7F0dokS9hUluyXuSTRJx959Z2DypSYUy8 stZ6xLf1ghfb/qLvn6maH5qLctZmyzY+GViPpqDuF4g4EuvyvmMxIkktRqUBBfTgiHgJOlAC7ook7 /Xg50gxdhdAMfwar5WxO/9HKW6+fSh+xHNZ4QML/zFNTT4AAKADBIZgXWJTBHrrnj5re7lwa/Ua8H 6EwZC3Ig==; Received: from authenticated user by zero.zsh.org with local id 1kqBOB-000Pjb-Ap; Fri, 18 Dec 2020 08:45:27 +0000 Authentication-Results: zsh.org; iprev=pass (mail-io1-f51.google.com) smtp.remote-ip=209.85.166.51; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-io1-f51.google.com ([209.85.166.51]:44527) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1kqBNi-000PM8-Bj; Fri, 18 Dec 2020 08:44:59 +0000 Received: by mail-io1-f51.google.com with SMTP id z5so1312058iob.11 for ; Fri, 18 Dec 2020 00:44:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2wEfB1+p6/7NP7PcT+e3eV8dyZlABI5HESYLXI2bemc=; b=jVowrfKyXPKrEXEGz/pYSTQT4WvZ0heMVlnYU3ndKktZGdRIYuwTU5ehFFuzGjz1J/ knP/kKgOnSbZ2bdeCbWmcQFqAWxWcGbvVagqkpCvkaSTXZq41m6Pm7/ebEERTR2FRxLN mjVgXBb54BU7bh8ctaP6mrT6x7dqd4PrWO6U6d3BVweuSsG6utlueQPVL6LyjPSq7hXC w4jLf2h9MDfU8LhxUelkFReOJOD8xfTcAIK5OGyOhJlC8IdWpNju3EXIBo3x/2JgdhuA bs40gNJQ7w8zvtuAXd22/nINDycA7mpKPko56/B/EByaxvZvqHS5YVxyT6c7xM0cofhz iNTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2wEfB1+p6/7NP7PcT+e3eV8dyZlABI5HESYLXI2bemc=; b=shTAqjAzQVxr4DtohBqii9SFal1ceAlmQB3nqQjIdKWwvlYXnP0Maz6ar9K24NcJDw P7SXwCuhC8uQicMN5Ihca5u1jwWacH0fJ+6HF0N8oz2gucl0FSF1sHYtDHGZZxzB74hC skKmPONhc16C65fTwdQXBpxCy7K5gtKMLqihW1XcG7qMLKIcBVxoypeLjLsyirhgli8L 29CuT9P6X4pLe+NYPhywD6Dvo5mHgOizi8FnMid4tjKBS05BmrqrUQoSaiSaT4HdrSo8 5zPJVbkF8p9QxjmGUPPIwFvPdzhu7B1S+FwYRl9mAHEZjnEJwcaWwbstDVWlWEvuNUEV 5x8A== X-Gm-Message-State: AOAM530MWZMf3I7CUhOmwxK0ED9WWiCNvofsXLlS0JmSjszp9mII0wYB 7r0RyQuO1KkGOOwUvNebCSX/1pzM6+46Ow9afyfyNoKZZNdcMg== X-Google-Smtp-Source: ABdhPJyYBQnQLRFj3O3OoFIDXnZamu++qdvGS0DyrTeNyuq+fZpzhgDsoFNmgnGj8uYyObd2KZy84N20w2xrfRyCACE= X-Received: by 2002:a6b:441a:: with SMTP id r26mr2813901ioa.105.1608281097006; Fri, 18 Dec 2020 00:44:57 -0800 (PST) MIME-Version: 1.0 References: <2125772511.25490373.1608257220571.JavaMail.zimbra@eseth.com> <20201218061536.GA128900@ellen> In-Reply-To: <20201218061536.GA128900@ellen> From: Roman Perepelitsa Date: Fri, 18 Dec 2020 09:44:45 +0100 Message-ID: Subject: Re: Cursor save/restore is redrawing over existing output To: Seth House Cc: Bart Schaefer , Zsh Users Content-Type: text/plain; charset="UTF-8" X-Seq: 26234 Archived-At: X-Loop: zsh-users@zsh.org Errors-To: zsh-users-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-users-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: On Fri, Dec 18, 2020 at 7:16 AM Seth House wrote: > > I'm experimenting with the (probably dumb) idea of only displaying the > output from a single command at a time for a rudimentary TUI-like-thing. > > For example, if you type `ls` the directory listing appears below the > prompt as normal, but then the cursor returns to the original row and > clears the prompt so the next command you type, say `uptime`, outputs as > normal but also clears the directory listing output. The idea being that > you can run several commands in succession without moving the cursor or > scrolling the terminal. I also prefer my prompt to stay at a fixed position. However, having command output *below* prompt is not a good idea. I've listed a few reasons in https://github.com/romkatv/powerlevel10k-media/issues/2#issuecomment-725415740. What I do instead is put prompt *at the bottom* and make it stay there. The latter is a bit tricky because completion listings can push prompt up. With a bit of work this can be changed so that completion listings appear above prompt in a sort of temporary overlay. This setup is quite ergonomic as it allows you to position your terminal window so that important information (prompt and the end of the output of the last command) is always at the same position. You can see it in action here: https://asciinema.org/a/372068. You can also try it in docker: https://github.com/romkatv/zsh4humans/tree/v5#try-it-in-docker. Roman.