[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening multiple windows in a screen from a detached state.

From: David T. Pierson
Subject: Re: Opening multiple windows in a screen from a detached state.
Date: Sat, 03 May 2014 22:41:44 -0400
User-agent: Mutt/1.5.21 (2010-09-15)

On Wed, Apr 23, 2014 at 06:55:29PM -0400, David Blackman-Mathis wrote:
> I am trying to automate the process of running, in parallel, every
> file in a directory in new windows in a new screen session.  The
> portion of this I'm missing is the ability, from an attached state, to
> open a new window and name it.  I think this might have to do with the
> screen "screen" command, but I can't find any working examples of what
> I'm looking for, and it's incredibly difficult to google that term.
> I can get as far as:
> screen -D -dmS practice -t first

This response is probably too late to be useful, and I'm not sure I
understand exactly what you were looking for, but perhaps this will help

If you are within a screen session, to start a new window just invoke:

  screen -t newtitle newcommand

for each command you want a new window for.

If you want to start a completely new screen session with multiple
windows, 2 approaches come to mind:

If the set of commands is predetermined, create a custom config

  screen -t firstwindow firstcommand
  screen -t secondwindow secondcommand
  screen -t thirdwindow thirdcommand

and start the screen session using 

  screen -d -m -S sessionname -c config

If the set of commands is to be determined dynamically, you can create a
shell script that starts the new session in detached mode and then sends
the dynamically determined commands to it with screen -X:

  screen -d -m -S sessionname
  screen -r sessionname -X screen -t firstwindow firstcommand
  screen -r sessionname -X screen -t secondwindow secondcommand
  screen -r sessionname -X screen -t thirdwindow thirdcommand

(Actually creating the detached session will create a window too, so the
above will result in a session with 4 windows.)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]