Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Make umount complete paths containing special characters as expected
- X-seq: zsh-workers 42282
- From: dana <dana@xxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Make umount complete paths containing special characters as expected
- Date: Sun, 14 Jan 2018 22:28:48 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=INtFB8fjlm1gfHIKBiK1xdNpG0EevRHAg+k9SgKndsM=; b=jd2iOb/dMvFjMHc5PEzLZp0j7TUVOvj3Ul+5FKj1c4KsEw82x26SiJSK6QW6+VRmP4 yjZZ853L7KnzZ5HlaU7EVBdUZuN507/A1UiGmStKF4Pi9YSQw4+Mbay2Qd/JUraecEFD dRtF/8rvldEjRWpXqPPZUwLZLc6+YRmpnTVeEBhrg+oBV8uOFTE9P6l7k2Zw7qmIyivc LBBLaFwHQd1cJ2DKJ8QFeZH5GL9j29ByW+auhEoCIS608vKLgEYHjQgEryNzwjg/d16l MiknLc+QKSDEB0u8pJVD8HVG9pSN3++rg4RN2jf0+z9BOtpS4gwGilnOBkO/o5SrWUSU p+vA==
- 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
I noticed that, when trying to complete a mount point containing special
characters (like spaces), the argument gets added to the command line without
any escaping:
% mkdir 'dir with spaces'
% sudo mount -t tmpfs{,} 'dir with spaces'
% grep spaces /proc/mounts
tmpfs /home/dana/dir\040with\040spaces tmpfs rw,relatime 0 0
% umount dir<TAB> # yields `dir with spaces`, not `dir\ with\ spaces`
The included patch seems to fix it, but i have to confess i'm not sure what the
other implications might be. There's no explanation provided with the original
commit or in the documentation as to why we would have wanted this behaviour.
Maybe someone could double-check my thinking.
dana
diff --git a/Completion/Unix/Type/_canonical_paths b/Completion/Unix/Type/_canonical_paths
index 6eab7b677..67377095f 100644
--- a/Completion/Unix/Type/_canonical_paths
+++ b/Completion/Unix/Type/_canonical_paths
@@ -113,7 +113,7 @@ _canonical_paths() {
done
fi
- _wanted "$tag" expl "$desc" compadd $__gopts -Q -U -a matches && ret=0
+ _wanted "$tag" expl "$desc" compadd $__gopts -U -a matches && ret=0
return ret
}
Messages sorted by:
Reverse Date,
Date,
Thread,
Author