Path: csiph.com!xmission!news.snarked.org!news.linkpendium.com!news.linkpendium.com!panix!usenet.stanford.edu!not-for-mail From: Eli Schwartz Newsgroups: gnu.bash.bug Subject: Re: Idea: *.p completion Date: Sun, 1 Sep 2019 15:15:21 -0400 Lines: 110 Approved: bug-bash@gnu.org Message-ID: References: <878sr88336.5.fsf@jidanni.org> <9e4e91b3-34a1-72b3-ba8d-bd9d0e31e4a7@case.edu> <87woer7v8e.5.fsf@jidanni.org> <35b9428b-2eb7-036f-9c17-83dd71a8e0f3@case.edu> <87o9037tki.5.fsf@jidanni.org> <9a4be5fd-dd8c-c31e-ecd7-36d8f9c9c4fb@archlinux.org> NNTP-Posting-Host: lists.gnu.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="pwLZPEdppyjlM11EWCabL6txfaUvjAaII" X-Trace: usenet.stanford.edu 1567365337 5014 209.51.188.17 (1 Sep 2019 19:15:37 GMT) X-Complaints-To: action@cs.stanford.edu To: bug-bash@gnu.org Envelope-to: bug-bash@gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=archlinux.org; s=orion; t=1567365324; bh=f9yfbvZ4ym4lRBNDPFCIRvtC1+eO2/1Lg59rEFAkks4=; h=Subject:To:References:From:Date:In-Reply-To; b=oBKiE76+C+Xe0v+5BiW6S5T97fPr6vQ0xoSDQ6+BqH2FmAWkkVLjVcArwFyL3Q8lh 9rZ7U7tgKM7Uki2K6yf7cEnXVLDOH+IomO//UzHADs+cDdPhu3D9qima5KvcsFLfrj L03zI3quZEp5uSEiQx/rAGYN/oERCiX7qo4Q56DfTXISJIc7GWGf6JkhQ402X9DDnC ew+NV07o3eMyFxWqdNlI6kVv7rKnnmPfti1Ww9uwCLEHIm0Z1Gpp37t3OtwjqKThef 8K+pBjsqoRXFuD3C22R04p1KRuujYsO0uCcMkEO5lmeet56F3O99/iNy9HxMg96NHw 882NLg1c7rEbDuNZqgJzmpZe4sdhZLf8/g3+COeipiibwNsBF0a3H0uohc1lBXr6pa 7wkOKj2PihDGPzSEAZfwggOP1L5sNhdh52HZcSMW+jmG5g1mogXhZpOe1cQALpthZk Rk/CcYHAuv+hdOIqqnMnzlEAJHa8UZwtsfPdvdALi2+lAvS1Hsm2DUzcL8AOzAKGva Dtq2H4t2ClE/g8/+apV8BcLxWzqJakODPGRQanK9rukAGkRHWiUXIK7I76FqdG8jHc BWSMWlU+sJo0Ki45rJJO1t281294kRuZO/Z+KAsPesDYiRJF0tjUFQuKfw5R5HUbDx pIjUngC0J+mwpMBllrBmTRhs= Openpgp: preference=signencrypt X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 In-Reply-To: <87o9037tki.5.fsf@jidanni.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 88.198.91.70 X-BeenThere: bug-bash@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Bug reports for the GNU Bourne Again SHell List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: <9a4be5fd-dd8c-c31e-ecd7-36d8f9c9c4fb@archlinux.org> X-Mailman-Original-References: <878sr88336.5.fsf@jidanni.org> <9e4e91b3-34a1-72b3-ba8d-bd9d0e31e4a7@case.edu> <87woer7v8e.5.fsf@jidanni.org> <35b9428b-2eb7-036f-9c17-83dd71a8e0f3@case.edu> <87o9037tki.5.fsf@jidanni.org> Xref: csiph.com gnu.bash.bug:15346 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --pwLZPEdppyjlM11EWCabL6txfaUvjAaII Content-Type: multipart/mixed; boundary="pcz7BLBzhripeDROJMJVNiL4DX7b5lioj"; protected-headers="v1" From: Eli Schwartz To: bug-bash@gnu.org Message-ID: <9a4be5fd-dd8c-c31e-ecd7-36d8f9c9c4fb@archlinux.org> Subject: Re: Idea: *.p completion References: <878sr88336.5.fsf@jidanni.org> <9e4e91b3-34a1-72b3-ba8d-bd9d0e31e4a7@case.edu> <87woer7v8e.5.fsf@jidanni.org> <35b9428b-2eb7-036f-9c17-83dd71a8e0f3@case.edu> <87o9037tki.5.fsf@jidanni.org> In-Reply-To: <87o9037tki.5.fsf@jidanni.org> --pcz7BLBzhripeDROJMJVNiL4DX7b5lioj Content-Type: text/plain; charset=utf-8 Content-Language: en-US-large Content-Transfer-Encoding: quoted-printable On 9/1/19 2:35 PM, =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson wrote: > Yes. That's why I'm saying wouldn't it be neat if it made > *.p into *.pdf? What harm could possibly happen? > The idea being if the user has handed it an asterisk, > then he wants that asterisk to still be in the result. Why should shell completion be responsible for auto-filling your globbed search pattern? Let's say it did, in fact, auto-fill your globbed search pattern. What if I had a bunch of files in my current directory: a.pdf b.pdf hello_world.py *.pl What should *.p complete to? It could be *.pdf or *.py or *.pl, and since the shell doesn't know which one I want, it won't complete either -- instead, it will print them to the screen and let me choose. But then that's going to confuse me, because the completions will list two globs (*.pdf and *.py) and one actual literal filename *.pl (because my example persona is a weird person with weird taste in filenames). Which one do I want? And my expectation as a user is that tab-completing a filename should only offer me real filename suggestions (which AFAIK seems to currently be the case), and I would get quite freaked out if bash started completing glob patterns too. I would be freaked out enough to report a bug and demand an option to disable this behavior (and offer my opinion that disabling it should be the default). =2E.. What is even the purpose of this anyway? If you only have .pdf files, your glob can be *.p* and it works as-is, it is even the same number of keys. If you have multiple possible suffixes, bash won't even complete it for you, but only fill out the unambiguous characters and then make you finish the rest -- so use * instead of tab, and then fill out the rest anyway. You are already using a glob, I would expect that your glob has a highly specific use case which you know more about than bash does. I'm sure there is some trivial glob suffix you can use which is as few keypresses or less than anything bash could do for you, and is as a bonus generally portable between shells and even different point releases of bash. --=20 Eli Schwartz Arch Linux Bug Wrangler and Trusted User --pcz7BLBzhripeDROJMJVNiL4DX7b5lioj-- --pwLZPEdppyjlM11EWCabL6txfaUvjAaII Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEvSewel70XCra9w4EhIGKaBmvSpsFAl1sGMkACgkQhIGKaBmv Sps0+hAApEPXWuk10r31XeIGQ4S+FrxIUHLKvAzj8JeRy1OnlLYZhXlH2lOyy+8o XBCqO6gxscVRsvdP7NN4gq50MerLGb0fd7vFqRhSicoiZP+OfvYP17ICr8LUid11 k5v3htXUUq5tlQ87WXBqCLKBZeNqm0oUbVjb0Mx9gVii/FXnDTxVw25QgzV026hq kSziBuM76mfvVD5F6vZT8+QDILpKkPeFQteU1bdzr+AaisV4L+xpOfOxPy0MNSXv 6ataSpggjjqmYMuGKpwZYjOxjfZa6jIgrN+XDpaeGgY0Ws3qf/3H5uzFGtPuit0y 54huCoQJhH4x944nfbzKWx9E6B5DjBo3GJlVRteA/AQTSjCW/AXF928w9YGnjyf0 1uxC+GOcQ5Vj8f+2jpxZHQ1EHopkYb+zdOyCnDR3sMMrNU2BodZfq9usnDt5Qdb5 1XeiCzzSGWDmXJbioj43xEHI7iPHUtrUtWwwnNwMqzv/k/XYchybN2iAhmQDsrMy 1Ab5ewWx4r3fneiToVVJmYY76jcAz32yGGrSHHPmsgssCWURwnYs9jQl8k1ne8vD 32ZUPGd/cc5b2ee97TQVBso7wapHMNXmM9Te4ti1knkyHZu+Z6kNocoAPQL+1hnt DS3C04nYfO86JYQLvvkwouD8dRRt95gh+mPTiuMeos90CLsgroSJAjMEAQEKAB0W IQRgQRMEwJ02YoNA7v/OsWfvtXIr1gUCXWwYyQAKCRDOsWfvtXIr1nmSD/wLJKCA U+J/f9h1Q6IYTktJKDsmObsoHXjpSpo+HHmG4xlvE7iWEKWywXsVDnnoy0gkvYrh 1WUaAOVmLtbPqd93bfWqMcls55VOXfWdtPZa5ZkbZL9Pvirf2J2+xeVXOnp/bbgp 9ReXajtLUp6pevMohWLXThcYkvAwZ+eWioEcs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