Aug 172012

After seeing this blog post, it got me wondering how many people are in the same predicament where they can’t see what they are typing on the console session on the Raspberry Pi from another computer.

For me, I’ve almost always used SSH, unless I misconfigure the network adapter before taking everything down (or kill the WiFi dongle…oops). But for some people, they actually have space, and a TV/Monitor that they can use with the Raspberry Pi, and they can sit at the Pi to type away. But what if you want to see what you’ve done on your Pi on another computer ?

If you SSH in after you’ve done everything, you won’t be able to see the history, or what’s running on the console session.
To get around that, you can add the following line to ~/.bashrc, and it will start a screen session if there isn’t one running already, or attach to one that is running.

screen -R

Putting that into ~/.bashrc will ensure that there will always be a screen session running when you logon ( unless you kill it, in which case it will start another screen session when you login again ). Only downside to that, is that if you kill the screen session that the console login is attached to, you’ll need to either start another screen session from the console, or re-attach to a new screen session on the console.

To get out of screen without killing the session, you need to use the key combo CTRL-A and then D
That will detach the screen session without killing it.

Aug 152012

I have found that occasionally I need multiple windows on my Raspberry Pi so I can keep tabs on top while running a process.
I don’t have a window manager on my Pi however, as I had stripped all of that out.
The solution ?

It has the ability to split the current terminal into 2 terminals so that you can run 2 things side by side and switch between them.
You can use the keyboard key combo CTRL-A and then | to split it side by side, or CTRL-A and then S (this is a capital S) to do a horizontal split.
CTRL-A then TAB will switch between the 2 splits.
When you have just created a new window, you need to switch to the window via CTRL-A , TAB and then hit CTRL-A and then C to start a new session within that new window.
When you’re done, you can hit CTRL-A and then Q to close the other windows.