Running screen in WSL

I recently started using WSL (Windows Subsystem for Linux) quite a bit and ended up needing multiple tabs opened. Right now, WSL does not support having multiple tabs natively, and I had to find an alternative. I decided to go with the good old screen but ran into some issues while running screen in Windows Subsystem for Linux.

Since screen is pre-installed in WSL (Ubuntu), I assumed that it would be working out of the box. But while trying to run it, I ended up with various errors:

The quick fix would be to run screen as root (with sudo) but that annoyed me, I really wanted to run it as my user.

After a bit of googling around, I managed to find a fix that works for me: change the directory screen uses to store its internal information. Luckily, screen allows an environment variable to control this directory: SCREENDIR. I have zero credit to take for this solution, I only googled around and found a nice little one already working 🙂

I decided to go with a simple sub-directory under my home and use that:

Remember to edit ~/.bashrc to add the export line to make this permanent!


Tagged . Bookmark the permalink.

Leave a Reply