简体   繁体   English

从cygwin命令行中删除额外的新行

[英]Remove extra new line from cygwin command line

After opening the cygwin in windows we can see the current user and path in one line and the next command need to type in the next line. 在windows中打开cygwin后,我们可以在一行中看到当前用户和路径,下一行命令需要输入下一行。

user@mycomputer /cygdrive/e/folder 
$ |

Every time when I press the enter key it will go down by two line 每次按下回车键时,它都会下降两行

 user@mycomputer /cygdrive/e/folder 
 $
 user@mycomputer /cygdrive/e/folder 
 $
 user@mycomputer /cygdrive/e/folder 
 $
 user@mycomputer /cygdrive/e/folder 
 $ |

What I need to do is remove that extra line and same like windows command prompt next command need to type in-front (or end) of the first line. 我需要做的是删除额外的行,像windows命令提示符下一个命令需要输入第一行的前面(或结束)。 Something like this 像这样的东西

C:\Users\myname>_

So even I press enter key multiple times cursor only jump one line per time. 所以,即使我多次按回车键,光标每次只跳一行。

C:\Users\myname>
C:\Users\myname>
C:\Users\myname>
C:\Users\myname>

Is this possible to achieve? 这有可能实现吗?

Your prompt contains a newline. 您的提示包含换行符。 Remove the \\n from PS1 . PS1删除\\n

Search through your startup files ( .profile , .bashrc etc.) where the variable is assigned to and make the change permanent there. 搜索分配了变量的启动文件( .profile.bashrc等)并在其中进行永久更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Cygwin命令可从命令行运行,但不能从脚本运行 - Cygwin command works from command line but not from script 从JAVA程序运行Cygwin Shell(cygwin.exe)并编写命令行 - Run a Cygwin shell (cygwin.exe) from a JAVA programme and write command line 如何使用批处理命令从文本文件中删除 CRLF 和新行 - How to remove CRLF and a new line from text file using batch command 如何在Windows上借助cygwin从命令行运行Shell脚本? - How can I run a shell script from command line with the help of cygwin on Windows? Windows(可选的Cygwin):从命令行删除被另一个进程锁定的文件 - Windows (optionally Cygwin): Removing file which is locked by another process, from command line ProcessBuilder 向命令行添加额外的引号 - ProcessBuilder adds extra quotes to command line 如何让 AWS 命令​​行界面在 cygwin 中工作 - How to get AWS command line interface to work in cygwin 如何在 Cygwin 命令行上将 Windows 路径格式化为 Unix 路径 - How to format a Windows path to a Unix path on Cygwin command line 在Windows命令行中自动执行cygwin命令(最终在MsBuild中) - Automating cygwin commands in windows command line (and ultimately in MsBuild) 无法通过dos路径并将其保存在cygwin命令行中 - cannot pass dos path and to preserve it in cygwin command line
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM