In KDE's Konsole, I can do the following from the terminal:
dcop kwin KWinInterface currentDesktop
And it will tell me which desktop my terminal is connected to
How can I determine what desktop number the current gnome terminal in a gnome session is connected to?
