Similar to this question, but instead of adding a new line to the end of the prompt, add a new line to the beginning of the long command (when a command reaches to the right side of the command line window).
I believe I saw such behavior in fish as shown in this video. It only adds newline to the line containing the prompt.
I'm using zsh (v5.8) on Linux (kernel: v5.10)
Edit:
How can I implement such behavior in zsh or bash?