Skip to main content
edited tags
Link
chaos
  • 49.4k
  • 11
  • 129
  • 147
Source Link
iia
  • 33
  • 2

Replace screen process from within screen

I have configured my shell to exec screen when it starts, unless it's already running within a screen session. So in a TTY, the process tree will look like something like this:

login───screen───screen───zsh.

In almost every case, this is what I want, but sometimes I would like to run something without screen, and I would like to do so without changing my usual setup. I'm looking for a command that replaces the topmost screen process with somehting else, e.g., a shell, like this:

login───bash,

without having to log back out and make temporary changes to my .zshrc or use chsh.