Ticket #191: issue_191_patch_1_of_1_reee1257336aa.patch
File issue_191_patch_1_of_1_reee1257336aa.patch, 22.0 KB (added by , 6 years ago) |
---|
-
smalltalk.bat
# HG changeset patch # User Patrik Svestka <patrik.svestka@gmail.com> # Date 1521020249 -3600 # Wed Mar 14 10:37:29 2018 +0100 # Branch jv # Node ID eee1257336aa317c8f0022d39b88fb6911f18fac # Parent 6e703805d17586b10be3c76db22908c37258242f Merge with #191 tricky characters for batch file Fixing stx executable and double quotes - to work with path that has spaces in it removing text colors - to speed up execution for non-logging case SETLOCAL DISABLEDELAYEDEXPANSION for non-logging case removing superfluous messages when logging is not used adding %use_color% when no_logging is used considerable speedup fixing timer at :time_in_seconds function to start correctly adding a comment to note the timer section changed version In powershell reverted back to: $stx_switch = [environment]::GetEnvironmentVariable("stx_switch") Adjusting documentation to fit new reality diff -r 6e703805d175 -r eee1257336aa smalltalk.bat
a b 53 53 :: Versions = 54 54 :: ========== 55 55 :: This script 56 SET "batch_script_version=1. 6.8"56 SET "batch_script_version=1.7.0" 57 57 :: Smalltalk/X 58 58 SET "stx_version_default=6.2.6" 59 59 :: Do not change following line, $STX_VERSION_DEFAULT serves 60 60 :: as placeholder and it's being replaced during installation 61 61 :: process (`rake install`) 62 SET "stx_version= %stx_version_default%"62 SET "stx_version="%stx_version_default%"" 63 63 64 64 :: ==================== 65 65 :: Comments and style = … … 70 70 71 71 :: If Microsoft should drop support of :: hack. Change you have to change all :: back to REM 72 72 73 74 73 75 :: ========================================= 74 76 :: Batch file accepts following parameters = 75 77 :: ========================================= … … 307 309 :: ============ 308 310 :: Image name = 309 311 :: ============ 310 SET "default_image_name="!stx.image_name:"=! !stx.image_suffix:"=!""312 SET "default_image_name="!stx.image_name:"=!.!stx.image_suffix:"=!"" 311 313 312 314 :: ============================ 313 315 :: Add encoding to the suffix = … … 676 678 ) ELSE ( 677 679 SET "selected_executable=stx.exe" 678 680 ) 679 SET "smalltalk_executable= "!stx.stx_bin_dir:"=!!selected_executable!""681 SET "smalltalk_executable=!stx.stx_bin_dir:"=!!selected_executable!" 680 682 ) ELSE ( 681 683 682 684 SET "message="The executable stx-bin^.com;exe perhaps stx^.com;exe NOT found."" … … 693 695 :: ========================================================================================== 694 696 SET "temp_stx.image_path=!stx.image_path:"=!!default_image_name:"=!" 695 697 698 :: Running too DEEP IFs a workaround 699 SET "stx.load_default_image=FALSE" 696 700 IF "!stx.__binary.start_with_image!"=="TRUE" ( 697 701 IF "!stx.__binary.list_available_images!"=="FALSE" ( 698 702 IF NOT EXIST "!temp_stx.image_path!" ( 699 REM TOO DEEP MUST FIX 700 REM CALL :colorEcho stx.stdout_cmd_warning "[WARN] The default image: !stx.image_path:"=!!default_image_name:"=! was not found." 701 REM CALL :colorEcho stx.stdout_cmd_warning "[WARN] No image will loaded. If you want to load from image fix your path or image name." 702 ECHO: 703 SET "stx.__binary.start_with_image=FALSE" 703 SET "stx.load_default_image=TRUE" 704 704 ) 705 705 ) 706 706 ) 707 IF "!stx.load_default_image!"=="TRUE" ( 708 CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] The default image: !stx.image_path:"=!!default_image_name:"=! was not found." 709 CALL :printInColor !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] No image will loaded. If you want to load from image fix your path or image name." 710 ) 711 707 712 708 713 :: clearing temp variable 709 714 SET "temp_stx.image_path=" … … 711 716 :: =============================================================================== 712 717 :: Checking existence of logging directory, if not found all logging is disabled = 713 718 :: =============================================================================== 714 IF NOT EXIST "!stx.log_directory!" ( 715 CALL :print_message !use_color! !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] The logging path: !stx.log_directory! NOT found." "[WARN] Logging will be DISABLED." 716 ECHO: 717 SET "stx.__binary.start_with_image=FALSE" 718 SET "stx.__binary.append_to_log=FALSE" 719 IF "!stx.__binary.record_log_file!"=="TRUE" ( 720 IF NOT EXIST "!stx.log_directory!" ( 721 CALL :print_message !use_color! !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] The logging path: !stx.log_directory! NOT found." "[WARN] Logging will be DISABLED." 722 ECHO: 723 SET "stx.__binary.start_with_image=FALSE" 724 SET "stx.__binary.append_to_log=FALSE" 725 ) 719 726 ) 720 727 721 728 :: ================================================================ 722 729 :: Checking existence of log file if not found append is disabled = 723 730 :: ================================================================ 724 IF NOT EXIST "!log_filename!" ( 725 CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] No log file found turning off the append mode." 726 ECHO: 727 SET "stx.__binary.append_to_log=FALSE" 731 IF "!stx.__binary.record_log_file!"=="TRUE" ( 732 IF NOT EXIST "!log_filename!" ( 733 CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] No log file found turning off the append mode." 734 ECHO: 735 SET "stx.__binary.append_to_log=FALSE" 736 ) 728 737 ) 729 738 730 731 739 :: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 732 740 :: Next section follows 733 741 :: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 764 772 ) 765 773 ) 766 774 767 768 :: =====================================================769 :: Adding all parameters available to the %stx_switch% =770 :: Making sure previous switches are taken in account =771 :: =====================================================772 :: Cycle all command-line switches entered in the shell by the user773 :: Encircle all switches (both - and --) by double-quotes774 :: Ignore the command-line switches already with double quotes775 :: Replace single quotes with double quotes if such switch is found776 REM IF "%1" NEQ "" will cause problems if %1 is enclosed in quotes itself.777 REM and you must have the extensions turn on778 779 IF NOT "%~1"=="" (780 SET "stx_manual_switch_detected=TRUE"781 SET "detect_double_switch=--"782 SET "detect_single_switch=-"783 SET "detect_double_quote="-"784 SET "detect_single_quote='-"785 786 FOR %%A IN (%*) DO (787 SET "temp_string=%%~A"788 IF DEFINED stx_switch (789 REM Detect if "" around a switch are used and leave the switch alone790 IF "!temp_string:~0,2!"=="!detect_double_quote!" (791 SET "stx_switch=!stx_switch! %%A"792 REM Detect if '' around a switch are used and convert them to ""793 ) ELSE IF "!temp_string:~0,2!"=="!detect_single_quote!" (794 SET "changed_string=!temp_string:'="!"795 SET "stx_switch=!stx_switch! !changed_string!"796 REM if -- found encircle it with double quotes797 ) ELSE IF "!temp_string:~0,2!"=="!detect_double_switch!" (798 SET stx_switch=!stx_switch! ^"%%~A^"799 REM checks a string for "-" if it contains it it will add double-quotes800 ) ELSE IF "!temp_string:~0,1!"=="!detect_single_switch!" (801 SET stx_switch=!stx_switch! ^"%%~A^"802 ) ELSE (803 SET "stx_switch=!stx_switch! %%A"804 )805 REM stx_switch is not yet defined - first run806 ) ELSE (807 REM Detect if "" around a switch are used808 IF "!temp_string:~0,2!"=="!detect_double_quote!" (809 SET stx_switch=!stx_switch! %%A810 REM Detect if '' around a switch are used and convert them to ""811 ) ELSE IF "!temp_string:~0,2!"=="!detect_single_quote!" (812 SET "changed_string=!temp_string:'="!"813 SET "stx_switch=!stx_switch! !changed_string!"814 REM All other options815 ) ELSE (816 SET stx_switch=^"%%A^"817 )818 )819 )820 REM clearing used variables821 SET "detect_switch_double="822 SET "detect_single_switch="823 SET "detect_double_quote="824 SET "detect_single_quote="825 )826 827 775 :: ====================================================== 828 776 :: Block CMD PowerShell mode from using manual Switches = 829 777 :: ====================================================== … … 837 785 ) 838 786 ) 839 787 840 :: =================================841 :: Three ways to start Smalltalk/X =842 :: =================================843 :: TRUE;TRUE - User will be asked for input; with which image to start844 :: TRUE;FALSE - Stx will start with the default image configured845 :: FALSE;FALSE - Quick start - StX will start without an image846 IF "!stx.__binary.start_with_image!"=="TRUE" (847 IF "!stx.__binary.list_available_images!"=="TRUE" (848 REM USER INPUT849 CALL :user_menu !stx.image_path! stx.image_name !stx.image_suffix!850 CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] Loading selected image !stx.image_name!"851 SET "user_selected_image=!stx.image_name!"852 IF DEFINED internal_runtime_options (853 SET "stx_switch=!stx_switch! !internal_runtime_options! "--image" !user_selected_image!"854 ) ELSE (855 SET "stx_switch=!stx_switch! "--image" !user_selected_image!"856 )857 SET "user_selected_image="858 ) ELSE (859 CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] DEFAULT IMAGE: !stx.image_path:"=!!default_image_name:"=! starts"860 IF DEFINED internal_runtime_options (861 SET "stx_switch="--image" !default_image_name! !internal_runtime_options! !stx_switch!"862 ) ELSE (863 SET "stx_switch="--image" !default_image_name! !stx_switch!"864 )865 )866 ) ELSE (867 IF "!stx.__binary.stx_quick_start!"=="TRUE" (868 IF "!stx_manual_switch_detected!"=="TRUE" (869 CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] Manual switch detected - configuration is ignored"870 SET "stx_switch= !stx_switch!"871 ) ELSE IF DEFINED internal_runtime_options (872 SET "stx_switch="--ignoreImage" !stx_switch! !internal_runtime_options! "--quick""873 ) ELSE (874 SET "stx_switch="--ignoreImage" !stx_switch! "--quick""875 )876 REM clearing configured values877 SET "stx.image_path="878 SET "default_image_name="879 )880 )881 882 788 :: ======================================= 883 789 :: Check if user wants to command prompt = 884 790 :: ======================================= … … 925 831 :: Return back from the log directory 926 832 popd 927 833 834 :: ================================= 835 :: Three ways to start Smalltalk/X = 836 :: ================================= 837 :: TRUE;TRUE - User will be asked for input; with which image to start 838 :: TRUE;FALSE - Stx will start with the default image configured 839 :: FALSE;FALSE - Quick start - StX will start without an image 840 IF "!stx.__binary.start_with_image!"=="TRUE" ( 841 IF "!stx.__binary.list_available_images!"=="TRUE" ( 842 REM USER INPUT 843 CALL :user_menu !stx.image_path! stx.image_name !stx.image_suffix! 844 CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] Loading selected image !stx.image_name!" 845 SET "user_selected_image=!stx.image_name!" 846 IF DEFINED internal_runtime_options ( 847 SET "stx_switch=!stx_switch! !internal_runtime_options! "--image" !user_selected_image!" 848 ) ELSE ( 849 SET "stx_switch=!stx_switch! "--image" !user_selected_image!" 850 ) 851 SET "user_selected_image=" 852 ) ELSE ( 853 CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] DEFAULT IMAGE: !stx.image_path:"=!!default_image_name:"=! starts" 854 IF DEFINED internal_runtime_options ( 855 SET "stx_switch="--image" "!stx.image_path:"=!!default_image_name:"=!" !internal_runtime_options! !stx_switch!" 856 ) ELSE ( 857 SET "stx_switch="--image" "!stx.image_path:"=!!default_image_name:"=!" !stx_switch!" 858 ) 859 ) 860 ) ELSE ( 861 IF "!stx.__binary.stx_quick_start!"=="TRUE" ( 862 IF "!stx_manual_switch_detected!"=="TRUE" ( 863 CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] Manual switch detected - configuration is ignored" 864 SET "stx_switch= !stx_switch!" 865 ) ELSE IF DEFINED internal_runtime_options ( 866 SET "stx_switch="--ignoreImage" !stx_switch! !internal_runtime_options! "--quick"" 867 ) ELSE ( 868 SET "stx_switch="--ignoreImage" !stx_switch! "--quick"" 869 ) 870 REM clearing configured values 871 SET "stx.image_path=" 872 SET "default_image_name=" 873 ) 874 ) 875 876 :: ===================================================== 877 :: Adding all parameters available to the %stx_switch% = 878 :: Making sure previous switches are taken in account = 879 :: ===================================================== 880 :: Loop via all command-line switches entered by the user 881 882 :: If logging is used then the execution is done in PowerShell 883 IF NOT "%~1"=="" ( 884 SET "powershell_stx_switch=" 885 SETLOCAL DISABLEDELAYEDEXPANSION 886 887 :process_arguments 888 REM Process all arguments in the order received 889 SET "user_param=%1" 890 IF DEFINED user_param ( 891 SET "powershell_stx_switch=%powershell_stx_switch% "%~1"" 892 SHIFT 893 GOTO:process_arguments 894 ) ELSE ( 895 REM On the last run add all previous switches 896 REM SET "powershell_stx_switch=%powershell_stx_switch% %stx_switch%" 897 SET "stx_switch=%powershell_stx_switch% %stx_switch%" 898 ) 899 ) 900 SETLOCAL ENABLEDELAYEDEXPANSION 901 928 902 929 903 :: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 930 904 :: Next section follows … … 942 916 REM -WindowStyle Normal Sets the window style to Normal, Minimized, Maximized or Hidden. 943 917 REM -NoProfile - launches without a profile 944 918 REM -ExecutionPolicy Bypass - does not ask for passwords if used privileged command. 945 SET exec_command$=CALL !powershell_exec! -WindowStyle Normal -nologo -noninteractive -NoProfile -ExecutionPolicy Bypass -Command "& {!powershell_script_file! -executable '!smalltalk_executable :"=!' -log_file '!stx.log_directory:"=!!log_filename:"=!' -log_file_encoding '!stx.log_file_encoding!' -append_to_log '!stx.__binary.append_to_log!' -cmd_close '!cmd_close!' -PowerShellVersion '!PowerShellVersion!' -cmd_in_powershell '!stx.__binary.cmd_in_powershell!' -stx_manual_switch_detected '!stx_manual_switch_detected!'};"919 SET exec_command$=CALL !powershell_exec! -WindowStyle Normal -nologo -noninteractive -NoProfile -ExecutionPolicy Bypass -Command "& {!powershell_script_file! -executable '!smalltalk_executable!' -log_file '!stx.log_directory:"=!!log_filename:"=!' -log_file_encoding '!stx.log_file_encoding!' -append_to_log '!stx.__binary.append_to_log!' -cmd_close '!cmd_close!' -PowerShellVersion '!PowerShellVersion!' -cmd_in_powershell '!stx.__binary.cmd_in_powershell!' -stx_manual_switch_detected '!stx_manual_switch_detected!'};" 946 920 ) ELSE ( 947 ECHO: 948 CALL :print_message !use_color! !stx.stdout_WarningBackgroundColor! !stx.stdout_WarningForegroundColor! "[WARN] NO LOGGING" 949 ECHO: 950 CALL :print_message !use_color! !stx.stdout_VerboseBackgroundColor! !stx.stdout_VerboseForegroundColor! "[INFO] User disabled or limitation applies." "[INFO] Executing: cmd.exe !cmd_close:"=! CALL !smalltalk_executable:"=! !stx_switch!" 951 SET "exec_command$=cmd.exe !cmd_close! CALL !smalltalk_executable:"=! !stx_switch!" 921 SETLOCAL DISABLEDELAYEDEXPANSION 922 IF "!use_color!"=="TRUE" ( 923 ECHO: 924 CALL :print_message %use_color% %stx.stdout_WarningBackgroundColor% %stx.stdout_WarningForegroundColor% "[WARN] NO LOGGING" 925 ECHO: 926 CALL :print_message %use_color% %stx.stdout_VerboseBackgroundColor% %stx.stdout_VerboseForegroundColor% "[INFO] User disabled or limitation applies." "[INFO] Executing: cmd.exe %cmd_close:"=% CALL %smalltalk_executable:"=% %stx_switch%" 927 ) ELSE ( 928 ECHO: 929 ECHO "[WARN] NO LOGGING" 930 ECHO: 931 ECHO "[INFO] User disabled or limitation applies." 932 ECHO "[INFO] Executing: cmd.exe %cmd_close:% CALL %smalltalk_executable% %stx_switch%" 933 ECHO: 934 ) 935 SET "exec_command$=cmd.exe %cmd_close% CALL %smalltalk_executable% %stx_switch%" 952 936 ) 953 937 954 938 :: =========== 955 939 :: Execution = 956 940 :: =========== 941 SETLOCAL ENABLEDELAYEDEXPANSION 957 942 :: An alternative working too 958 943 REM START /B /W !exec_command$! 959 944 … … 1180 1165 ECHO "Select your stx image (sorted from the newest; if files of same then alphabetic order is used):" 1181 1166 ECHO: 1182 1167 (FOR /F "delims=" %%A IN ('dir !input_image_path!^*^.!input_image_suffix! /B /O^:-DN 2^>NUL') DO ( 1183 SET "__stx_image_path.%counter_get_answer%=%%~dpnxA" 1168 ECHO %%~nxA 1169 SET "__stx_image_path.%counter_get_answer%=!input_image_path!%%~nxA" 1184 1170 ECHO "[!counter_get_answer!] => !__stx_image_path.%counter_get_answer%! 1185 1171 SET /A "counter_get_answer+=1" 1186 1172 )) || REM … … 1206 1192 :: ECHO "DEBUG: strip quotes: .!user_input:"=!. 1207 1193 SET "user_input=!user_input:"=!" 1208 1194 1195 1209 1196 :: If you really want to reject the variable with any quotation mark... 1210 1197 :: FIND /V- Displays all lines NOT containing the specified string. 1211 1198 SET user_input | FIND /V """" >NUL … … 1261 1248 SET "stx_break=" 1262 1249 (FOR /F "delims=" %%A IN ('dir !input_image_path!^*^.!input_image_suffix! /B /O^:-DN 2^>NUL') DO IF NOT DEFINED stx_break ( 1263 1250 IF "!verified_user_input!"=="!counter_get_file!" ( 1264 SET "__stx_image_path=" %%~dpnxA""1251 SET "__stx_image_path="!input_image_path!%%~nxA"" 1265 1252 SET "stx_break=yes" 1266 1253 ) ELSE IF "!counter_get_answer!" LSS "!counter_get_file!" ( 1267 1254 SET "__stx_image_path="Unknown path"" … … 1426 1413 CALL powershell -nologo -noninteractive -NoProfile -ExecutionPolicy Bypass -Command %long_command% 1427 1414 GOTO :EOF 1428 1415 1416 1417 :: ======= 1418 :: Timer = 1419 :: ======= 1429 1420 :time_in_seconds 1430 1421 FOR /F %%A IN ('wmic os get LocalDateTime ^| find "."') DO ( 1431 1422 SET "dts=%%A" … … 1516 1507 ECHO -- object to execute the stx executable. It brings two benefits: 1517 1508 ECHO -- a) stdout and stderrr are independent and asynchronous from the executable 1518 1509 ECHO -- b) all output is recorded correctly into the log file. 1510 ECHO -- b) all output is recorded correctly into the log file. 1511 ECHO -- User can adjust the refresh rate for the asynchronous powershell output via __numeric.start_sleep_in_debug variable 1519 1512 ECHO: 1520 1513 ECHO: 1521 1514 ECHO: … … 1723 1716 ECHO 5) The .lnk files are tested on Windows 7 SP1 (known to not work on Windows XP, you have to use the batch file directly.) 1724 1717 ECHO 6) When using CMD PowerShell mode manual (user) switches can not be used. When used the batch file forces CMD only mode. 1725 1718 ECHO 7) The launcher can have issues with double-quotes and quotes within - escape them when needed - e.g. use double double quotes to escape 1726 ECHO 8) Issues with the "!" character to add it you have to use escape ^ character e.g. --eval "Transcript showCR: 'Bang^^^!'." 1727 ECHO 9) Any switch containing question mark (?) will be ignored - batch file FOR limitation e.g. smalltalk -I --quick --eval "Transcript showCR: 'How are you?'." 1728 ECHO The whole "Transcript showCR: 'How are you?'." will be "eaten" by batches FOR statement. 1719 ECHO: 1720 ECHO 8) Characters ^^^< ^^^& ^^^| ^^^> need to be escaped with triple batch escaping character: ^^^. 1721 ECHO Inner, within double or single quotes, double or single quotes can not be used. 1722 ECHO: 1723 ECHO Note: Using the multiple tricky characters together within one command can cause the command to fail altogether 1724 ECHO: 1725 ECHO User input validation is tricky in batch files. There is no foolproof user validation. 1726 ECHO You can visit http://www.robvanderwoude.com/battech_inputvalidation_commandline.php for more. 1727 ECHO: 1728 ECHO: 1729 ECHO Examples how to correctly escape tricky characters: 1730 ECHO: a) smalltalk -P "Stdout nextPutLine: '^^^|'" 1731 ECHO: b) smalltalk -P "Stdout nextPutLine: '^^^>'" 1732 ECHO: c) smalltalk -P "Stdout nextPutLine: '^^^&'" 1729 1733 ECHO: 1730 1734 ECHO: 1731 1735 ECHO: -
smalltalk.ps1
diff -r 6e703805d175 -r eee1257336aa smalltalk.ps1
a b 16 16 # StX switches which are build during batch file execution $env:stx_switch 17 17 $stx_switch = [environment]::GetEnvironmentVariable("stx_switch") 18 18 19 19 20 # PowerShell version detected during batch file execution $env:powershell_version_all_functionality 20 21 If (![String]::IsNullOrEmpty([environment]::GetEnvironmentVariable("powershell_version_all_functionality"))) { 21 22 $stx_powershell_version = [environment]::GetEnvironmentVariable("powershell_version_all_functionality") … … 307 308 [System.Object] $sender, 308 309 [System.Diagnostics.DataReceivedEventArgs] $events 309 310 ) 311 310 312 # Where to log 311 313 $file_log = $Event.MessageData.file_logging 312 314 313 315 ForEach ($line in $events.data) { 314 316 Write-Verbose "[stdout]: $line" -Verbose 315 316 317 # write to the log file 317 318 $exec_with_logging = @" 318 319 Write-Output '[stdout]: $line' | $file_log 319 320 "@ 320 321 Invoke-Expression -Command:$exec_with_logging 321 322 322 } 323 323 } -MessageData $passing_variable 324 324 # /Out Listener - stdout