Terminal output messed up on Big Sur
I actually found out that the cause of the issue was this line tabs 4 in .zshrc. This worked on very well for me on Linux using Konsole terminal. I had copied my code configs from Linux after switching.
Update:
I found out that MacOS terminal uses negative values to the tabs command instead of positive. So for example, for width of 4 spaces, it should tabs -4. On Linux, it should be tabs 4 to achieve the same.