IRB doesn't prompt for MSWin32


#1

artone$B$G$9!#e(B

Ruby-1.9.1-RC1e$B$Ne(BIRBe$B$G!"%W%m%s%W%H$HF~NO$N%(%3!<%P%C%/$,I=<($5$l$^$;$s!#e(B
e$B!Je(BMSWin32e$B!"e(BVC++6e$B!Ke(B
irb/input-method.rbe$B$N0J2<$N=$@5$GI=<($5$l$k$h$&$K$J$C$?$N$G$9$,!"K\Ev$Ke(B
e$B$3$l$,E,@Z$JJ}K!$+$I$&$+$O$o$+$j$^$;$s!#e(B

*** input-method.rb~ Fri Dec 26 17:06:33 2008
— input-method.rb Sun Jan 04 01:00:11 2009
*************** module IRB
*** 106,112 ****
@eof = false

@stdin = IO.open(STDIN.to_i, :external_encoding => 

IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => “-”)
! @stdout = IO.open(STDOUT.to_i, :external_encoding =>
IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => “-”)
end

    def gets

— 106,112 ----
@eof = false

@stdin = IO.open(STDIN.to_i, :external_encoding => 

IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => “-”)
! @stdout = IO.open(STDOUT.to_i, ‘w’, :external_encoding =>
IRB.conf[:LC_MESSAGES].encoding, :internal_encoding => “-”)
end

    def gets


arton removed_email_address@domain.invalid


#2

ruby-deve$B$K$O$O$8$a$F%a!<%k$7$^$9!"$"$$$6$o$G$9!#e(B

artone$B$5$s$H$$J$8$/e(BMSWin32e$B!"e(BVC++6e$B$N4D6-$Ge(Birbe$B$r5/F0$9$k$H$N%(%3!<%P%C%/$$h$Se(B
e$B%W%m%s%W%H$,I=<($5$l$^$;$s!#e(B
–prompt inf-ruby e$B$^$?$Oe(B --inf-ruby-mode
e$B$r;XDj$7$F5/F0$9$k$H%W%m%s%W%H$b%(%3!<%P%C%/$be(B
e$BI=<($5$l$k$h$&$K$J$j$^$9!#e(B --prompt
defaulte$B$de(Bsimplee$B!"e(Bxmpe$B$G$O%(%3!<%P%C%/$b%W%m%s%W%H$be(B
e$BI=<($5$l$^$;$s!#e(B

e$B$^$?!“e(Birb/input-method.rbe$B$Ke(Bartone$B$5$s$HF1$8=$@5$r$7$F5/F0$9$k$H!”%W%m%s%W%H$H%(%3!<%P%C%/$Oe(B
e$B!Je(Binf-rubye$B$N>uBV$G!KI=<($5$l$k$N$G$9$,!"e(Bbackspacee$B$r2!$7$?$H$-$N5sF0$,$*$+$7$/$J$k$h$&$G$9!#e(B

e$B$J$*!"e(BDebiane$B$Ge(BRuby-1.9.1-RCe$B$Ne(Birbe$B$r5/F0$7$F$bLdBj$O5/$-$J$$$G$9!#e(B

2009/01/04 1:05 arton removed_email_address@domain.invalid:


#3

e$B$1$$$8$e!w$$$7$D$+$G$9e(B.

In [ruby-dev :37687 ] the message: "[ruby-dev:37687] Re: IRB doesn’t
prompt for MSWin32 ", on Jan/04 01:28(JST) “Ayumu A.” writes:

ruby-deve$B$K$O$O$8$a$F%a!<%k$7$^$9!"$"$$$6$o$G$9!#e(B

e$B$I$b$G$9e(B.

artone$B$5$s$H$$J$8$/e(BMSWin32e$B!"e(BVC++6e$B$N4D6-$Ge(Birbe$B$r5/F0$9$k$H$N%(%3!<%P%C%/$$h$Se(B
e$B%W%m%s%W%H$,I=<($5$l$^$;$s!#e(B
–prompt inf-ruby e$B$^$?$Oe(B --inf-ruby-mode e$B$r;XDj$7$F5/F0$9$k$H%W%m%s%W%H$b%(%3!<%P%C%/$be(B
e$BI=<($5$l$k$h$&$K$J$j$^$9!#e(B --prompt defaulte$B$de(Bsimplee$B!"e(Bxmpe$B$G$O%(%3!<%P%C%/$b%W%m%s%W%H$be(B
e$BI=<($5$l$^$;$s!#e(B

e$B$J$k$[$Ie(B… --inf-ruby-modee$B$@$HBg>fIW$G$9$+e(B,
e$B$=$&$9$k$He(B, Readlinee$B%i%$e(B
e$B%V%i%j$r;H$o$J$$$HBg>fIW$=$&$G$9$Me(B…

–noreadline e$B$He(B --prompt default, simple, xmp
e$B$NAH$_9g$o$;$G<B9T$9$k$He(B
e$B$I$&$J$k$G$7$g$&$+e(B?

e$B$^$?!“e(Birb/input-method.rbe$B$Ke(Bartone$B$5$s$HF1$8=$@5$r$7$F5/F0$9$k$H!”%W%m%s%W%H$H%(%3!<%P%C%/$Oe(B
e$B!Je(Binf-rubye$B$N>uBV$G!KI=<($5$l$k$N$G$9$,!"e(Bbackspacee$B$r2!$7$?$H$-$N5sF0$,e(B
e$B$*$+$7$/$J$k$h$&$G$9!#e(B

backspacee$B$N5sF0Ey$Oe(Birbe$B$G$O$J$/e(B,
Readlinee$B%i%$%V%i%j$,$d$C$F$$$^$9$Ge(B,
Readlinee$B%i%$%V%i%j$b$7$/$Oe(B,
e$B$=$3$H$N%$%s%?!<%U%’!<%9$NLdBj$N$h$&$J5$$,e(B
e$B$7$^$9$Me(B…

__
---------------------------------------------------->> e$B@PDMe(B
e$B7=<ye(B <<—
---------------------------------->> e-mail: removed_email_address@domain.invalid <<—


#4

e$B$O$8$a$^$7$F!"1)EDe(B(e$B$O$M$@e(B)e$B$H?=$7$^$9!#e(B

e$B@PDM7=<ye(B e$B$5$s$O=q$-$^$7$?e(B:

artone$B$5$s$H$$J$8$/e(BMSWin32e$B!"e(BVC++6e$B$N4D6-$Ge(Birbe$B$r5/F0$9$k$H$N%(%3!<%P%C%/$$h$Se(B
e$B%W%m%s%W%H$,I=<($5$l$^$;$s!#e(B
–prompt inf-ruby e$B$^$?$Oe(B --inf-ruby-mode e$B$r;XDj$7$F5/F0$9$k$H%W%m%s%W%H$b%(%3!<%P%C%/$be(B
e$BI=<($5$l$k$h$&$K$J$j$^$9!#e(B --prompt defaulte$B$de(Bsimplee$B!"e(Bxmpe$B$G$O%(%3!<%P%C%/$b%W%m%s%W%H$be(B
e$BI=<($5$l$^$;$s!#e(B
e$B!!;d$b!“e(Bartone$B$5$s$N=j$+$i!”%@%&%s%m!<%I$5$;$FD:$-!"e(Birbe$B$r<B9T$7!"e(B
e$B2?$bI=<($5$l$J$$$N$G!"G:$s$G$*$j$^$7$?!#e(B

e$B$J$k$[$Ie(B… --inf-ruby-modee$B$@$HBg>fIW$G$9$+e(B, e$B$=$&$9$k$He(B, Readlinee$B%i%$e(B
e$B%V%i%j$r;H$o$J$$$HBg>fIW$=$&$G$9$Me(B…
e$B!!2<5-$NDL$j!"$=$N$h$&$K;W$($^$9!#e(B

–noreadline e$B$He(B --prompt default, simple, xmp e$B$NAH$_9g$o$;$G<B9T$9$k$He(B
e$B$I$&$J$k$G$7$g$&$+e(B?
e$B!!;d$N$H$3$m$G$O!“e(B–noreadlinee$B$GMxMQ$7$F$$j$^$9$N$G!"e(B
e$BI=<($5$l$F$
$j$^$9!#e(B
#[e$B%9%?!<%He(B]e$B”*e(B[e$B$9$Y$F$N%W%m%0%i%`e(B]e$B"*e(B[Ruby-1.9.1]e$B"e(B[Ruby-1.9
console]e$B$re(B
#e$B5/F0$7$?8e!"!Ve(Birb --noreadlinee$B!W$H$7$F$
$j$^$9!#e(B

e$B!!:#!";n$7$F$_$^$7$?$i!"e(B
–prompt default e$B$G$O!"HsI=<(e(B
–prompt simplee$B!!$G$O!"HsI=<(e(B
–prompt xmp e$B!!!$G$O!"HsI=<(e(B
e$B$H$$$&>u67$G$7$?!#e(B


#5

e$B!!1)EDe(B(e$B$O$M$@e(B)e$B$G$4$6$$$^$9!#e(B

e$B@PDM7=<ye(B e$B$5$s$O=q$-$^$7$?e(B:

–noreadline e$B$He(B --prompt default, simple, xmp e$B$NAH$9g$o$;$G<B9T$9$k$He(B
e$B$I$&$J$k$G$7$g$&$+e(B?
e$B!!$9$
$^$;$s!#@h$N%a!<%k$G$O!"FI$_4V0c$($F;n$7$F$$$k;v$K5$$,IU$-$^$7$?!#e(B

e$B!!:FEY!";n$7$F$_$^$7$?$i!"e(B
irb --prompt default e$B$G$O!"HsI=<(e(B
irb --prompt simplee$B!!$G$O!"HsI=<(e(B
irb --prompt xmp e$B!!!$G$O!"HsI=<(e(B

irb --noreadline --prompt default e$B$G$O!"e(B irb(mail):xxx:x>
e$B$HI=<(e(B
irb --noreadline --prompt simplee$B!!$G$O!"e(B >> e$B!!$HI=<(e(B
irb --noreadline --prompt xmp e$B!!!$G$O!"e(B
e$BF~NOJ8;z$,I=<($5$l$k!#e(B
e$B$H$$$&>u67$G$7$?!#e(B


#6

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:37687] Re: IRB doesn’t prompt for MSWin32”
on Jan.04,2009 01:28:54, removed_email_address@domain.invalid wrote:

e$B$^$?!“e(Birb/input-method.rbe$B$Ke(Bartone$B$5$s$HF1$8=$@5$r$7$F5/F0$9$k$H!”%W%m%s%W%H$H%(%3!<%P%C%/$Oe(B
e$B!Je(Binf-rubye$B$N>uBV$G!KI=<($5$l$k$N$G$9$,!"e(Bbackspacee$B$r2!$7$?$H$-$N5sF0$,$*$+$7$/$J$k$h$&$G$9!#e(B

e$B%W%m%s%W%H$H%(%3!<%P%C%/$N7o$Oe(Bartone$B$5$s$N%Q%C%A$NDL$j$N%P%0$@e(B
e$B$H;W$$$^$9!#e(B
e$B=PNOe(BIOe$B$r%G%U%)%k%He(B(=e$BFI$9~$@lMQe(B)e$B$G%*!<%W%s$7$F$k$o$1$G$9$+$i!#e(B
e$B$43NG’$r!de(Byuguie$B$5$se(B

e$B%P%C%/%9%Z!<%92!2<;~$N5sF0$K$D$$$F$O!"$"$^$j??LLL$K8+$F$J$$e(B
e$B$G$9$,I=<($,$J$s$+$:$l$kB>$O$A$c$s$HF0$$$F$k$h$&$K8+$($^$9$M!#e(B
e$B$3$l$O$J$s$G$9$+$M$(!#e(B

e$B$=$l$G$O!#e(B


#7

Yuguie$B$G$9!#e(B

On 1/7/09 2:57 PM, U.Nakamura wrote:

e$B%W%m%s%W%H$H%(%3!<%P%C%/$N7o$Oe(Bartone$B$5$s$N%Q%C%A$NDL$j$N%P%0$@e(B
e$B$H;W$$$^$9!#e(B
e$B=PNOe(BIOe$B$r%G%U%)%k%He(B(=e$BFI$9~$@lMQe(B)e$B$G%*!<%W%s$7$F$k$o$1$G$9$+$i!#e(B
e$B$43NG’$r!de(Byuguie$B$5$se(B

e$B$^$C$?$/$b$C$F$=$NDL$j$@$H;W$$$^$9!#D>$7$F$*$-$^$9!#e(B
MacOS
Xe$B$de(Bcygwine$B$@$H$3$l$GF0$$$A$c$&$s$G$9$M$’!#:$$C$?$b$s$@!#e(B


#8

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:37721] Re: IRB doesn’t prompt for MSWin32”
on Jan.07,2009 20:37:59, removed_email_address@domain.invalid wrote:

e$B$G!“e(BIO.opene$B$K!”%U%!%$%k%G%#%9%/%j%W%?$rM?$($k$H!“e(Bstdioe$B$+$I$&$+$N%U%i%0$Ke(B
e$B$OH?1G$5$l$J$$$H$3$m$K2?$+$”$k$N$G$O$J$$$+!"$H;W$$$^$9!#e(B
e$B$=$N7k2L!“e(Bio.ce$B$Ne(Brb_io_stdio_filee$B$NCf$Ge(Brb_fdopene$B$r8F$S=P$9$3$H$K$J$k$o$1e(B
e$B$G!”$3$3$GF@$i$l$ke(BFILEe$B$H!"85$Ne(BMSVCRTe$B$Ne(BFILEe$B$K2?$+!"%3%s%=!<%k<~$j$N=hM}e(B
e$B$K0c$$$,$"$k$N$G$O$J$$$+$H!#e(B

e$B$$C$7$c$k$H$$j$N$h$&$G!"0J2<$N%Q%C%A$G<B83$7$?$H$3$m$G$O@5e(B
e$B>o$KF0:n$7$^$7$?!#e(B
(e$B<B:]$N=$@5$H$7$F$3$l$G$$$$$3$H$K$9$k$+$I$&$+$OHyL/$J$H$3$me(B)

Index: io.c

— io.c (revision 21369)
+++ io.c (working copy)
@@ -5963,6 +5963,12 @@ rb_io_initialize(int argc, VALUE *argv,
fp->encs = convconfig;
clear_codeconv(fp);
io_check_tty(fp);

  • if (fileno(stdin) == fd)

  • fp->stdio_file = stdin;

  • else if (fileno(stdout) == fd)

  • fp->stdio_file = stdout;

  • else if (fileno(stderr) == fd)

  • fp->stdio_file = stderr;

    return io;
    }

e$B$=$l$G$O!#e(B


#9

In article removed_email_address@domain.invalid,
“U.Nakamura” removed_email_address@domain.invalid writes:

e$B=PNOe(BIOe$B$r%G%U%)%k%He(B(=e$BFI$9~$@lMQe(B)e$B$G%*!<%W%s$7$F$k$o$1$G$9$+$i!#e(B

Unix e$B$G$Oe(B fd e$B$re(B F_GETFL
e$B$7$FFI$_=q$-%b!<%I$rD4$Y$k$N$G!#e(B


#10

artone$B$G$9!#e(B

e$B;n$7$F$_$?$N$G$9$,!"$3$l$^$G$OF0$$$F$$$?$o$1$G!“e(B
@stdout = STDOUT if RUBY_PLATFORM =~ /mswin32/
e$B$G$b!“e(Birb+readlinee$B$KBP$9$k4|BTDL$j$K$OF0$/$N$G$9$,!”$”$^$j$K8e$m8~$-$JJ}e(B
e$BK!$J$N$G!"$b$&>/$7$I$&$K$+$7$?$$$H$3$m$G$9!#e(B
e$B$G!“e(BIO.opene$B$K!”%U%!%$%k%G%#%9%/%j%W%?$rM?$($k$H!“e(Bstdioe$B$+$I$&$+$N%U%i%0$Ke(B
e$B$OH?1G$5$l$J$$$H$3$m$K2?$+$”$k$N$G$O$J$$$+!"$H;W$$$^$9!#e(B
e$B$=$N7k2L!“e(Bio.ce$B$Ne(Brb_io_stdio_filee$B$NCf$Ge(Brb_fdopene$B$r8F$S=P$9$3$H$K$J$k$o$1e(B
e$B$G!”$3$3$GF@$i$l$ke(BFILEe$B$H!"85$Ne(BMSVCRTe$B$Ne(BFILEe$B$K2?$+!"%3%s%=!<%k<~$j$N=hM}e(B
e$B$K0c$$$,$"$k$N$G$O$J$$$+$H!#e(B


#11

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

In message “[ruby-dev:37717] Re: IRB doesn’t prompt for MSWin32”
on Jan.07,2009 18:25:45, removed_email_address@domain.invalid wrote:

e$B=PNOe(BIOe$B$r%G%U%)%k%He(B(=e$BFI$9~$@lMQe(B)e$B$G%*!<%W%s$7$F$k$o$1$G$9$+$i!#e(B
e$B$43NG’$r!de(Byuguie$B$5$se(B

e$B$^$C$?$/$b$C$F$=$NDL$j$@$H;W$$$^$9!#D>$7$F$*$-$^$9!#e(B
MacOS Xe$B$de(Bcygwine$B$@$H$3$l$GF0$$$A$c$&$s$G$9$M$’!#:$$C$?$b$s$@!#e(B

e$B<B$Oe(BF_GETFLe$B$,$"$k4D6-$G$Oe(B(e$B$C$F$?$V$se(Bmswine$B0J30A4It$J5$$,$7$^$9e(B
e$B$,e(B)e$B!"8=:$NFI$=q$-%b!<%I$,<h$l$k$N$G!"e(Bmodee$B;XDj$OL5;k$5$l$k$se(B
e$B$G$9$h$M!<!#e(B

e$B%9%/%j%W%H:n<T$5$s$K$O!V%b!<%I;XDj=q$$$F$Me(B!e$B!W$HAJ$($F$O$*$-$?e(B
e$B$$$N$G$9$,!“e(Bwin32e$B%l%$%d$NJ}$G$J$s$+$7$?J}$,$$$$$N$+$J$”!"$H$$e(B
e$B$&5$$b$7$F$O$$$^$9!#e(B

e$B$=$l$G$O!#e(B