You can do this by typing screen -t "Terminal 3".
Now let's create one more terminal and name it at the same time. You can use the up and down arrow keys or j/k to move between them. You should now be able to type Ctrl-a " again and see both terminals. Rename it one more time by typing Ctrl-a A and calling it Terminal 2. The first way to create a new terminal is by typing Ctrl-A c. Now, let's create two more terminals and give them different names. If you press Ctrl-a " again, you should see the terminal listed by the title we gave it. You should see a prompt appear at the bottom asking you to give the window a title. Currently, you should only have one terminal open, with the number 0 and a default name of the shell you are using.
While in screen, type the command Ctrl-a " to see a list of open terminals. Screen provides a couple useful ways of managing multiple terminal windows. To see a list, you can view the help by pressing Ctrl-a ? (control-a followed by a question mark). However, you now have many different options that weren't available before. It's the same exact terminal you're already familiar with. What you see afterwards should look very familiar.
#Exit ssh on mac how to#
I explain how to disable this screen later in the article. The first thing you will see is the startup screen, which you can dismiss by pressing either space or return. Is Screen right for you? Here is a simple guide to get you started quickly and help you decide if it fits your workflow.
#Exit ssh on mac windows#
Now, if I ever accidentally close the Terminal application or get disconnected over SSH, the state of all my windows and processes will remain the same. Screen is able to solve both of these problems simply and elegantly. What if you could start the script once and know it's still running in the background even if you've opened and closed the Terminal application many times since the script was started? If you simply ran the script from the terminal, the script would need to be restarted every time you closed the terminal window. Suppose you're running a script in the background that monitors a folder and compiles CoffeeScript files into JavaScript as the files change. Here's a similar scenario that I ran into recently. Wouldn't it be great if you could just reconnect later and not only check on the progress, but also have all of your terminal windows in the same state as how you left them? Suppose you want to SSH to a computer, start some long-running process, and not have to worry about keeping the connection open for that process to finish. Although there is a slight learning curve with Screen, there is one major advantage that more than makes up for the extra effort. For the last week, I have been using GNU Screen to help me manage my terminal windows.