windows console prompt customization lazarus / 8-Other ---------------------------------------------------------------------- taazz · 2015-06-06 09:38 I'm feeling a bit down lately, I was trying to re-leave my youth as a chip pick me up and remembered my first 286 baby AT computer I had. It had a lot of + but the one thing I can use today and I can't seem to remember how to do it was its command prompt. for one it was only printing the current directory not the path I was in but the most important it was that it had the prompt appear on the bottom of the screen even if I did a clr (dos I know). it will clear the screen and jump to the bottom to print the prompt. I just can't seem to remember how to do that, by the way although I always used a 80x25 screen I remember that I could change the size ( no resolution on those days ) vertically and horizontally and it will auto adjust it self. a good simple customization that I can't remember how to do it in todays windows, linux commands and ideas are welcome too although from what I have seen on the net the linux console can even have bitmap backgrounds these days.  As I said just a small "pick me up" for old farts like me. Thank you for any guidance. ---------------------------------------------------------------------- lucamar · 2015-06-06 10:53 Just print 25 blank lines and return. Screen cleared and prompt at the bottom. ;-) Changing the size was ususally made either by using the command MODE or reprograming the video card. On EGAs and up you could also call some INT 10h BIOS service to change the font size (hence the number of lines on screen) ---------------------------------------------------------------------- taazz · 2015-06-06 11:03 Quote from: lucamar on June 06, 2015, 12:53:33 pmJust print 25 blank lines and return. Screen cleared and prompt at the bottom. ;-) Changing the size was ususally made either by using the command MODE or reprograming the video card. On EGAs and up you could also call some INT 10h BIOS service to change the font size (hence the number of lines on screen) well thats a thought but we are talking about the console prompt here I don't know how the user chooses to clear the screen ee calling cls running a clrscr custom program etc. the point was that the prompt would recognize the empty screen and place it self at the bottom and I can't just print 25 empty lines (ee $_$_$_$_ etc 24 times$g) what happens with the data other programs print? it would clear the screen after every program execution . ---------------------------------------------------------------------- taazz · 2015-06-06 12:18 well found a semi solution just download ansicon from http://adoxa.altervista.org/ansicon/ extract it to any folder and run ansicon -i. You can now use ansi escape code to manage your prompt ee $e[25;80f$_$P$_$+$g should make for an interesting prompt but it uses the entire buffer not only the window so while cls will jump to the end of screen and print the prompt any other command that will move the buffer down will interfear with the positioning and make it appear anywhere but the bottom :S oh well at least I can now play around with a more capable prompt. Next find a way to jump to 25th line only if the current line is smaller than 25. ---------------------------------------------------------------------- Cyrax · 2015-06-06 12:51 Grab JCL library from here https://github.com/project- jedi/jcl/tree/master/jcl and use JclConsole unit for your needs. ---------------------------------------------------------------------- rvk · 2015-06-06 13:17 Quote from: taazz on June 06, 2015, 02:18:13 pmYou can now use ansi escape code to manage your prompt ee $e[25;80f$_$P$_$+$g should make for an interesting prompt but it uses the entire buffer not only the window so while cls will jump to the end of screen and print the prompt any other command that will move the buffer down will interfear with the positioning and make it appear anywhere but the bottom You could set the screen-buffer (as well as the screen size) to 80x25. That's what you had in the good old DOS-days After that the screen- buffer is the same size as you dos-screen so positioning won't get screwed up by your commands. ---------------------------------------------------------------------- Never · 2015-06-06 16:16 @taazz Getting the screen handle and screen info and setting the cursor with SetConsoleCursorPosition doesn't work for you? Related APIs : GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(AHandle<--Here, ACursorInfo<---Here) SetConsoleCursorPosition(AHandle<--Here, ANewCoord<---Here); Currently i'm not able to test but i'm pretty sure it will work Edit *** :  This answer [ http://forum.lazarus.freepascal.org/index.ph p/topic,26668.msg168509.html#msg168509 ] (rel thread : http://forum.la zarus.freepascal.org/index.php/topic,27608.msg170978.html#msg170978 ) might be needed as well to set the desired dimensions ---------------------------------------------------------------------- taazz · 2015-06-06 22:01 Guys although I do enjoy all those programming bits and kept all of them in my personal codelib for reference, the subject is "console prompt" customization as in customize the prompt I see when I run cmd.exe on windows or the equivalent in linux, which I hate by the way, I always use the 7th login (if memory serves me right) which is configured to a full screen cli because the graphic consoles I have seen in linux so far are terrible. So although installing ansicon was outside my primary premise it is required in order to get any kind of miningful optimization so I changed the game to include it. I'm not going to write a ansicon my self just for a trip down the memory lane, not yet any way. In any case thank you everyone for the bits shared. ---------------------------------------------------------------------- wildfire · 2015-06-08 10:48 Perhaps something in google can help? https://www.google.co.uk/search?q=customise+command+prompt+windows+7&i e=utf-8&oe=utf-8&gws_rd=cr&ei=k3J1VeTMGcHTUZqdgKAG The info on this page looks promising... http://www.hanselman.com/blog/ABetterPROMPTForCMDEXEOrCoolPromptEnviro nmentVariablesAndANiceTransparentMultiprompt.aspx Final EDIT: You'll need Ansicon for the cursor movements etc... https://github.com/adoxa/ansicon All this is untested but hopefully it's enough to point you in the right direction.