zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Make umount complete paths containing special characters as expected
@ 2018-01-15  4:28 dana
  2018-01-15  6:19 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: dana @ 2018-01-15  4:28 UTC (permalink / raw)
  To: zsh-workers

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
 }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Make umount complete paths containing special characters as expected
  2018-01-15  4:28 [PATCH] Make umount complete paths containing special characters as expected dana
@ 2018-01-15  6:19 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 2018-01-15  6:19 UTC (permalink / raw)
  To: dana; +Cc: zsh-workers

There's a lot of weirdness in _canonical_paths, see thread from last
March starting with workers/40761


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-15  6:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-15  4:28 [PATCH] Make umount complete paths containing special characters as expected dana
2018-01-15  6:19 ` Bart Schaefer

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).