You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Confused about flag --print-long-lines: long lines seem to be printed by default? But can't turn that behavior *off* or modify it? (like --print-long-lines=false or --print-long-lines=200 or something?)
#1524
Open
dwawlyn opened this issue
Jul 16, 2023
· 1 comment
Hi, I'm confused about the flag --print-long-lines.
Unless I'm misunderstanding something more fundamental about how you're supposed to use it,
it seems broken to me?
The manpage/help just says: --print-long-lines Print matches on very long lines (Default: >2k characters)
But for me, long lines are printed by default,
and I can't find any way to turn that behavior off (or adjust it),
trying things like:
--print-long-lines false
--print-long-lines=false
--print-long-lines=no
--print-long-lines 100
--print-long-lines=100
(I made sure I didn't accidentally have ag wrapped in an alias that already included the flag or something ; my agis indeed just plain /usr/bin/ag.)
Like, I just set up a test like this [(looks weird cuz fishshell)]:
$
for n in 2 20 200 2000 2200
echo"$(string repeat -n (math "$n-1") "_")x"> file_$n.txt
end
[
I actually passed that through pty and aha to try to keep the formatting/colors the same as you actually see when using it interactively
like:
$
pty ag x|aha -n-b
and then tried putting the output of that in <pre></pre> tags,
but of course that doesn't actually display the colors here...
I'm not sure how to get the colors to actually show up in a github comment,
if that's even possible(?),
but yeah,
the above block is actually underlyingly:
Actually, now that I'm thinking about it,
maybe a feature request:
expand the "before/after/context" flags so they can also take number of characters before/after?
(Right now, they only take lines.)
The text was updated successfully, but these errors were encountered:
Hi, I'm confused about the flag
--print-long-lines
.Unless I'm misunderstanding something more fundamental about how you're supposed to use it,
it seems broken to me?
The manpage/help just says:
--print-long-lines Print matches on very long lines (Default: >2k characters)
But for me, long lines are printed by default,
and I can't find any way to turn that behavior off (or adjust it),
trying things like:
--print-long-lines false
--print-long-lines=false
--print-long-lines=no
--print-long-lines 100
--print-long-lines=100
(I made sure I didn't accidentally have
ag
wrapped in an alias that already included the flag or something ; myag
is indeed just plain/usr/bin/ag
.)Like, I just set up a test like this [(looks weird cuz fishshell)]:
$
(
such that
$
#=>
)
and then both
$
and
$
ag x --print-long-lines
get exactly the same result
#=>
[
I actually passed that through pty and aha to try to keep the formatting/colors the same as you actually see when using it interactively
like:
$
and then tried putting the output of that in
<pre></pre>
tags,but of course that doesn't actually display the colors here...
I'm not sure how to get the colors to actually show up in a github comment,
if that's even possible(?),
but yeah,
the above block is actually underlyingly:
]
Actually, now that I'm thinking about it,
maybe a feature request:
expand the "before/after/context" flags so they can also take number of characters before/after?
(Right now, they only take lines.)
The text was updated successfully, but these errors were encountered: