git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/3] test-terminal: set output terminals to raw mode

From
Thomas Rast <trast@student.ethz.ch>
Date
Dec 12, 2011, 19:01 UTC
Message-ID
<201112122001.36303.trast@student.ethz.ch>
In-Reply-To
<20111212182318.GE31793@elie.hsd1.il.comcast.net>
Jonathan Nieder wrote:
Show 14 quoted lines
> Thomas Rast wrote:
> 
> > Not setting them to raw mode causes funny things to happen, such as
> > \n -> \r\n translation:
> [...]
> > To avoid this, set the (pseudo)terminal to raw mode.  Note that the
> > IO::Pty docs recommend doing it on both master and slave.
> 
> Good idea, so for what it's worth,
> Acked-by: Jonathan Nieder <jrnieder@gmail.com>
> 
> Does this change the behavior in
> <https://rt.cpan.org/Ticket/Display.html?id=65692> (oh please oh
> please)?
I don't think so.  I tested this tweak of the script:
  perl -MIO::Pty -MFile::Copy -e '
    for (my $i = 0;; $i++) {
      my $master = new IO::Pty;
      my $slave = $master->slave;
      $master->set_raw();
      $slave->set_raw();
      if (fork == 0) {
        close $master or die "close: $!";
        open STDOUT, ">&", $slave or die "dup2: $!";
        close $slave or die "close: $!";
        exec("echo", "hi", $i) or die "exec: $!";
      }
      close $slave or die "close: $!";
      copy($master, \*STDOUT) or die "copy: $!";
      close $master or die "close: $!"; wait;
    }
  '
That's over ssh on
  $ uname -a
  Darwin mackeller.inf.ethz.ch 11.1.0 Darwin Kernel Version 11.1.0: Tue Jul 26 16:07:11 PDT 2011; root:xnu-1699.22.81~1/RELEASE_X86_64 x86_64

What's odd is that when I was logged in at university (over Gbit ethernet, but still over ssh), the unmodified version wouldn't even get off the ground. I may just have been dreaming however.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Jonathan NiederNext: Jonathan Nieder
Message 4 of 16 in “test-terminal: give the child an empty stdin TTY”
  1. 1/3 test-terminal: give the child an empty stdin TTYThomas Rast, Dec 12, 2011
  2. 2/3 test-terminal: set output terminals to raw modeThomas Rast, Dec 12, 2011
  3. Jonathan NiederDec 12, 2011
  4. Thomas RastDec 12, 2011
  5. Jonathan NiederDec 13, 2011
  6. 3/3 t/lib-terminal: test test-terminal's sanityThomas Rast, Dec 12, 2011
  7. Jonathan NiederDec 12, 2011
  8. Jonathan NiederDec 12, 2011
  9. Thomas RastDec 12, 2011
  10. Jonathan NiederDec 12, 2011
  11. Junio C HamanoDec 12, 2011
  12. Junio C HamanoDec 12, 2011
  13. Thomas RastDec 12, 2011
  14. Jeff KingDec 12, 2011
  15. Junio C HamanoDec 12, 2011
  16. Jonathan NiederDec 12, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.