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 11654 invoked from network); 9 Feb 2021 08:18:47 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 9 Feb 2021 08:18:47 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1612858727; b=NKdUE9iDjMDDt9cs6zZSe1xlt82MsJoON1u0mcae6aBBDiDUJV42EJfr0222rQEojDLYaAt0Si S5FId4iUdADD7fcdiR0m7Ec5mE/uO4oeyYmjmp8caXuJOINPzDCOyS/vNtAvwSi+lC6ajXq3HY dHu4XhxemN5IA4JYwdxi6tq4+u8UiQXKqVb010I00DBdcp3S8tmbxqJAJvdaaAjqHI5AdYetnf feXrTJ8K13wdCooqtTnhKwbcsNt3Tr0BdNdDG1bUAgvKWx9Owa/o2VtAAm2MnE0iFVPkKrrzSh c2IVvajggMXPdr2DnHqnSTfoQgngb9TONrhqsVixwQOpHA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.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=1612858727; bh=fgmaUlK1yuBCvuh82rRmgL4IYvLB+awIkIhJk+ZM3EY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=tiWwKhLFjZ2tSccDgyNz0tUrYe3rWFdIPL6oKna3oaZ/LDAjn585BBxVbP2W0wbb/KBVJvFL8i QqbZwDl1MG02PCCCJnswon75g29WSdy8KL+EWb2HlDLn3VUHdjnGIdrbl7Y4kiM05i1JcO6/3H zD0ljcO0PJJ2E7ZpkDbALW3zbb0BBXyR2GceUizcvxHnqE7auQ9RJDVACVeq75zNFfiG9G2JAE aKJe03b7WEExaafMN2Egbl9wYjs3B7j72oQqAhPgQteq9owKxlwbfCFZ4tmN+Qac9aG7355Tjo /Fv3qCz66g6cIeWfj82l++wKapJ6TumoJWvsqDy2N2ocEg==; 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-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=CtFOI+c1lRtWQ2VjGQwxTGEoZxVOW4clgStkuj4aZ64=; b=JHBFOrCX5eCCjacOz5mndo/ti+ Chg0Evik44PIG4WkeCK1kRKtdHbDuJ2LD/BdhMaGCGPUrjRcW11Fk0owAHgGfQiHC1f11IPkarzih +Ei+dty7XdOWS4GHkMPxRQ8KSOHkymllVJTOBI9Vje1gxILZXOQx6QPwBv3y1XrwgBgsuJnZFRRg0 h9h9BRwWBOlSbYvZjAlbtnolUYpsKkbGrpt+2B9P/PBl5ZB5ibmMzRZ5wOw+7k/E1jBM+QWN7byLb 3/rzMu8IU1MqBi082mCUyppJXJipZyU8QK8eVQ0aAfF3XKMNc7kMFFcZb9cav+BuEZabWT8O5+Ldb Ac7V0LRg==; Received: from authenticated user by zero.zsh.org with local id 1l9OER-000OFK-22; Tue, 09 Feb 2021 08:18:47 +0000 Authentication-Results: zsh.org; iprev=pass (mail-lf1-f51.google.com) smtp.remote-ip=209.85.167.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-lf1-f51.google.com ([209.85.167.51]:42645) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1l9OE7-000O78-Pc; Tue, 09 Feb 2021 08:18:28 +0000 Received: by mail-lf1-f51.google.com with SMTP id f23so9949964lfk.9 for ; Tue, 09 Feb 2021 00:18:27 -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:content-transfer-encoding; bh=CtFOI+c1lRtWQ2VjGQwxTGEoZxVOW4clgStkuj4aZ64=; b=Qtn8bn9lNrafq8mp/ennZFtcNwhNQu1z5RsF0T2gkefI9/8U3dDgnAvseTvo5Nb+HH vstzMONZZpOjABLLSC+Z8gw9Nq5j1mLtjkuBPkwVasJCvAnOAJ3/0ox14zTPOCnKPTA4 SaEuWBH+BTUruQvjcu+bkf6IcKbyjzjNW0+3bIdYG5mePMlVKQvXNU5R8BQvnuTbNnpj E1EYSc9+wCNgHvNPiNjZeoTeabMf6k6X4kfmcU4GWSO0EliOlHWpaI0iJai5EkF7J9J2 o53XGQdTov7Nl1ZvNI1JlvYp18mV9reKQa3GDd0WsD8sF37lTfXccx9CMHmYGaCrp6l0 BlpA== 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:content-transfer-encoding; bh=CtFOI+c1lRtWQ2VjGQwxTGEoZxVOW4clgStkuj4aZ64=; b=bSAHxpqr+x2cesR+xmtGsNzrWKkKVcfVeangwuNDhhS2Re1psqsG3PipeME0kXy/72 pPq0Y5hT7qTzMgAxM0HaBjMW00R2610QdWr6m9iDvUQVcEXkQR1+xILzsHy2OtH6mViq 5Uubn2l2ef9uUwRA2ThKudCJ9S2Jje6mG+OsiO3XlzAHIXT6EFEX9k7S+ZydGUfX3BrL oTMkGIQQrXuNpO050im2dNlVwS8JSBZs3qSpCDKtDS+6pO3UZmXVymIdxVTtZglFTt+G X1PyDyu4dTyapP1c6trGTP0GKAHcZ9KMjGZjWMUqdE+Nygy4e1VXqmAWBsCdC4V3gEJe g+7Q== X-Gm-Message-State: AOAM532+k7Om4uF7NI4PU9eMC23h/c+Au2PoLs84VqiYmQ2gtb8LNQ0B xhTql0VWgZcrnh+xJu1NWFz96B4SoqXsX2WCpo1CL1v6SmgpfA== X-Google-Smtp-Source: ABdhPJwJ5aTiYS3XclSODuY6jzgaHa5F+MN6URHWNb3OrJ89c+2DK+JHLDQj81OSaI4PUIgnDDjxwarvtSsHBarvnxg= X-Received: by 2002:a05:6512:131b:: with SMTP id x27mr12564824lfu.593.1612858707127; Tue, 09 Feb 2021 00:18:27 -0800 (PST) MIME-Version: 1.0 References: <0102017778f35f33-a962e4d3-83e9-4d3b-a0d7-45701bb40b11-000000@eu-west-1.amazonses.com> <8BA25288-0FFB-4FF4-9799-541D6A3C52DA@dana.is> In-Reply-To: From: Marlon Richert Date: Tue, 9 Feb 2021 10:17:50 +0200 Message-ID: Subject: Re: Rewrite of zsh-newuser-install To: Bart Schaefer Cc: Zsh hackers list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 47966 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: Archived-At: On Tue, Feb 9, 2021 at 3:42 AM Bart Schaefer wr= ote: Thanks for your suggestions! I will apply most of them; maybe even all of them. I just have a couple of questions/remarks about some of them: > %F{8} and %F{12} do nothing on my terminal (ssh in Terminal.app from > Mac to Ubuntu, in this case), they just emit the same as %F{default}, > so I don't know what you're after with those. Don't use numerics. I can change it, but I want to note that I happen to use macOS's Terminal.app to ssh to an Ubuntu server, too, and it works fine for me there. > I don't have a strong opinion about the PS4 prompt, but here's mine: > PS4=3D": %1N:%i%1(_.:%_.); " > This makes the prompt string into a ":" command ending at ";" so most > of the time you can copy-paste the PS4 output directly back to the PS1 > input and hit enter to run it. Same trick used in $HISTFILE for > extended history. Putting extra newlines and characters like ">" in > PS4 make that impossible. That's a nice trick. :) Here's my own PS4: local dim=3D$'%{\e[02m%}' typeset -gH PS4prv=3D'foo' typeset -gH PS4cur=3D$'\n%e %F{g}%N%f '${dim}$'%x\n' PS4=3D$'%(?,,\t=E2=86=92 %F{r}%?%f\n)' PS4+=3D$'${${${(%)PS4prv}:#${(%)PS4cur}}:+${PS4prv::=3D${(%)PS4cur}}}' PS4+=3D${dim}$'%I%b\t%(1_,%F{y}%_%f ,)' But I felt that was a bit too complex for new users. ;) The output is very nice, though. :) > RE key bindings/line-init: > > Wasn't there a sidebar into why terminfo isn't trustworthy? In any > case, application mode is exactly the opposite of how I want my shell > behaving, unless I'm misinterpreting your code. If we don't put the terminal into application mode, then we cannot use terminfo. Also, my takeaway from the sidebar was not that terminfo isn't trustworthy; just that it doesn't account for _everything._ Not using terminfo is even less trustworthy. If we don't put the terminal into application mode, then from where are we going to get the key codes we need? Plus, there doesn't appear to be any viable alternatives to terminfo. > Don't mess with Ctrl-U. Why not? Control-U does backward-kill-line everywhere, except in Zsh. It's annoying to get the whole line killed by Control-U _and_ not to have a default key binding for backward-kill-line. > I'm not sure I like your choices for Enter / Alt-Enter in menuselect, > because it seems to presume that the most common case is to do > menu-selection on the last word being entered for a command ... but my > experience is that I'm more often using menu-selection on the set of > command-line options, which typically have to be followed by > additional arguments. I didn't make any such assumption. I use menu selection quite at random; mostly when I cannot get what I want at the top of the list by typing. Can you please explain how you came to that conclusion and how my choice of menuselect bindings would impact your case?