Skip to content

How can I disable the display of blank new lines after help? #4745

Answered by epage
Rustin170506 asked this question in Q&A
Discussion options

You must be logged in to vote

Can you verify if there is just 1 trailing \n or 2 by clap by piping to a file and checking the raw bytes?

CLI programs should always output at least one trailing \n Traditionally, not doing this would cause the prompt to be on the same line as the last line of the program. Some modern prompts intentionally add a blank line before the prompt so well-formed CLIs will lead to a blank line between the CLI and the prompt. For instance, I'm using starship and cargo check, git push, etc have a blank line between them and the prompt.

There were cases at various times where clap did not have a trailing \n and we fixed up a lot of cases. My hope is that this is more of your prompt also adding a \n,…

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Rustin170506
Comment options

Answer selected by Rustin170506
Comment options

You must be logged in to vote
1 reply
@epage
Comment options

epage Mar 4, 2023
Maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants