zsh-workers
 help / color / mirror / code / Atom feed
From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Roman Perepelitsa <roman.perepelitsa@gmail.com>
Cc: Soren Roth <sorenoid@gmail.com>, Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: cannot `cd $_` to $_ containing spaces
Date: Wed, 14 Oct 2020 20:49:21 +0000	[thread overview]
Message-ID: <20201014204921.22cd9cc3@tarpaulin.shahaf.local2> (raw)
In-Reply-To: <CAN=4vMrws-m2pFP4Dg7BpfQ3vYrGnJNa12T4SvffbF4rgxhfyQ@mail.gmail.com>

Roman Perepelitsa wrote on Wed, 14 Oct 2020 09:25 +0200:
> On Tue, Oct 13, 2020 at 9:31 PM Soren Roth <sorenoid@gmail.com> wrote:
> > I made a directory with a space in the name, and tried to cd into it using $_, and failed.  
> 
> You probably have the SH_WORD_SPLIT option enabled. This option causes
> field splitting to be performed on unquoted parameter expansions, like
> in POSIX sh. You can turn it off by adding `unsetopt SH_WORD_SPLIT` to
> ~/.zshrc. Otherwise you need to quote parameter expansions to prevent
> field splitting (again, like in POSIX sh).
> 
>     cd "$_"

The SH_WORD_SPLIT option defaults to being disabled, so if you have it
enabled, you might wish to check why that's the case in the first
place, rather than simply to append an «unsetopt» to your configuration.


      reply	other threads:[~2020-10-14 20:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-13 19:30 Soren Roth
2020-10-13 19:47 ` Matthew Martin
2020-10-14  7:25 ` Roman Perepelitsa
2020-10-14 20:49   ` Daniel Shahaf [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201014204921.22cd9cc3@tarpaulin.shahaf.local2 \
    --to=d.s@daniel.shahaf.name \
    --cc=roman.perepelitsa@gmail.com \
    --cc=sorenoid@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).