When I ssh to my target (Terasic DE10-Nano, a board with ARM A9 inside FPGA running Ubuntu 18.04 base) from my host (a laptop running Ubuntu 16.04 x86_64), the window created by the program I run on that target can be displayed on the host. That's because when I ssh to that target, the environment variable DISPLAY in the remote shell are always be automatically set to localhost:N.0, where N may be 10, 11, etc, by ssh.
However, when I use Eclipse on the host to remote-debug programs on the target, the window created by the debugged program can not be displayed on the host. Eclipse connects to the target using ssh, but the value of DISPLAY is not set and is blank (verified by: echo $DISPLAY). Once I set DISPLAY to localhost:10.0 in Eclipse, this issue will be solved. (In case it helps, here is how I set it: In Eclipse Oxygen.3's Debug Configuration > Main > Command to execute before application, set this field to export DISPLAY=localhost:N.0. And it's also necessary to manually ssh to the target and make sure the DISPLAY in that remote shell is localhost:N.0)
I'm wondering whether it is possible, during such Eclipse remote-debugging session, DISPLAY can be set automatically? If yes, then neither setting it in Debug Configuration nor manually sshing to the target is required.