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: Cygwin Terminal Type


On 2010-03-17, Nick Calvert wrote:
> Hi all,
> 
> This is a border line flame worthy question as I´m acting as a proxy
> for a developer. Please go easy...
> 
> I have an elaborate, slightly dirty but fully functional system in
> place whereby Windows machines are automated via a Linux Ruby
> application over SSH. Historically we haven´t used the cygwin ssh
> server on Windows clients as we had some issues with output when
> running anything Powershell. We have now managed to fix this by
> issuing commands from a Cygwin bash prompt like:
> 
> echo . | powershell function-name
> 
> All good. The problem we now face is that the `raw´ terminal output
> the Ruby ssh library sees is full of control character, this can make
> it difficult to read the output of any commands we run.
> I was thinking that perhaps specifying a terminal type that doesn´t
> support colours (or even just `dumb´) would lessen the control
> characters but I can´t get this to work. No matter what terminal type
> we specific in the Ruby SSH library the same control characters
> present themselves, if I run a test from PuTTY, ssh´ing to Cygwin sshd
> and specifying vt100 or dumb as a terminal type, I still see a
> coloured prompt which would seem to suggest I haven´t changed the
> terminal type at all?
> Could someone kindly point me in the right direction?

The colored prompt results from escape sequences embedded in the PS1
variable.  Cygwin sets the value of PS1 in /etc/profile according to
the shell being used, but not according to the terminal type.  You
could override this by putting something like

    PS1='$ '

in your ~/.profile, perhaps conditionally on $TERM or $SSH_CLIENT.

HTH,
Gary


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