some glob patterns break incremental search

Ryan Barrett tcsh at ryanb.org
Sat Jan 21 22:34:50 EET 2006


this thread has grown into more than just a bug fix, so i'm moving it to the
main tcsh list.

in a nutshell, globbing breaks the history search commands in a number of
ways. we're leaning toward simply removing their globbing support, since
it's a rare use case, and we think it may be more confusing than useful.

this includes history-search-backward, history-search-forward,
i-search-back, and i-search-fwd.

i've included most of the original discussion below. are there any
objections? if not, i'll throw together a patch.


On Wed, 18 Jan 2006, Christos Zoulas wrote:

> | i've been hacking near this code recently, so if the stakeholders weigh in
> | on the desired behavior, i'd be happy to throw together a patch.
>
> Please do; I don't use incremental search much so I have not noticed.

ok. unfortunately, they reuse the code for the non-incremental search
commands, history-search-backward and forward. can we remove their globbing
support too?

it'd be tough, but doable, to remove globbing in i-searches only. however,
it seems more consistent to either support it fully in both or not at all.


> On Jan 18,  1:13am, tcsh at ryanb.org (Ryan Barrett) wrote:
> -- Subject: some glob patterns break incremental search
>
> | hi all! i recently noticed that the left brace { and caret ^ characters
> | break incremental search, i-search-back and i-search-fwd.
> |
> | if you type { at any time during an i-search, it kills the incremental
> | search, prints "Missing }." starting at the cursor, and starts a new line.
> |
> | if you type ^ at the beginning of the query, it finds the first history
> | entry with a caret, but ignores every character you enter after the caret.
> | in the middle of a query, it's handled ok (but doesn't glob). at the
> | beginning of a character set, ie [^...], it negates the set correctly too.
> |
> | asterisks and brackets both glob correctly. (there's special code in
> | e_inc_search() for handling brackets.) however, you can't escape any of the
> | special characters for globbing. :/
> |
> | i'm guessing the broken brace and caret handling should be fixed, but i'm
> | not sure what the desired behavior is. do we want to support all glob
> | patterns in i-searches? just brackets and asterisks? no globbing?
> |
> | personally, i'd lean toward no globbing, since it seems like overkill for
> | i-searches. however, if anyone does use it (oh my god), that would obviously
> | surprise them. if we absolutely have to stay compatible, the easiest fix is
> | to support all glob patterns.
> |
> | i've been hacking near this code recently, so if the stakeholders weigh in
> | on the desired behavior, i'd be happy to throw together a patch.
> |

  -Ryan

--
http://snarfed.org/



More information about the Tcsh mailing list