Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unwanted bash newline nixos

Tags:

bash

nix

nixos

I have installed NixOS 18.03.

Bash seems to add a newline after every command.

$ echo Hello, world!
Hello, world!

$

Why is this? How can I stop it??

like image 679
Jacob Webber Avatar asked Jul 27 '18 14:07

Jacob Webber


2 Answers

Technically, it adds a newline before the prompt by default, by setting

PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] "

You can set a more reasonable prompt by configuring the option programs.bash.promptInit.

like image 109
robx Avatar answered Nov 02 '22 07:11

robx


It's the default prompt in NixOS, it will always append newline a the end.

PS1="$ "
like image 25
iElectric Avatar answered Nov 02 '22 06:11

iElectric