Tcl Source Code

View Ticket
Login
Ticket UUID: 1657421
Title: default translation of stdout on unix == crlf?
Type: Bug Created on: 2007-02-11 17:42:19
Submitter: wmipf Assigned to: andreas_kupries
Subsystem: 27. Channel Types Severity:
Priority: 5 Medium Last modified: 2008-09-01 04:59:33
Status: Open Closed by:
Resolution: None Closed on:
Version: obsolete: 8.5a5
Description:
Hi,

  $ tclsh
  % fconfigure stdout

reports on Debian linux:

  -blocking 1
  -buffering line
  -buffersize 4096
  -encoding iso8859-15
  -eofchar {}
  -translation crlf  <--
  -mode 38400,n,8,1
  -xchar

i.e. after each output line comes a CRLF, not, as could be expected from the default in tclUnixPort.h, just LF.

I can observe this with version 8.5a5, but also with the version shipped with Debian sarge, 8.4. It seems to be unimportant whether I start tclsh in a xterm, or in e.g. acme or gnome-terminal.

Perhaps the additional \r normally won't be observed, since programs like xterm or gnome-terminal apparently do not display it, but acme does.

The problem described in a thread "Wrong default end-of-line from tclsh", http://www.dbforums.com/showthread.php?t=938067, seems to have the same background.

Michael
User Comments:
dkf added on 2007-02-12 01:23:24:
Logged In: YES 
user_id=79902
Originator: NO

The type of translation depends on what stdout really is. If it is going to a terminal, it is (currently) crlf. If it is going into a pipeline or to a file, it is lf.

I don't know what the correct default mode for a terminal or serial line is (I'm assured that you can't tell those two cases apart).

jidanni added on 2008-09-01 04:59:33:
Logged In: YES 
user_id=1971011
Originator: NO

This is also http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=364176 . Please fix.