From: d3fault To: bug-bash@gnu.org,b...@packages.debian.org Subject: bash completion of an option with a space in it, isn't double quoted
Configuration Information [Automatically generated, do not change]: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR$ uname output: Linux debianD4faultHostname 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64 GNU/Linux Machine Type: x86_64-pc-linux-gnu Bash Version: 4.4 Patch Level: 12 Release Status: release Description: In the following example it auto-completes without putting double quotes around "hi mom", which means a process would see it as 2 separate args instead of 1. $ complete -W "hi\ mom foo bar" ls $ ls h<tab> which results in the erroneous completion (no double quotes): $ ls hi mom For a semi-related discussion which led me to discover this bug: https://bugreports.qt.io/browse/QTBUG-74692 and https://bugreports.qt.io/browse/QTBUG-74594 Repeat-By: See above. Fix: After you press tab your pending command should look like this: $ ls "hi mom"