* Sadrul Habib Chowdhury had this to say on [01 Oct 2009, 15:58:36 -0400]: > * Ryan Lynch had this to say on [01 Oct 2009, 15:45:04 -0400]: > > I know that I can send commands to a running 'screen' session, using > > the `screen -X <command>...` option, but it seems like this is a > > one-way street. This command never seems to return any output--if > > there is any response, it's usually only visible inside the screen > > session, itself. > > > > Is if possible to query a running screen session for its parameters, > > or at least redirect the status output, so that a detached script can > > read, say, the current window list? > > > > Not yet. I am currently in the process of adding this support, however. > The basic framework to get back a response from an existing screen > session has been implemented. Now the commands need to be updated to > properly produce the response to send back as the query result. I am > going to update the 'info', 'lastmsg' and 'windows' commands for this > first. What other commands do you think a script might want to query? > > Stay tuned!
Hey, remember this? Well, I finally managed to update the commands for this. I have merged the results in the main branch. If someone tries it out, please let me know how it goes, and I am open to suggestions/requests etc. Right now, the commands you can query are: echo info lastmsg select time title windows The exit status will be non-zero if some command fails. So, for example, you can detect if a particular window exists by looking at the exit status of: 'screen -Q select non-existent-window' The man/info-pages have also been updated. Bug reports/suggestions/requests/patches are welcome. Cheers, Sadrul _______________________________________________ screen-users mailing list screen-users@gnu.org http://lists.gnu.org/mailman/listinfo/screen-users