k-yokoishi / zsh-prompt-generator

Zsh Prompt Generator
https://zsh-prompt-generator.site/
MIT License
59 stars 9 forks source link

Add newline option "$'\n'" #9

Open robellegate opened 3 years ago

robellegate commented 3 years ago

Is your feature request related to a problem? Please describe. It would be great if there were an option for adding a newline to your $PROMPT, as when I've tried to add it using custom text, it doesn't work.

Describe the solution you'd like A button that adds the text "$'\n'" to split your $PROMPT across lines. This is how the Parrot Sec project does it for their .zshrc file in their /etc/skel directory:

PROMPT="%F{red}┌[%f%F{cyan}%m%f%F{red}]─[%f%F{yellow}%D{%H:%M-%d/%m}%f%F{red}]─[%f%F{magenta}%d%f%F{red}]%f"$'\n'"%F{red}└╼%f%F{green}$USER%f%F{yellow}$%f"

Describe alternatives you've considered I don't think there are any other alternatives to do this, but let me know if someone has a better way to do it!

snax08 commented 1 year ago

a good work around in the meantime until this feature gets added is to add a character you don't plan on using in place of the line break. Then when you go to add the generated code to your .zshrc replace the character with "$'\n'"

This comment was very helpful in helping me find this workaround.