delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/10/09/06:31:24

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:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=vXQ8Q6WH30IpWHILxi3ZfLONSzRzzIeqgmIEc9DNJt4uwKQUaw5rU
kah2I6L74yIgjy1a45SarcTgb9D8LtkPLSg4GiCsUiy5azhqd8OkhpNAk59uNfaZ
c2IQM0gibZSoM2sPu1LOAEc4nupXvSVIMpoVYEvGm2l4//+dtdn6t8=
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:to:from:subject:date:message-id:references
:mime-version:content-type:content-transfer-encoding; s=default;
bh=gTS1DSRxoS4sA2qJXTG7xmz6X7I=; b=yhSF6yAiFMyu2W0+YQaBt99sPW6w
fQJm8UOMW2xoKoxWaFSO9XYGXTBVifxsB/c1t3QvwbdddHiPFFi95hfPTLEDqdZ3
pMU80V1CfY5NnXVlg3iesfMyJuBI1kKwcB1ofCoVvI20eWLbUINfyFPLoqVdlCWs
IubsAOpimUa3KQ8=
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.6 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2
X-HELO: plane.gmane.org
To: cygwin AT cygwin DOT com
From: Andrew Schulman <schulman DOT andrew AT epa DOT gov>
Subject: Re: fish prompt oddity
Date: Thu, 09 Oct 2014 06:30:50 -0400
Lines: 37
Message-ID: <7fkc3ad8dd45spsni9drdlfqissj1860tp@4ax.com>
References: <c40a3altm1ohh1ufnd9m22kegqlnaf2b6o AT 4ax DOT com>
Mime-Version: 1.0
X-Archive: encrypt
X-IsSubscribed: yes

> In fish, I like to set the prompt to print a blank line before the prompt text.  No
> problem:  I just add an "echo" statement at the beginning of the fish_prompt
> function.  In fish in Linux that works fine:
> 
> ===
> andrex AT helium ~> pwd
> /home/andrex
> 
> andrex AT helium ~> 
> ===
> 
> But in Cygwin, it has a strange effect.  It seems that the prompt gets reprinted
> every time the syntax highlighting changes, so I get a bunch of extra lines printed
> as I type.  Here's how the same pwd command looks in my Cygwin fish console:
> 
> ===
> andrex AT selenium ~>
> andrex AT selenium ~> pwd
> andrex AT selenium ~> pwd
> andrex AT selenium ~> pwd
> /home/andrex
> 
> andrex AT selenium ~>
> ===

For the archive, I worked around this problem by solving it a different way.  Instead
of changing the fish_prompt function, I defined a fish_prompt event handler to print
the extra blank line:

function fish_prompt_handler --on-event fish_prompt
    echo
end

This gives me the blank line before each prompt, and for whatever reason it doesn't
interfere with syntax highlighting as I type.

Andrew


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