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

标签 bash macos

我在 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

你知道我怎样才能在下一行的开头开始光标吗?

enter image description here

最佳答案

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

关于bash 终端,希望光标显示在下一行的开头,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47228918/

相关文章:

bash - shell 脚本语法错误 : redirection unexpected during done command

macos - 如何查找磁盘卷的格式

macos - 如何打包 node web-kit 应用程序以在 mac 应用程序商店中发布?

css - Google 字体无法在 Windows 浏览器中加载,但会在 Mac 浏览器中加载

python - 在 MacOS Big Sur 中强制使用 10.x 轮

bash - bash 中现有的空空变量

linux - 计算特定目录中的目录数

java - 创建 .sh 文件并在 Linux 命令中修复它

linux bash 剪切以某个字符串开头的一行

iOS 模拟器在 macOS Monterey 上崩溃