May 19, 2020 Re: Spawn a Command Line application Window and output log information | ||||
---|---|---|---|---|
| ||||
Posted in reply to BoQsc | 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: "); } } |
May 23, 2020 Re: Spawn a Command Line application Window and output log information | ||||
---|---|---|---|---|
| ||||
Posted in reply to BoQsc | On Tuesday, 19 May 2020 at 10:05:00 UTC, BoQsc wrote: > 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. Some relevant discussion: https://stackoverflow.com/a/5779422/3789797 |
Copyright © 1999-2021 by the D Language Foundation