Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'd like to have few virtual session in one putty window and change between them quickly. What's the best way to do that? screen? I know I can detach with ctrl+ad and then reattach to a different session, but it's seems like a lot of typing.

share|improve this question
add comment

3 Answers

Just to expand on what Ansgar said in case you aren't very familiar with gnu screen, Having multiple "windows" in a single screen session will likely accomplish what you need.

ctrl+a, c will create a new "window" in your active screen session. You can switch between multiple windows (as Ansgar indicated) with ctrl+a, n for the next window, and ctrl+a,p for the previous window.

ctrl+a," will give you a list of all your open windows.

Using these easy shortcuts will let you switch between different terminals very quickly and easily, accomplishing your goal without using multiple screen sessions.

If you add the following line to ~/.screenrc it will always display your open windows and which one is selected, so you don't need to keep track of which window you're on by remembering.

hardstatus alwayslastline '%{= kg}[ %{G}%H %{g}][%= %{= kB}%?%-Lw%?%{+b r}(%{G}%n*%f %t%?(%u)%?%{r})%{-b B}%?%+Lw%?%?%= %{g}%]'

This is the hardstatus line that I like to use, but it's completely customizable (see man page or search google for "gnu screen hardstatus").

There are a ton of other things you can do with it (naming the different open windows for example), so it's worth reading some tutorials.

Here are a couple I found with a quick search:

http://news.softpedia.com/news/GNU-Screen-Tutorial-44274.shtml

http://www.ibm.com/developerworks/aix/library/au-gnu_screen/

And of course the most useful of all:

# From your terminal:
$ man screen

Hope that helps.

Matthew

share|improve this answer
add comment

Yes, screen is most likely the way to go. Ctrl+a,n will take you to the next window, Ctrl+a,p to the previous one. Ctrl+a,0..9 will allow you to switch to a particular screen.

share|improve this answer
add comment

What the others say is correct. I just want to mention tmux is an alternative to screen. They have very similar commands.

Both screen and tmux offer multiple windows for a running session, and this is probably what you want. tmux additionally offers jumping between multiple sessions (each having their own windows). You'd need that very rarely.

Here are some links to the documentation of screen and a crash course about tmux.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.