不需要的bash换行符nixos

时间:2018-07-27 14:39:14

标签: bash nix nixos

我已经安装了NixOS 18.03。

Bash似乎在每个命令后都添加了换行符。

$ echo Hello, world!
Hello, world!

$

这是为什么?我怎样才能阻止它?

2 个答案:

答案 0 :(得分:2)

这是NixOS中的默认提示,它将始终在末尾添加换行符。

#include <gtest/gtest.h>
#include "../../Serveur/Serveur.h"

using namespace Serveur;

class SocketTests : public testing::Test
{
    public:
        SocketTests() : _socket(AF_INET, SOCK_RAW, IPPROTO_IP)
        {
        }
    protected:
        Socket _socket;
};

TEST_F(SocketTests, CreateSocket_SocketIsCreated)
{
    ASSERT_EQ(1, 1);
}

答案 1 :(得分:1)

从技术上讲,默认情况下,通过设置

,它会在提示前添加换行符
PS1="\n\[\033[$PROMPT_COLOR\][\u@\h:\w]\\$\[\033[0m\] "

您可以通过配置选项programs.bash.promptInit来设置更合理的提示。