zsh-workers
 help / color / mirror / code / Atom feed
From: "Mikael Magnusson" <mikachu@gmail.com>
To: "Peter Stephenson" <pws@csr.com>
Cc: zsh-workers@sunsite.dk
Subject: Re: PATCH: cd -q (was Re: _canonical_path ...)
Date: Thu, 27 Mar 2008 13:35:46 +0100	[thread overview]
Message-ID: <237967ef0803270535w2267fc7fi525b68efb29c43a@mail.gmail.com> (raw)
In-Reply-To: <20080327121525.5b4059f9@news01>

On 27/03/2008, Peter Stephenson <pws@csr.com> wrote:
>  The more I think about this (and I'd really like to stop now), the more
>  wrong it seems to me that it's so hard to get the shell to cd without
>  side effects.  Indeed, the patch above is incomplete since it omits
>  the new chpwd_functions array, and I haven't work out a foolproof
>  way of suppressing the effect of chpwd without forking the shell.
>  chpwd will typically print a bogus directory to the terminal title
>  bar, which is to be avoided; but it can in principle do anything
>  and if we're not sticking around in the directory the interactive
>  environment really doesn't need to care about the cd.
>
>  Any comments about the following proposal, which adds the -q option
>  to all relevant functions?  If it looks OK, I'll change the function
>  above to unsetopt PUSHD_NO_DUPS and use pushd -q/popd -q to sanitize
>  the directory with REPLY=$PWD and remove the fork.

Nice, I've wanted this on several occasions. Especially since
sometimes my chpwd function breaks constructs like (cd /foo; tar c .)
| tar x. I worked around that by printing everything to stderr instead
but it seems icky.

Also, I realized I didn't know what the existing options -sLP did, so
I looked at the manpage and
1) there's a typo near the beginning
Otherwise, if var(arg) begins with a slash, attempt to change to the
director<missing a y here> given by var(arg).
2)
    If the -P option is given or the CHASE_LINKS option is set,
symbolic links are resolved to their true  values.   If the -L option
is given symbolic links are followed regardless of the state of the
CHASE_LINKS option.
Intuitively this paragraph doesn't make any sense. Both options seem
to do the same thing? (-P || CHASE_LINKS) || -L == -P || -L ||
CHASE_LINKS

-- 
Mikael Magnusson


  parent reply	other threads:[~2008-03-27 12:36 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-26 10:44 _canonical_path not working on *BSD Baptiste Daroussin
2008-03-26 15:01 ` Debian bugs (Re: _canonical_path not working on *BSD) Bart Schaefer
2008-03-26 15:25   ` Clint Adams
2008-03-26 15:05 ` _canonical_path not working on *BSD Peter Stephenson
2008-03-26 15:27   ` Baptiste Daroussin
2008-03-26 15:34     ` Peter Stephenson
2008-03-26 15:51       ` Pea
2008-03-26 15:59       ` Clint Adams
2008-03-26 15:21 ` Pea
2008-03-26 15:36 ` Bart Schaefer
2008-03-26 15:40   ` Peter Stephenson
2008-03-26 16:04     ` Peter Stephenson
2008-03-26 16:18       ` Bart Schaefer
2008-03-26 16:21       ` Peter Stephenson
2008-03-26 16:38         ` Pea
2008-03-26 16:46           ` Peter Stephenson
2008-03-26 17:08             ` Pea
2008-03-26 17:17             ` Baptiste Daroussin
2008-03-27 10:23             ` Peter Stephenson
2008-03-27 11:08               ` Pea
2008-03-27 11:25                 ` Peter Stephenson
2008-03-27 12:15                   ` PATCH: cd -q (was Re: _canonical_path ...) Peter Stephenson
2008-03-27 12:25                     ` Stephane Chazelas
2008-03-27 12:35                     ` Mikael Magnusson [this message]
2008-03-27 12:48                       ` Peter Stephenson
2008-03-27 12:56                         ` Mikael Magnusson
2008-03-27 18:45                     ` Peter Stephenson
2008-03-28  8:16                       ` Pea
2008-03-28 11:01                       ` Mikael Magnusson
2008-03-28 14:35                         ` Peter Stephenson
2008-03-27 12:31                   ` _canonical_path not working on *BSD Pea
2008-03-27 15:39               ` Bart Schaefer
2008-03-27 18:06                 ` Peter Stephenson
2008-03-28  1:01                   ` Bart Schaefer
2008-03-28  7:51                     ` Mikael Magnusson
2008-03-28 10:01                     ` Peter Stephenson
2008-03-26 16:25       ` Pea

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=237967ef0803270535w2267fc7fi525b68efb29c43a@mail.gmail.com \
    --to=mikachu@gmail.com \
    --cc=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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).