Advanced Topics
Screen Basics
runnem uses GNU screen to manage your services. Understanding screen basics will help you get the most out of runnem.
What is Screen?
GNU screen is a terminal multiplexer that allows you to:
- Run multiple terminal sessions in a single window
- Detach from sessions and reattach later
- Share sessions between users
- Keep processes running even when disconnected
Screen Commands
Basic Navigation
Ctrl+A
thenD
- Detach from current screen sessionCtrl+A
thenC
- Create a new windowCtrl+A
thenN
- Next windowCtrl+A
thenP
- Previous windowCtrl+A
then0-9
- Switch to window numberCtrl+A
then"
- List all windows
Session Management
screen -ls
- List all screen sessionsscreen -r
- Reattach to last detached sessionscreen -r <session>
- Reattach to specific sessionscreen -X quit
- Quit a screen session
How Runnem Uses Screen
runnem creates a screen session for each service:
# When you run
runnem up api
# runnem creates a screen session like
screen -S runnem-api -dm bash -c "cd ~/projects/myapp/api && npm run dev"
Viewing Logs
When you run runnem log api
, runnem:
- Finds the screen session for the service
- Attaches to it to show the logs
- You can detach with
Ctrl+A
thenD
Multiple Services
Each service runs in its own screen session:
# List all screen sessions
screen -ls
# You might see
runnem-api
runnem-frontend
runnem-database
Best Practices
- Use
Ctrl+A
thenD
to detach from logs - Don't manually quit screen sessions (use
runnem down
) - Check screen sessions with
screen -ls
- Use
runnem log
instead of manual screen commands - Let runnem manage screen sessions for you
Troubleshooting
If you encounter screen-related issues:
- Check for orphaned sessions:
screen -ls
- Clean up old sessions:
screen -X -S <session> quit
- Verify runnem can access sessions:
runnem list