It's a follow-up of Why does gedit keep randomly opening new instances when opening files from nautilus? On Ubuntu 12.04 with Unity:
I double click on a text file on the desktop or through Nautilus. Gedit opens a new instance. That's fine.
I open gnome-terminal on the same display/screen. I type "gedit", it opens a new different window on the same display/screen.
Why is that? I tried to log "is_in_viewport" referenced in the above question, but I didn't get useful information. What is missing in the terminal environment so that gedit opens a new window though it should not as I'm on the same screen/display and the border condition is not true.
Note that in the terminal, echo $DISPLAY returns :0 and echo $SCREEN returns nothing.