Shell tool should not repeatedly emit ANSI bell characters on each re-render
Describe the bug
If a shell tool's output includes an ANSI bell character, the CLI can get into a messed-up state where it keeps making chime noises over and over. I suspect this is because we're outputting the shell tool's output to stdout not just once, but repeatedly as we re-render.
In my opinion we shouldn't be making chime noises by default at the end of each turn either (can't think of any other dev tool that plays sounds through your speaker as part of normal workflows). I reported that separately, but even if we keep bell on by default, we should never play a bell repeatedly just because we keep re-rendering.
Affected version
No response
Steps to reproduce the behavior
Tell the CLI agent: Make a shell script that outputs an ANSI bell character just once, then does a loop where it prints the time every 1 second for 30 seconds. Execute that script directly (no need to write it to a file)
Make sure your terminal height is smaller than 30 lines. Expand the shell tool output. Once it gets beyond the screen height, it will go into a loop where it starts playing bell sounds on each render, since it's re-outputting the shell script's output to stdout repeatedly.
Expected behavior
Ideally it would behave like normal terminal output, as in play the bell only once per time that it was emitted by the shell script. If we can't do that, second best would be to strip out bell characters completely.
Additional context
No response