Rails bin/dev via GNU screen
mouse 286 · person cloud · link
Last update
2024-03-01
2024
03-01
«run Procfile.dev within GNU screen»

Prepend to bin/dev:

1
2
3
4
5
6
7
8
if command -v screen &> /dev/null; then
  rc_file="tmp/screenrc"
  grep -E -v "^(screen|select|source) " $HOME/.screenrc 2> /dev/null > $rc_file
  nl bin/Procfile.dev | \
    sed -r 's/^\s*([0-9]+)\s*([^:]+): (.+)/split\nfocus\nscreen -t \2 \1 \3/' | \
    tail -n +3 >> $rc_file
  exec screen -c $rc_file
fi

Source: kyrylo.org and overmind