I'm writing a script that spawns a
screen process but depends on some pre-conditions I intend to perform before attaching to it.
I noticed that when started in detached mode it does not recognize the
$TERM, but I do not want to hardcode it on
.screenrc, and I did not find anyone with the same problem.
Here's my environment:
$ screen --version Screen version 4.06.02 (GNU) 23-Oct-17 $ echo $TERM xterm-256color
Here you can see it works as expected:
$ screen -ADRS profile $ echo $TERM screen.xterm-256color
But if done this way it goes all wrong:
$ screen -dmS profile # I will perform some stuff here, then: $ screen -ADrS profile # here you can notice the colors have gone $ echo $TERM screen
How can I spawn a detached
screen but get the same
$TERM behavior as it was in the first case, without hardcoding the term on