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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 8275 invoked from network); 31 Dec 2022 05:21:16 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 31 Dec 2022 05:21:16 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1672464077; b=Ln38BXT1zlGsB/ok7+9bn47Qb6ig9PofQhdX+TM5RPwtAHcy0kwrE7wsR7fiQVC0l8PROQvy7G jZtQ3qF6kEr3JoVUtmIZLBUJjuzc0GQ/Pi98OELEeU0IKeTnXgmaChwk/sRTf30k/Yfdzzac6N wlcVilZAqkk2EH35naQJXUWxwnt3XkJsEITm4Whc8zH+8c0SMS+wthVzjjc/TlWBQJsYJ0N9rz 8JzeR27MnZiZ2Bd9DmfGavCDaxC6basQibHSmY/+FPi+ewfqwGI3GmDz5ujvyK5lN5M8UMj4J8 K3F2iPhc/2+gc5Y3JEdcH/ZLJbtI5ajbKyX7IbQ6c3eTZQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1672464077; bh=KTZhbRdI6AKs/djjRj+OrkUX1W2pmaenY0Wf0WVUsi8=; 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=T22J8BT9joVelXt89yqhPC3PEsboSUH5V4/soC20Fn6YDdngMSForUTkHcvfXAfJ0i5AbYROvJ N2/nzoO7Z6b1DSahS6akZWn0Bf4mM16isAAHE2VBg8Dnd7RdOdBx2r8xVzSasjiRW11UbUe3MW Wd2BMcfhZTMP5tWywHFtl5Z6footSjHk9ovcLDT+iTdCWhrnMsI11asoYTfCYuvhI3yGP0GocN O/QMCamJjfb4uDG8fDK9P4ygoAn34tPw5tlrWiQRdWZOH8dgwzU8Bp1VN8eImdeqX3G/ZhFrjo gIPyxg/Op/Hus4MUKOuEGDgjWtw0Zau1ntzYMEhOyyEBeA==; 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: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=wJfnfS4i5NS2EEoGVfp9EauVNU8aw3wedNUfbATVJvQ=; b=lQ/TVeLnHUuLGa1Bz0psk/f7oT FiQJHcntgu9nhVTa/b0hAO2hlUqM5lhVgxELZvR4MshxKK2AA1QYw7qUBoTH1SUKJURd9FQXSIALI TIJOtDhsJwLXgQGRVmoo7y0vFQcsFrAN8t4VWbOXnf2bvnRwY+Oaj3AzQHEZQ0RJxnu8SlEkw1i5P Bi/I4f0iVxj+PeS3w0/nAi/FNTyMonFqSjZkzIONDjhZrqIINrAnRDcF7uBdsWnn+I40YguTC1bkx 23mw9j1AaOvPAZGeMuBliXccSPRfXoKX9OMzLD8HNXokksYHFGvuedGd3VcueuT5N5v0+gPzCrWVL oHgYAJug==; Received: by zero.zsh.org with local id 1pBUJ1-000Mwi-8m; Sat, 31 Dec 2022 05:21:15 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f48.google.com) smtp.remote-ip=209.85.218.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f48.google.com ([209.85.218.48]:42895) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pBUIl-000Mfd-En; Sat, 31 Dec 2022 05:21:00 +0000 Received: by mail-ej1-f48.google.com with SMTP id tz12so55455401ejc.9 for ; Fri, 30 Dec 2022 21:20:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wJfnfS4i5NS2EEoGVfp9EauVNU8aw3wedNUfbATVJvQ=; b=Mm2qbfolqlybtmUKXdlLIovsvm56z2wUbTwjWYDMJlTAz4S7xEP8JZBquOOJzNU7uA cAwdeQO+E1egOpu7sHn/b5JsCJmtArp4f4Qbp1XGEeRYl12J+dvez3gjXC5Egizlt9Zj azaaimjoa7SB+WCwOtFxy0+48WvETB2/qv4i75yOB+U8RKUXAtzrQIXxE2wS9pAqz9WP JDfCOLUZtyZcVVcHq7a7cfqm6UA3KZYGWKHVA9+R4TsmcEXQEKfNfGF1aQ6mQ74R8o3X l0xtQ6+TyoX8mYIgxhYBkQLxIZyu80aKtZ0hzFqYf9pyaZ4lSWST7Si6GbX52fbeykLn QUrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=wJfnfS4i5NS2EEoGVfp9EauVNU8aw3wedNUfbATVJvQ=; b=QuI/nl8LgPDVrRmAZj4AGUvezzSOPinbU3qEQrC+xcOvKFtnv2XPsy//QPVS/rVLux eGLdFuP1FOnz/zl0yeAymdKWeTIZzVY4zQ1nB8p+x/LjYDfyXS4FB352T8VSsT3hZZQg oY5T0LAMQSVs5e52dQVeFPlmiY2x/4t4ul4Ox+de6lC/huUmx7SCBcdy5TrBVAYEi7Jl OvhEW4zgn2tdaaKraREt3zev9O5v2rMjuXdZB2tC/wxMMNsKju4YvtiXGDxgVl9e1111 Z4txsSIIDx4qCOmTRx6hCo4/Ehlrl0WUMWv2eQm8/e9RVlGezOYWhiSTMAQaogGOdtNf np0w== X-Gm-Message-State: AFqh2kquD0YXJBPzqvAaFp8X47raFF4PzZyGfaAARhA6EUOndk7wHhwe BTdM2q6GRt9ne0kKszXsZ7Z9m4Xm/ok6CJngVy5tgYLnkUpPsRnFim4= X-Google-Smtp-Source: AMrXdXuCt4QvcKVym5AH9ww3yRX79wlIy4VnUI8yZ25cAF60gRAjwq0hk+Hm1edQOznQJd1q5CELnNcC/Hf7CcrBs2g= X-Received: by 2002:a17:906:7d4:b0:7aa:23ac:608e with SMTP id m20-20020a17090607d400b007aa23ac608emr1790307ejc.450.1672464059106; Fri, 30 Dec 2022 21:20:59 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Fri, 30 Dec 2022 21:20:48 -0800 Message-ID: Subject: Re: Read a line from user without clearing screen below the prompt while allowing user to use arrow keys to make edits in middle of line To: OG Code Poet Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" X-Seq: 51266 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: On Fri, Dec 30, 2022 at 7:52 PM OG Code Poet wrote: > > Here's some more context. So ... vared sends the clear-to-end-of-screen before printing the prompt, then starts ZLE and clears again after ZLE exits. This means your job, in creating a workaround, is to move the cursor to the lower right corner of the screen before calling vared, move it to the desired position before printing the prompt, and move back to the lower right again before ending ZLE. This translates approximately to: to-lower-right() { tput cup $LINES $((COLUMNS-1)) } zle -N to-lower-right tput sc to-lower-right vared -f to-lower-right -p "%{$(tput cup 0 0)%}Enter something: " ... tput rc Other tricks may be needed to keep a newline from being output when pressing ENTER to accept the edit. If this is unsatisfactory, you could try using zcurses to manage the display, which I think would allow you to always redraw whatever vared erased.