Skip to content

Commit

Permalink
Rational findConsole dispatch for Term::ReadLine.
Browse files Browse the repository at this point in the history
Back in 5.002 or so, if we didn't find /dev/tty and weren't on
Windows, the console was assumed to be sys$command, which only
makes sense on VMS (possibly $^O didn't work yet on VMS?).

Later accretions have assumed that the sys$command default meant
something other than laziness and a second if block with various
specific overrides was added, some of which set the console back
to undef after its having been set to sys$command.

That can all be avoided by simply checking we're on VMS before
setting the console to sys$command and letting it default to
STDIN for cases where we don't know of something else specific
that it should be.
  • Loading branch information
craigberry committed Nov 25, 2012
1 parent 0a616d1 commit c0788ef
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions dist/Term-ReadLine/lib/Term/ReadLine.pm
Expand Up @@ -238,19 +238,12 @@ sub findConsole {
} elsif (-e "con" or $^O eq 'MSWin32' or $^O eq 'msys') {
$console = 'CONIN$';
$consoleOUT = 'CONOUT$';
} else {
} elsif ($^O eq 'VMS') {
$console = "sys\$command";
}

if (($^O eq 'amigaos') || ($^O eq 'beos') || ($^O eq 'epoc')) {
$console = undef;
}
elsif ($^O eq 'os2') {
if ($DB::emacs) {
$console = undef;
} else {
} elsif ($^O eq 'os2' && !$DB::emacs) {
$console = "/dev/con";
}
} else {
$console = undef;
}

$consoleOUT = $console unless defined $consoleOUT;
Expand Down

0 comments on commit c0788ef

Please sign in to comment.