Commits

Burak Gürsoy  committed e84c45c

Change terminal title under OSX

  • Participants
  • Parent commits 79aff43

Comments (0)

Files changed (1)

 use Text::Template::Simple;
 
 use constant IS_WINDOWS         => $^O =~ m{ \A MSWin }xmsi;
+use constant IS_OSX             => $^O eq 'darwin';
 use constant BASE               => $ENV{BURAK_BUILD_BASE};
 use constant MAX_MODNAME_LENGTH => 3;
 use constant RAMGB              => 1024**2;
     my $t   = $START_TIME ? time - $START_TIME : 0;
     $@ ? _print( sprintf L('bench.error'), $t )
        : _print( sprintf L('bench.ok'), Time::Elapsed::elapsed( $t, $LANG ) );
+    system q(echo "\033]0;\007\c") if IS_OSX;
 }
 
 sub L {
 
 sub run {
 
-    system title => sprintf '%sv%s', __PACKAGE__, $VERSION if IS_WINDOWS;
+    if ( IS_WINDOWS ) {
+        system title => sprintf '%sv%s', __PACKAGE__, $VERSION;
+    }
+
+    if ( IS_OSX ) {
+        system sprintf q(echo "\033]0;%s v%s\007\c"), __PACKAGE__, $VERSION;
+    }
 
     _print sprintf L('start.message'), __PACKAGE__, $VERSION;
     my $eok = eval { hello(); 1; };