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+AthenD- Detach from current screen sessionCtrl+AthenC- Create a new windowCtrl+AthenN- Next windowCtrl+AthenP- Previous windowCtrl+Athen0-9- Switch to window numberCtrl+Athen"- 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+AthenD
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+AthenDto detach from logs - Don't manually quit screen sessions (use
runnem down) - Check screen sessions with
screen -ls - Use
runnem loginstead 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