Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove extra new line from cygwin command line

Tags:

windows

cygwin

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?

like image 971
Nayana Adassuriya Avatar asked Sep 16 '25 15:09

Nayana Adassuriya


1 Answers

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.

like image 90
choroba Avatar answered Sep 18 '25 10:09

choroba