Howto:Showing the FlightGear console on Windows

From FlightGear wiki
Revision as of 07:28, 4 September 2016 by Hooray (talk | contribs)
Jump to navigation Jump to search
This article is a stub. You can help the wiki by expanding it.

Running flightgear from an already open command window has one small advantage - when flightgear exits (or crashes) the command window, complete with the log messages, stays open. Running from a batch file (unless one puts a "press any button to continue" trap at the end of the batch file) closes the window, and you don´t know what lead to the crash.[1]


To show the console it is now necessary to start from the command line.

The full method that I use is as follows. I will detail all of the steps to help those who are not familiar with Windows and the command line. If you already have fgfs as a desktop icon, steps 2 and 3 speed things up a lot.

  1. Make a shortcut to FGFS on the desktop. To do this open the folder that contains fgfs.exe and right-click drag fgfs to the desktop. This creates a shortcut icon.
  2. Right-click the FGFS desktop icon and select "open file location". This is a simple way to open the folder that contails fgfs.exe.
  3. Left click the File tab on the window showing the fgfs directory. Wih the left mouse button held down select "Open command prompt".
  4. A black windows command box will open (still known by many as the DOS command window). The directory will be the one containg fgfs.exe. Typing the Dir command will show other programs, such as fgrun, that are contained in this directory.
  5. Type the command fgfs, followed by any of the normal fgfs arguments, such as --aircraft, --airport., and flightgear will run.
  6. For ease of use set up a .fgfsrc file as described in the main documentation. However be aware that .fgfsrs options conflict badly with the new launcher, and the .fgfsrc file needs to be disabled (I move it to another directory) when you use the launcher.
  7. You can also start flightgear using the command fgrun in this "DOS" box, or you can start with the newlauncher with the comand fgfs --launcher .

All of the flightgear and fgrun log messages will now apear in the "DOS" window.

The reason for changing to this system and getting rid of the old --console option, was to make the error reporting (STDERR) work properly. [2]

The reason is that a console window opened by an application (e.g. running fgfs --console) is not the same as a native windows command window from which an application (e.g. fgfs) is started typing a command at the prompt.. It was discovered that error reports were not being sent to a console window that was opened with the --console option. Also it was not possible to pipe output to a file from the window that was opened by the fgfs --console method. For historical reasons the fgfs log file is not (as many folk believe) the same as the log printed in the console window.[3]


References