New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove newline in PS1 #68599
Remove newline in PS1 #68599
Conversation
cc @svanderburg (put the newline according to git) |
-1, though it's a purely personal preference so I won't insist if this is widely supported. EDIT: there is a reason to have it, which is that commands that don't terminate their output with a newline don't mess up the prompt. |
While messing up all other commands. The thing is that this is non standard. NixOS (from what I know) is the only distro that does this. Also I'm pretty sure that in Ubuntu, commands that finish without newlines aren't messed up, how do they do it? EDIT: Ubuntu doesn't fix it (and no one has ever complained about it) |
zsh fixes that on its own, maybe bash also have an option for that? |
It doesn't mess anything up at all, just looks different. |
Applies to both |
A non-newline-terminated command does mess up the prompt if the prompt doesn't start with a newline. To see what I mean, try |
I think i would be nice to do it similarly to Ubuntu (if they actually have a way and I'm not just making things up) but the same applies:
This is just a choice but I believe it is better to do what is "expected". |
Maybe you could mention it on Discourse and ask for people's opinions.
However when I use bash on other distros I'm sometimes confused where my PS1 indicator has gone when it's just at the end of a long line without As you mentioned it has been like this for >10 years so I wouldn't change it willy nilly. |
Indeed it has been this way since the start and I don't see a strong reason to change it. I prefer it this way since I think it makes bash a bit more readable by clearly separating command invocations. Obviously not everybody will agree but that's true for any default. |
Motivation for this change
This newline has been present as far back as git allowed me to go in
PS1
(7c93a71) (2008 more than 10 years ago).Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)