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,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 9078 invoked from network); 7 Apr 2021 18:51:17 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Apr 2021 18:51:17 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1617821477; b=oGUZpKcWQsPlt/OExitehDANFXmazTtRiMjVkmEsXZHymdzxOvorgXcIAG6WiiUolC0lwp2t9X ubkIXxl9zstoHlUEW9m8dMSQoc1Pxe2yHEqRUF8+S6b0rrrG+kux7mEDH1isbBrRFX9wpSL6mN DcaxdKwugDCNv77knvJ1zuFBJ2iggFMLMsTGw24FVV4EaKxxlTF2UaGosXFsRQi+HIQIfR5RMB GSrsrrpfa9ablN7pLEuDlhBaw79gb5Fr69LgBJlRXCngmqKOg6+y7I5wogUL+L+BagHOizSK0r 2QtGLnVtR4S42vyYSgEGyha1nUSbV7x7ga0hEZAniEzAsw==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1617821477; bh=9Y/xPwxhWB2+rU2DP4cYQtCrwIlFGl74iL0HLHERnhA=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Subject:Cc:To:From: Date:References:In-Reply-To:Message-ID:MIME-Version:DKIM-Signature: DKIM-Signature:DKIM-Signature; b=jDA05g6AyoFDNGyvgMxfgsIyObChdJoKbeFy1HRImse0d4HitqX8E4sD9ubq5hNhPU4gS7ArCs 8ksCGqz2f0gJ3sVDEELTL9RDaqbB96s2wd7/PSpn0eUmrY7Hpic8+orRF9KYHj2rHXR8BErJsm z9RWiiiR9H6oPrkAGnclub9YrRzp+zyylmunLuX/w/v0ycLPIp1XhBMwZoyXbd/0pyQ8Be6xIs CqdkVA3DtvwAN35NepuJc4S/CwGMfIBodEiFxOds3NQAMLHCOErGB3WciHlRM5boqvtAgbkGG/ B/W/bSwVFBFZsu93xeSePHeGPK1l6roY4CKdwYDN0+DNzw==; 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:Subject:Cc:To:From:Date:References:In-Reply-To:Message-Id: Mime-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=KF5JtABJxsEGTh7VAI3prYPnQR51C27DKGIMxNcR8Ts=; b=znP6ZsHugsU9cEho/rIuI8wwe6 SRTjNBkeuijBrUWBEBoWnG7yyTi/RtqW9w0G5hiJwBmFhYJf8VuKH9SV92Ny6q8oSlo1eZG/AuWIP H+O00p4u7nwaMb06PNwbgcOO5nKqOYFk4pVg8p0a0c9/XbrqME0sbiRpfKuV2s8nRL7ZpthTQLJ1O Hy7P12nikRREVYX7RNdjqiG+Fpq+pN4/wAiQ+HYG7FB5+9C+G22ktYdKRgXc089Cjk3z2gk8Y62R5 RT8817dBUiCGvlwsyQ8DX4jigJnKG3XiNmYGwazCVtnYW6tn3g9wDRbGAR3fvWdVG3CAK+bR+l5T2 THbkPxaA==; Received: from authenticated user by zero.zsh.org with local id 1lUDGm-000CNt-GI; Wed, 07 Apr 2021 18:51:16 +0000 Authentication-Results: zsh.org; iprev=pass (out2-smtp.messagingengine.com) smtp.remote-ip=66.111.4.26; dkim=pass header.d=daniel.shahaf.name header.s=fm3 header.a=rsa-sha256; dkim=pass header.d=messagingengine.com header.s=fm2 header.a=rsa-sha256; dmarc=none header.from=daniel.shahaf.name; arc=none Received: from out2-smtp.messagingengine.com ([66.111.4.26]:60245) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_256_GCM_SHA384:256) id 1lUDGX-000C7y-LY; Wed, 07 Apr 2021 18:51:02 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id CA9205C008D; Wed, 7 Apr 2021 14:51:00 -0400 (EDT) Received: from imap37 ([10.202.2.87]) by compute3.internal (MEProxy); Wed, 07 Apr 2021 14:51:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:cc:subject:content-type :content-transfer-encoding; s=fm3; bh=KF5JtABJxsEGTh7VAI3prYPnQR 51C27DKGIMxNcR8Ts=; b=MOyGV9IyQxqZCvu41a2ImpbJYVzDkEtkoU1cTnYX4U BMtg/XY0v6ySth0Lr6oAaBDG7fOBT0SgDmnWyiYiXjdHsaaCF0YEReWEF7yv1TO2 j/RhAb8963cx+G3h1JFbQOdNvJncy8tSaiDg042eLomHOSCpBE3Dz57FiN3dG7+U eWGpkruxS/XFJdU3eTFIdpTQO0HoLuWvClh6yblNr10WompdBgBFFr5O50n2JaTL ziZ4lfwJIv80XMiTA+H23fCpIEx+FrhsOJE9fVIcOWlaGnRmsupWj63qbQN7CzVf hiCjK7yYxapy4yP67S10wdLR2L2diA/3rldFAOXMDxjQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=KF5JtABJxsEGTh7VAI3prYPnQR51C27DKGIMxNcR8 Ts=; b=wHNg78rRv71K7+J9pd4V3gRhlZZeIf03bo21b3b/6Mifh9OCDjOhh2RTJ k6Oio9+KIpgS/upm/wJcMf5lRIgQgdpvNX+2rmfl2Ppz6OZrIfIJVnRSVXQpyNPt P/yiSTxh6a9AO3oF0cgvlI81FSk7uDYSf4V/A759HqY+rg9GIQ4n1VaUbzakHCAy hCblIjnKA/QJmiU5rsVWX09g8Qj1HHJ7iCnmRdodmxvMp5Jet+G9AT9rbyU8ZUO1 LhVu/kOqT4XeOiYEq1K2o6rI8c8DeUJA+xS1Tp/naw6M+qrQUie099e1ewAILudP AgID9b4zGXxojxSGxO+Xbq3BK5tmA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudejjedgudefudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtgfesthhqredtreerjeenucfhrhhomhepfdff rghnihgvlhcuufhhrghhrghffdcuoegurdhssegurghnihgvlhdrshhhrghhrghfrdhnrg hmvgeqnecuggftrfgrthhtvghrnhepjedtffdtgeetudejteeggeelgfdtuddujeehtddt ieduleeltdfhhfetleduuefgnecuffhomhgrihhnpehsohhurhgtvghfohhrghgvrdhnvg htnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepugdr shesuggrnhhivghlrdhshhgrhhgrfhdrnhgrmhgv X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 791A76B40065; Wed, 7 Apr 2021 14:50:59 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-273-g8500d2492d-fm-20210323.002-g8500d249 Mime-Version: 1.0 Message-Id: In-Reply-To: References: Date: Wed, 07 Apr 2021 18:50:39 +0000 From: "Daniel Shahaf" To: "Mikael Magnusson" Cc: "Zsh hackers list" , "Marlon Richert" Subject: Re: Rewrite of zsh-newuser-install (Mikael's subthread) Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Seq: 48430 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: Mikael Magnusson wrote on Wed, 07 Apr 2021 18:15 +00:00: > On 4/7/21, Marlon wrote: > >> On 5. Apr 2021, at 22.44, Mikael Magnusson wrot= e: > >> On 4/5/21, Marlon Richert wrote: > >>> # Auto-save last 20 dirs to file whenever we change dirs. > >>> # See > >>> http://zsh.sourceforge.net/Doc/Release/User-Contributions.html#Rec= ent-Directories > >>> autoload -Uz add-zsh-hook chpwd_recent_dirs > >>> add-zsh-hook chpwd chpwd_recent_dirs > >>> zstyle ':chpwd:*' recent-dirs-file ${ZDOTDIR:-$HOME}/.chpwd-recent= -dirs > >>> > >>> # On startup, initialize dir stack from file. > >>> autoload -Uz chpwd_recent_filehandler > >>> chpwd_recent_filehandler > >>> cd $reply[1] > >>> dirs $reply[@] >/dev/null > >> > >> Does this start zsh in some other directory than it inherited from = the > >> terminal? If so, nak from me on that, way too surprising. > > > > It makes the shell pick up in the same dir as where you left off las= t time. > > I would hardly call that surprising. In fact, I would pretty much ca= ll that > > _expected_ for most applications nowadays. >=20 > I think most people on the list will strongly disagree with you here. Yes and no. On the one hand, "start in the cwd of the shell last closed" would just get in my way: if I close an xterm on virtual desktop= 2, switch to virtual desktop 3, and pop open a new xterm, I'd rather it opened in ~ then in the cwd of the shell I just closed. On the other hand, one of the things I miss since I migrated from xfce4-terminal to =C2=ABtabbed -c xterm -into=C2=BB (from suckless-tools= ) is that the former would default new tabs to the cwd of whatever command was running= in the tab in focus. That guess wasn't always right, because it used (IIRC) the cwd of the "top-most" (process tree -wise) shell in the tab even if from that shell I ran zsh/vim/tmux and that process's cwd was different, but in general, if I wanted the default of ~ it was easy enough to just type =C2=ABcd=C2=BB and move on. But even then, the default cwd wasn't some "global" thing; it was the cwd of the tab in focus. cwd's of other tabs, or of tabs in other xfce4-terminal windows, wouldn't factor in. So, if there was some way to say "Look up the process tree to the thing I'm in" =E2=80=94 be that a tmux session, a tabbed terminal emulator win= dow, a virtual desktop (in the `wmctrl -d` sense), etc. =E2=80=94 and use tha= t as the default cwd of new processes, I might use that=E2=80=A6 =E2=80=A6 but that's not going to be easy to get right, and in any case = I amn't going as far as to say it'd be good for the default zshrc. It's statefu= l magic. If anything, it sounds like something that should be handled outside zsh, by having whatever invokes zsh cd() before exec()ing. Cheers, Daniel