When creating a new shell session, the DISPLAY variable is set accordingly (it can be :0, :1, localhost:0, etc.). If I accidentally messed up the DISPLAY variable, usually I want it reset to this default value (which changes depending on setup).
My question is, how can I programmatically (via bash script) get the DISPLAY variable as it would have been when creating a new shell?
Other questions / answers usually involving just hard coding export DISPLAY=0:0 or something similar which isn't what I want (since the correct DISPLAY variable may be different)
My naive attempts
bash -c 'echo $DISPLAY'
don't work because subshells inherit the current shell variables