From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7878 invoked by alias); 12 Sep 2016 17:23:23 -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: X-Seq: 21877 Received: (qmail 28824 invoked from network); 12 Sep 2016 17:23:23 -0000 X-Qmail-Scanner-Diagnostics: from mail-pa0-f49.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.220.49):SA:0(0.0/5.0):. Processed in 0.139382 secs); 12 Sep 2016 17:23:23 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=AkiRug9CDyB82U0dXNWg5CvcTX2YAL+jQ8glLXvU7xY=; b=RxAwGC8J9anADvXa6LqnM1ymSF0mux3MjBJElY2f+9N9D9LZWgxfeS4Y+H52715keP JT2z6660o8toOQoJvze/BX9whl4JuSJljkRjgYrbJZcK263OzqMGtvWjB/DiJfONz+qd kAV6kkbM58CMB0J+V7ty/h+VODmEFLgmIRQvDWGzr2Ikj8MHDmijjH9xHAddalVMWqZG 7OJTwnQgmi/kemxvoZfPeNUFHN3mdE+G0mfte8r2+lfhulUgbHJEyJMbf5A3QNsjCM98 POjItxtedso6ok8zf57pvt9ZxGana4ZgTei9Fz/OF15FYr79e6YxgEWzjTBs+LuBPHyK NfQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=AkiRug9CDyB82U0dXNWg5CvcTX2YAL+jQ8glLXvU7xY=; b=TN/TzbL5FAoxOllRO/4x5YaQhbnkpykyNGHCyp+wor5pcH/5Ngzbm9mczi+siidJ8n fyJqNNVocqPdRWwl89CGFCsuiZljkwd40oFWYS28zccy5W/85Rd5a5X2xRat5SL/PGh7 2QHkurdgU6KtUXtDAzcKgu9CFGUFW+C/895HxtHaK2QyflbIsW17dQRpDhEvSQ6dtIlz 0FKzBCHaaFdGL86a/lN7JtEg+iJg+DVPDERnpEcIwvZez/kX2/SbUgzAIqqeIw5F67Bg KV8Kinq5CvsHEbjFs+K3Qg8VfailFflLEKZtIs/uyiLDVXNwBCcn/F5Y8e8GsdOU4yVO WM5Q== X-Gm-Message-State: AE9vXwNVxMA1fujCXjGfFYnSqSWMu8HRrTY2R9FeImDAd25993Iw45c3rXdA93DywvPvLQ== X-Received: by 10.66.7.8 with SMTP id f8mr35066406paa.91.1473700995980; Mon, 12 Sep 2016 10:23:15 -0700 (PDT) From: Bart Schaefer Message-Id: <160912102321.ZM24807@torch.brasslantern.com> Date: Mon, 12 Sep 2016 10:23:21 -0700 In-Reply-To: Comments: In reply to Jesper Nygards "Ignoring current directory with auto_cd" (Sep 12, 2:32pm) References: X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh Users Subject: Re: Ignoring current directory with auto_cd MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Sep 12, 2:32pm, Jesper Nygards wrote: } } Is there a way to make auto_cd also ignore the current directory, in the } same way cd does with this zstyle set? I tried this without success: } } zstyle ':completion::complete:-command-::' ignore-parents parent pwd Styles of this sort only apply to completion (as might be obvious from the word "completion" in the context) and only because there is a layer of user-defined functions implementing most of the completion system. There are no built-in shell operations that use zstyles values directly. This might mostly do what you want: autoload -Uz add-zsh-hook no-local-autocd() { set -- "${(z)2}" [[ $1 = */* ]] || unsetopt autocd } reset-autocd { setopt autocd } add-zsh-hook preexec no-local-autocd add-zsh-hook precmd reset-autocd I say "mostly" because if you do something like % echo foo ; /usr/bin the autocd to /usr/bin won't happen because "echo" caused the option to be turned off. You can do a similar thing by overloading the accept-line ZLE widget, or in more detail by using a DEBUG trap with the DEBUG_BEFORE_CMD option set, but either of those has its own problems.