Well, just the hack of the day.
$ ps u | awk -v tty=$(cat /sys/class/tty/tty0/active) '$0 ~ tty { print $2 }' | while read pid && [[ "$display" == "" ]]; do display="$(awk -v RS='\0' -F= '$1=="DISPLAY" { print $2 }' /proc/$pid/environ)"; if [ "$display" != "" ]; then echo "$display"; fi; done 2>/dev/null
:0
Can you improve it? So tell me how. o/
The discussion about the topic is on Quora and Linkedin.
Update with improvements
See it on commandlinefu.
$ for p in $(pgrep -t $(cat /sys/class/tty/tty0/active)); do d=$(awk -v RS='0' -F= '$1=="DISPLAY" { print $2 }' /proc/$p/environ 2>/dev/null); [[ -n $d ]] && break; done; echo $d
:0