This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: fish prompt oddity


> 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@helium ~> pwd
> /home/andrex
> 
> andrex@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@selenium ~>
> andrex@selenium ~> pwd
> andrex@selenium ~> pwd
> andrex@selenium ~> pwd
> /home/andrex
> 
> andrex@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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]