Search code examples
windowscygwin

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.

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. 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?


Solution

  • Your prompt contains a newline. Remove the \n from PS1.

    Search through your startup files (.profile, .bashrc etc.) where the variable is assigned to and make the change permanent there.