Home > Enterprise >  How can I prevent \u001Bc from clearing the screen in bash?
How can I prevent \u001Bc from clearing the screen in bash?

Time:06-14

I am using a CLI application that prints \u001Bc to the terminal to clear the screen. This application is not interactive, though, and I would like to see all of its output. Is there a way to prevent this application from clearing the screen without altering its source code?

I attempted to use app | grep -v '\u001Bc' but this doesn't appear to work, and it would also filter out the entire line containing \u001Bc even if it did work.

CodePudding user response:

You can try removing the Esc c via sed

application | sed 's/\x1bc//g'
  • Related