how to restore default characteristics of terminal in fpc + crt program? lazarus / 39-Graphics ---------------------------------------------------------------------- anchar · 2019-09-17 09:40 Default terminal characteristics (on linux mint) are: black background and grey font. After launching fpc program with TextColor(Red) and TextBackground(White) and quit out of a program, terminal still has red font and white background. The goal is to find a solution wich will restore default characteristics (black background and grey font) of terminal. thanks for your attention. ---------------------------------------------------------------------- Handoko · 2019-09-17 12:32 Have you tried to run these right before exit the program: TextColor(White); // or maybe Grey TextBackground(Black); ---------------------------------------------------------------------- anchar · 2019-09-17 13:23 you are right, but i would like to find a solution which take into account settings of user`s terminal (TextColor, for example, will be red or black and TextBackground will be blue or green) ---------------------------------------------------------------------- Handoko · 2019-09-17 13:58 My Ubuntu Mate Terminal has black text with white background. As far as I know Linuxes are very flexible with terminal. Users can install any one she/he likes, and each terminal may has its own default color. I haven't tried, but maybe this is what you need: https://www.freepascal.org/docs-html/rtl/crt/normvideo.html ---------------------------------------------------------------------- lucamar · 2019-09-17 14:27 In case it matters, I did a quick test: changing colors (twice, just in case) and then using NormVideo did (more or less) work in gnome- terminal. "More or less" because some colors don't show right (most notably in the background, even if in Black..DarkGray), but that is irrelevant for this thread ---------------------------------------------------------------------- winni · 2019-09-17 15:08 Hi! A Linux terminal is reset to his default values with Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i reset  If you only want to clear the terminal and the color stuff then use Code: Bash  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i clear  Winni ---------------------------------------------------------------------- anchar · 2019-09-18 12:34 the solution is not pretty nice, but worked (from here: https://wiki.freepascal.org/Executing_External_Programs#TProcess). you should paste the code to the relevant places in a program: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses    process;var    reset_process: TProcess;begin    reset_process := TProcess.Create(nil);    reset_process.Executable := 'reset';    reset_process.Options := reset_process.Options + [poWaitOnExit];    reset_process.Execute;    reset_process.Freeend.