I'm trying to find a scriptable way to determine the currently active screen display. I have multiple displays connected to a single screen session, and I'd like to use the "at" command to send commands to a particular display.
Specifically, I have a script like this: #!/bin/bash screen -r -X select emacs emacsclient "$1" && screen -r -X select . You can use it to open a file in an existing emacs process while simultaneously switching to the "emacs" window. Then when the file is closed, emacsclient returns and we switch back to the window where we started. It works great when there's only one display connected to the session. But if there are multiple displays, the second screen command takes effect on the display most recently created. I know I can use "at" to name a specific display, but I don't know how to determine which display to name. #!/bin/bash screen -r -X select emacs emacsclient "$1" && screen -r -X select . CURRENT_DISPLAY=??? screen -r -X at $CURRENT_DISPLAY% select . Any ideas? Thanks, Ed _______________________________________________ screen-users mailing list screen-users@gnu.org http://lists.gnu.org/mailman/listinfo/screen-users