@uint8_t same result with only grepping 4. 4 is in the output. Minimal ANSI escape code PoC without grep looks like this:
echo -e 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1234\033[K5'
hanno@mastodon.social
@hanno@mastodon.social
Posts
-
I found an odd shell bug & I'm not entirely sure who's at fault. -
I found an odd shell bug & I'm not entirely sure who's at fault.Possibly related, but slightly different issue: if I do this in xterm, but not in screen, the 4 also disappears, but it's not replaced by empty space, but by the 5 (which should end up on the next line)

-
I found an odd shell bug & I'm not entirely sure who's at fault.I found an odd shell bug & I'm not entirely sure who's at fault. Some interaction between screen, ANSI colors & grep seems to make a char disappear.
Reproducer: run this in screen on a terminal with 80 chars width:
echo -e 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx12345'|grep 234
The "4" disappears mysteriously... Seems to be caused by escape code '[K' from grep. I'd appreciate explanations+whether I should report a bug to screen, grep or elsewhere.