I'm running a program (concretely xfoil) and during calculations it opens and closes a window automatically. I would like the pop-up window to keep hidden.

Create control file:

cat <<EOF > controlfile.xfoil
NACA 0012
Flap0.8 0.0425 0.1

RE 1388888
FMOM 0.8 0.0425


Run file from terminal and save output:

xfoil < controlfile.xfoil >outputfile.out

When running it you'll see briefly a pop-up window.

How can I keep the pop-up window hidden? Luckily the source code of xfoil is available and I could compile a version without the window, but I would prefer not having to.

  • I ran into exactly the same problem. Thank you for asking this question! Sep 9 '20 at 9:56

It is a bit excessive, but you can start a 2nd X11 server with no framebuffer and direct your display there:

Xvfb :1 &
sleep 2
DISPLAY=:1 xfoil <controlfile.xfoil >outputfile.out
kill -15 $!
  • Why is sleep 2 necessary?
    – Jacek
    Jun 24 '16 at 13:59
  • 2 is an arbitrary number, you may need more or less. The problem is you have to wait for Xvfb to run far enough for it to create the socket needed by xfoil to connect to. To avoid all problems you should really run a small loop, doing sleep 1 and then checking if Xvfb is ready, eg with if DISPLAY=:1 xdpyinfo >/dev/null...
    – meuh
    Jun 24 '16 at 14:49
  • Is there anything special to consider when using this from a bash script? When I run these commands from the command line, then everything works fine. However, when I put those commands into a script, then I get the error xdpyinfo: unable to open display ":99". Sep 9 '20 at 10:40
  • @FelixCrazzolara Sorry, I don't know why you are getting that error.
    – meuh
    Sep 11 '20 at 17:09

There is a top menu in XFoil called plotting options, which you can access with PLOP. Then the command G F for graphic output : false will disable these pop-ups.

So in your program that would be the addition of:


At the very beginning. Don't forget the empty line so that you go back to top menu !

  • Just to be clear, this only prevents the XFOIL display window itself from opening. On my MacOS computer, it still keeps opening an empty pop-up dock icon (with no XFOIL display). This pop-up steals focus, which is the really annoying thing. The answer by @meuh solves the complete problem, though it's pretty hacky!
    – supergra
    Jun 10 '20 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.