bash 终端,希望光标显示在下一行的开头

was*_*abi 2 macos bash

我在 macos 上使用 bash 终端。

用户名、计算机名和文件路径面向大部分行,所以如果我写了一个长命令,我从一行开始并在下一行继续。

相反,我更希望行光标从用户名和计算机名下方的下一行开始。

#Current
user-mane@computer-name:~/directory/sub-directory/another-sub-directory$ls -la

#I would like to have 
user-mane@computer-name:~/directory/sub-directory/another-sub-directory$
ls -la
Run Code Online (Sandbox Code Playgroud)

你有什么想法,我怎么能在下一行的开头启动光标。

在此处输入图片说明

Ign*_*ams 6

$PS1在 shell 启动文件的末尾放置一个换行符。

  • 在问这个问题之前我花了很多时间,但答案很简单:)非常感谢。我已将以下命令 PS1="$PS1\n" 添加到 ~/.bash_profile 并重新启动终端。有效。 (3认同)