Spawn a Command Line application Window and output log information

BoQsc vaidas.boqsc at gmail.com
Tue May 19 10:05:00 UTC 2020


On Monday, 18 May 2020 at 20:00:51 UTC, BoQsc wrote:

> I'm kind of stuck right now on how.


Some more Updates and it seems that it is impossible to scroll 
the history of the output.


import std.stdio   : write, writeln, readln, writefln;
import std.process : spawnShell, wait, executeShell, kill, 
thisProcessID;
import core.thread.osthread : getpid;
import std.process : environment;
import std.file : getcwd;
import std.file : thisExePath;

void main() {
	spawnShell( "cls" ).wait;
	executeShell("title HelloWorld");
	executeShell("chcp 65001");
	executeShell("mode con: cols=120 lines=30");
	

	
	
     writeln("Hello, World!");
	writeln("
	 ▄ .▄▄▄▄ .▄▄▌  ▄▄▌            ▄▄▌ ▐ ▄▌      ▄▄▄  ▄▄▌  ·▄▄▄▄
	██▪▐█▀▄.▀·██•  ██•  ▪         ██· █▌▐█▪     ▀▄ █·██•  ██▪ ██
	██▀▐█▐▀▀▪▄██▪  ██▪   ▄█▀▄     ██▪▐█▐▐▌ ▄█▀▄ ▐▀▀▄ ██▪  ▐█· ▐█▌
	██▌▐▀▐█▄▄▌▐█▌▐▌▐█▌▐▌▐█▌.▐▌    ▐█▌██▐█▌▐█▌.▐▌▐█•█▌▐█▌▐▌██. ██
	▀▀▀ · ▀▀▀ .▀▀▀ .▀▀▀  ▀█▄▀▪     ▀▀▀▀ ▀▪ ▀█▄▀▪.▀  ▀.▀▀▀ ▀▀▀▀▀•
                         The Adventures of HelloWorld");
	writeln("
			   ┌──------------┐
			   ▒░░░┼┼┼┼┼┐ ≡▒░ ¦
			___▒▒▒▒▒▒┼┤┼▒▒▒▒▒▒▓");
			
	writeln("
			   ~¨(··)¸
			     <│ >
			    ‗┌═¬‗´
			  ");
			
	writeln("Path to executable and the filename: ", thisExePath());
	writeln("Current Working Directory: ", getcwd());
	writeln();
	writeln("Accessible files from these Environment Paths");
	writeln(environment["PATH"]);
	writeln();
	writeln("Access TEMP environmental variable: ", 
environment.get("TEMP"));
	writefln("Current process id: %s", getpid());
	writeln("This process id: ", thisProcessID());
	
	string line;
	write("Your Input: ");
	while ((line = readln()) !is null) {
		if (line == "exit\x0a") {
			writeln("Going down");
			return;
		}
	    write(line);
		write("Your Input: ");
		}
}


More information about the Digitalmars-d-learn mailing list