Skip to content

Commit

Permalink
No longer use unicode in REPL on Windows
Browse files Browse the repository at this point in the history
Windows somehow is so Unicode challenged in its shells, that it is
causing major issues, especially for new users.
  • Loading branch information
lizmat committed Jun 17, 2021
1 parent 48de177 commit 5e1c97b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 7 additions & 5 deletions src/Perl6/Compiler.nqp
Expand Up @@ -24,7 +24,7 @@ class Perl6::Compiler is HLL::Compiler {
nqp::exit(0);
}

method version_string(:$shorten-versions) {
method version_string(:$shorten-versions, :$no-unicode) {
my $config-version := self.config()<version>;
my $backend-version := nqp::getattr(self,HLL::Compiler,'$!backend').version_string;

Expand All @@ -38,14 +38,16 @@ class Perl6::Compiler is HLL::Compiler {
$index := nqp::index($backend-version,"-");
$backend-version := nqp::substr($backend-version,0,$index)
unless $index == -1;

$raku := "๐‘๐š๐ค๐ฎโ„ข";
$rakudo := "๐‘๐š๐ค๐ฎ๐๐จโ„ข";
}
else {

if $no-unicode {
$raku := "Raku(tm)";
$rakudo := "Rakudo(tm)";
}
else {
$raku := "๐‘๐š๐ค๐ฎโ„ข";
$rakudo := "๐‘๐š๐ค๐ฎ๐๐จโ„ข";
}

"Welcome to "
~ $rakudo
Expand Down
5 changes: 4 additions & 1 deletion src/core.c/REPL.pm6
Expand Up @@ -248,7 +248,10 @@ do {

method new(Mu \compiler, Mu \adverbs, $skip?) {
unless $skip {
say compiler.version_string(:shorten-versions);
say compiler.version_string(
:shorten-versions,
:no-unicode(Rakudo::Internals.IS-WIN)
);
say '';
}

Expand Down

0 comments on commit 5e1c97b

Please sign in to comment.