delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/07/03/19:35:37

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT com
From: David Menestrina <dmenest-enamg AT ofb DOT net>
Subject: Carriage-return problem with ssh, "hostname" command
Date: Tue, 3 Jul 2007 22:21:36 +0000 (UTC)
Lines: 52
Message-ID: <loom.20070704T000533-205@post.gmane.org>
Mime-Version: 1.0
User-Agent: Loom/3.14 (http://gmane.org/)
X-IsSubscribed: yes
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

Hi,

I have a strange problem with carriage-return (CR, \r, ^M) handling on Cygwin
(DLL version: 1.5.24).  The problem is only exposed when running the "hostname"
command via ssh.  Here is a sample session that demonstrates the bug:

----------------------
$ hostname | cat -v
myhost
----------------------

This is the expected output.

----------------------
$ ssh localhost
Last login: Tue Jul  3 14:47:22 2007 from localhost
$ hostname | cat -v
myhost
$ exit
logout
Connection to localhost closed.
----------------------

Again, this is the expected output.

----------------------
$ ssh localhost 'hostname | cat -v'
myhost^M
----------------------

For some reason, there is now a carriage-return character at the end of the
result.  Note that "hostname" is the *only* command I've found that has this
problem:

----------------------
$ ssh localhost 'echo hello | cat -v'
hello
$ ssh localhost 'whoami | cat -v'
myuser
----------------------

I have tried various combinations of stty, setting the TERM variable, setting
the CYGWIN variable (binmode? tty?), and using ssh -t, but I haven't found a
solution, and I'm just grasping at straws.  When I first installed the ssh
server, I told it to use the CYGWIN variable "ntsec tty", if that matters.

Does anyone have an idea for solving this problem?

Thanks,
david

You can see that executing 


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

- Raw text -


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