Once you have started a screen session, and then made a group inside it, it will put you in the groups "windowlist" (C-A ") - at that point you can start new shells the normal way (C-A c). To switch out of the group to the default one, either switch by number to a shell, or go into the windowlist and hit backspace.
I would describe this feature as more of a UI navigation tweak so that you don't have 30 shells in your status bar. I wouldn't be surprised if it's not fully implemented for scripting externally via the -X flag. You might (or might not) have more luck using the :source <file> command. Another idea would be to pass in data via environment variables. HTH On Tue, May 30, 2023 at 10:18 AM Tim Landscheidt <t...@tim-landscheidt.de> wrote: > > Hi, > > background: I use Screen 4.09.00 to control Emacs either in > a local GUI terminal or an SSH client from my phone by using > a command à la: > > | screen -dRS emacs_gnus sh -c 'pidof emacs || emacs -nw -f gnus' > > I want to customize Emacs's browse-url et al. so that they > do the Right Thing™ depending on which device I'm controll- > ing Emacs from. My current game plan is to enhance the com- > mand above so that prior to executing Screen, it notes the > controlling device in some file /var/run/user/… that I can > then read in Emacs and act upon its contents. But it would > be more appropriate and better reusable code to consider > this information a "property" of the Screen session. Look- > ing at the Screen manual, at first I thought I might store > the information in a register, but groups ("local", "de- > vice1", "device2", etc.) appear to be more fitting. > > So I launch a test session: > > | $ screen -dRS test > > and, in another terminal, I try to assign the session to a > group and (unsuccessfully) query its name: > > | $ screen -S test -X group local > | $ screen -S test -X group > | $ > > Rereading the manual, I note that it says: "Once a new group > is created, it will act as a container for windows and even > other groups." So I assume that I need to create the group > before using it: > > | $ screen -S test -X screen -t local //group > | $ > > This causes the "test" session to show a screen with the > title "Group: local" and leaves me without a clue how to re- > turn to my shell prompt. But even though it did something, > it did not succeed to assign the session to something query- > able from the command line: > > | $ screen -S test -X group local > | $ screen -S test -X group > | $ screen -S test -ls > | There is a screen on: > | 64047.test (Attached) > | 1 Socket in /run/screen/S-tim. > | $ > > So (how) can I create a group, assign a session to it, and > query the group a session is assigned to? > > TIA, > Tim >