From c7d1e642e5d578067d88f0ddad75b898c0479760 Mon Sep 17 00:00:00 2001 From: rootiest Date: Wed, 17 Jun 2026 22:14:31 -0400 Subject: [PATCH] fix(cat): terminate string match options to handle --- frontmatter A file whose first lines contain a bare '---' (e.g. YAML frontmatter) caused 'string match -qr' to parse the line as an option flag, raising 'string match: ---: unknown option'. Add '--' to end option parsing. --- functions/cat.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/cat.fish b/functions/cat.fish index fb993fb..4269f92 100644 --- a/functions/cat.fish +++ b/functions/cat.fish @@ -34,7 +34,7 @@ function cat --wraps='bat' --description 'Use bat for files, ls for directories, # contains raw terminal ANSI color escape sequences. if test -f $argv[1] if string match -q "$SCROLLBACK_HISTORY_DIR/*" $argv[1] - or string match -qr '\e\[[0-9;]*m' (head -n 5 $argv[1] 2>/dev/null) + or string match -qr -- '\e\[[0-9;]*m' (head -n 5 $argv[1] 2>/dev/null) command cat $argv return end