Skip to content

feat: make newline marker configurable - #1020

Merged
HalFrgrd merged 2 commits into
HalFrgrd:masterfrom
georglauterbach:make-newline-marker-configurable
Sep 30, 2026
Merged

HalFrgrd merged 2 commits into
HalFrgrd:masterfrom
georglauterbach:make-newline-marker-configurable

Conversation

@georglauterbach

Copy link
Copy Markdown
Contributor

Closes #1015

Signed-off-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
@eidam-slices

eidam-slices commented Sep 30, 2026 •

Copy link
Copy Markdown

Hello, I really appreciate your work on making this message optional.
How difficult would be making the whole Flyline's "insert new line" behavior optional?

E.g., I've noticed that even if I call: printf "Hello without new line character",
this is the output: Hello without new line character[flyline inserted newline], and the prompt is printed on a new line. The same thing happens with echo -n.

And sometimes, I just wanna call printf without new line on purpose, and this prevents me.
What do you think?

@HalFrgrd

HalFrgrd commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

With @georglauterbach 's approach, you can set flyline --set-newline-marker "" to not print anything. in this scenario flyline will write on a newline below "Hello without new line character" and not cut it off. flyline basically always needs to start from column 0. I think this is best. I can't imagine users would want to printf without a newline and want flyline to overwrite the output.

@eidam-slices

Copy link
Copy Markdown

Alright, thanks for explaining.
We use Bash a lot at university, so I was a bit confused at first when I noticed that printf always ended up with the prompt on a new line, even when I intentionally didn’t print \n. For a moment I thought I was misunderstanding how printf behaved on my system (I use macOS and teachers are using Linux based distros).
Then I tried it with bash --norc, and it suddenly printed the prompt on the same line as the output. That’s when I realized it was probably related to Flyline.
If I understand correctly, this is basically a design choice / limitation of how Flyline renders the prompt, since it needs to start from column 0.
Thanks for the clarification.

@HalFrgrd

Copy link
Copy Markdown
Owner

That makes sense, I see how it can be confusing when you're starting off in bash! Flyline does behave differently than other shells because it has a full TUI as its line editor. I hope that more often than not, when flyline behaves differently, it is for the better :)

@HalFrgrd
HalFrgrd merged commit 612a037 into HalFrgrd:master Sep 30, 2026
2 checks passed
@eidam-slices

Copy link
Copy Markdown

Yeah, but still, I guess that Bash w/ Flyline has much much fewer differences from pure Bash, than Zsh or Fish themselves. So Flyline is still perfect solution for me :D

@georglauterbach
georglauterbach deleted the make-newline-marker-configurable branch September 30, 2026 20:26
@georglauterbach

Copy link
Copy Markdown
Contributor Author

I agree with @eidam-slices, it is a bit weird that flyline actually always inserts the newline, which is unexpected at first sight. Having spent so much time in the terminal, though, I can also confidently say that I consider flyline's behavior an improvement in an interactive session. :) Feel free to ask more if you are curious!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: option to make "flyline inserted newline" optional

3 participants