www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/05/19/05:10:05

Date: Wed, 19 May 1999 10:35:35 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: "Mark E." <snowball3 AT bigfoot DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: Re: termios and raw mode
In-Reply-To: <199905181753.RAA88756@out5.ibm.net>
Message-ID: <Pine.SUN.3.91.990519103444.14875Q-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 18 May 1999, Mark E. wrote:

> In looking at the modified version of tminit.c in Bash 2.03 because of 
> your question, I came across some code that I'm not sure is correct. 
> The modified tminit.c hooks handles 0, 1, and 2 to call a fsext handler 
> (__libc_termios_fsext) which in the case of __FSEXT_write always 
> uses __libc_termios_write_raw_tty to write out the output. Does this 
> sound correct?

Taken at face value (I didn't have too much time to look at the
modified tminit.c), it doesn't sound to be correct.  Uisng raw_tty
will e.g. output \n without adding \r to it, which is wrong when
writing to the console.

Note that the code in the FSEXT hook which does use cooked mode is
ifdef'ed away.  Perhaps this is because v2.01 and v2.02 bypass the
termios hook for buffered stdio functions like getc, fread, putc,
fwrite, and their derivatives; maybe the tminit code uses raw mode to
work around the related misfeatures (e.g., to prevent converting
NL->CRLF twice).  The new v2.03 code does call the termios hook in
buffered stdio functions.  So I think you should test the modified
tminit with the new code (unless you did that already) and see if you
need to change it (why does it need FSEXT at all? perhaps another
work-around?).

If you want to check this now, I can tell you which files to check out
of CVS (they are quite a few) to get the new termios hook support.

> If you need to see the source for this tmint.c, it's 
> available by itself from my site's Bash download menu.

You posted the diffs to djgpp-workers, and I saved them.  So I have
the modified version already.

- Raw text -


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