delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2017/04/05/12:53:52

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:message-id:subject:mime-version
:content-type:content-transfer-encoding; q=dns; s=default; b=TUt
3B+f6awIzDqbchOOQDebx2tWu9m6ICgTjl6xZ9L9rFoigWlg3afKE5kVLwRyV4sK
ik8EKtGafjikUhuDljVVUTs7j/ir9oUrYrluQ/nQo1wwBelZ9AB4DPkRhnE9VuQ/
lGPLipehFG5spTfX1Icas7ZoDyRdulO7mdRxgGSY=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:message-id:subject:mime-version
:content-type:content-transfer-encoding; s=default; bh=wGKqOplp5
mM8EEauan3B8A3OP3g=; b=s3bMbeD49JDcC3QSpUqKWfuui+1MCAgep/RR2do1d
hlDwB0gZ7C9ZSJjLFJDI/U2V4s2LFmCIw9EI5TkS5bJNJbHkuezI43JDP6t0jF4D
ylOJ1BawlCWBP/iHqBKA3Glisf+iIloaFbsPpXDq2bw3TdzWJcj2YtZ6iyKst0dX
e8=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW,SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=H*x:Mailer, H*UA:Mailer, HX-Originating-Client:sk:open-xc, HImportance:Medium
X-HELO: mo4-p05-ob.smtp.rzone.de
X-RZG-AUTH: :KH5KeA6gNfmPwxG/SGu3pkirqXcxhUh5Ga4aJOYUFK8qszW2V+k1Q+Swjg6xyFWlM90aW7J5ipH2
X-RZG-CLASS-ID: mo05
Date: Wed, 5 Apr 2017 18:53:33 +0200 (CEST)
From: =?UTF-8?Q?=22=5C=22=5B=5B=5C=22Dr=2E_Matthias_H=2E_Fr=C3=B6hlich=22?= <Dr DOT M DOT H DOT Froehlich AT IEEE DOT org>
To: cygwin AT cygwin DOT com
Message-ID: <1661013492.3298.1491411213549@communicator.strato.com>
Subject: Why does default shell prompt PS1 contain newlines (\n)?
MIME-Version: 1.0
X-Originating-Client: open-xchange-appsuite

After installing "plain vanilla" cygwin I noticed, that default definition of PS1 from /etc/bash.bashrc contains newline characters '\n':
     # Set a default prompt of: user AT host and current_directory
     PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '

This does immediately lead to the strange effect, that shell (bash) in interactive terminal window (C:\cygwin64\bin\mintty.exe -i /Cygwin-Terminal.ico -) always advances 2 lines on every single CR.

This definition seems to be around pretty long already, as it is mentioned in several discussions on superuser &c. There is probably a very good reason for this - however, I could not figure out on my own, neither found any rationale in FAQ. Would be grateful for short explanation - thanks in advance.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019