Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
cwd unintentionally changed
- X-seq: zsh-workers 44253
- From: Yannic Schröder <schroeder@xxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: cwd unintentionally changed
- Date: Thu, 25 Apr 2019 14:03:56 +0200
- Autocrypt: addr=schroeder@xxxxxxxxxxxxxxx; prefer-encrypt=mutual; keydata= mQINBFXCFbsBEACtUbQRsveNjGTSinBkR+9Zbh+abIOHzUJeixIWBB2prt3OaZS07XjA2241 0HIPCytbrqpD45ORu67txBR7VInBpU6dyaAqcZ3oj2Xfd1VZReatMhu2LriqaP+oIPQuoAz/ S7hAAb/e04+jTWSV5d8rkn94mzkx5CYLMOIJh2/F7/e1q/ifypeen6GDUdf1C+yVR+3qYUXM TZqQwFvCYdUeX2CWqmRVBfjdWucDTS6xuq/9cc0Y+ep05eHxGLxX+grIiklU8Z+gUH3U0T6G C64lZ9KYi6JTshVzhwK8Zi7dueJPTo94H25kw08rlccv7hAXQxfofSA5J0ssWxRGzRe60SKn hpqUuVie6511TzfqN56Ahdj8AaBq6hAZu6QE94oTdfGyoYgL6/MsDIs3oqnWDYZ9IVFsRsAM 9RkQ94iSgSu6uKvXeVFd6oZZ+0T6vdybp5Uq/3nn9pKUDolsY8TWBx9NatOy9tLb+8CBRpgk 5kurmujwks6b3/iHDfv7MXRa43WtwFE0Wv9JQWCt5GCT589bMRfPx61yROf4+2q2D1VZwbEp O/9HCSqK0tHsEJH4HbEzg4WBYmXIVoP7gHwgPgOrxQM2JTWTkLlPJWOzJ2k+3zZKVlpKFwmX 9LDvGo4JUrzpoAC+nRxKqbRQTowpAfv19eS/cQOjd9CcNd9/7QARAQABtCxZYW5uaWMgU2No csO2ZGVyIDxzY2hyb2VkZXJAaWJyLmNzLnR1LWJzLmRlPokCQAQTAQgAKgIbIwUJCWYBgAUL CQgHAgYVCAkKCwIEFgIDAQIeAQIXgAUCVsGLEwIZAQAKCRAjX1IS1l2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: Vincent Breitmoser <look@my.amazin.horse>, weichbrodt@xxxxxxxxxxxxxxx
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Openpgp: preference=signencrypt
Hi *,
I got myself into a situation where zsh changed my working directory to
"/" without further notice. Unfortunately, the next command I issued was
"sudo rm -rf *", which did not end well with cwd being "/" :-(
My colleagues and me started to track down the bug. Our efforts are
documented here:
https://github.com/grml/grml-etc-core/issues/76
(We initially though it was a bug with grml zsh config.)
A minimal example that triggers the bug looks like this:
$ mkdir /tmp/tmp.0HnyRZ1iXv/
$ cd /tmp/tmp.0HnyRZ1iXv/
$ mkdir a
$ sudo zsh -f -c 'mount -t tmpfs tmpfs a; cd a; touch x; ls; umount
--lazy ../a; ls; foo=.; echo ${foo:a}; ls; realpath .; echo $PWD;'
It will output the following:
x # content of directory a (expected)
x # content of directory a (expected)
/ # NOT expected
bin dev ... # content of / (NOT expected)
/ # NOT expected
/tmp/tmp.0HnyRZ1iXv/a # expected
cwd silently changed to "/" while pwd does not know about this.
This looks like a very specific use case, but a change [0] about how
vcs_info gets the base directory for the repository also triggers this
bug. In my case when using Gnome which automatically mounts and unmounts
external drives (with the --lazy option).
After ending up in the source code for zgetcwd() and zgetdir() we
decided to hand the issue over to you :-)
Regards,
Yannic
[0]
https://github.com/zsh-users/zsh/commit/faa07d064bb2bd9cd9892a255a4b63811242b9fb
--
Yannic Schröder, M.Sc.
Technische Universität Braunschweig
Institut für Betriebssysteme und Rechnerverbund
Mühlenpfordtstr. 23
38106 Braunschweig
Fon: +49 (531) 391 - 3249
Fax: +49 (531) 391 - 5936
E-Mail: schroeder@xxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author